Will coughed up:
> I am looking at the Gang of Four
> Design Patterns and wondering
[quoted text clipped - 40 lines]
> every application should be considered on its
> own merits.
Repost this immediately in comp.object. You'll get a *lot* of good answers
there!!!!

Signature
Doesn't /anyone/ know where I can find a credit card company that
emails me the minute something is charged to my account?
Will - 22 Sep 2005 17:05 GMT
TY Thomas, I have reposted on the group: comp.object.
Will skrev:
> But in my experience, most classes are
> not similar enough to do this.
No great insight to offer, but I will say that my experience matches
yours; but I do not seek such similarity between most classs.
> If we want ultimate cohesion and decoupling, then
> why don't we make a separate a class of every
> property and method and use use 100s of interfaces?
> What spaghetti trhat would be!
Engineering is compromise. It's rarely cost-efficient to take one
dimension of engineering and optimise it at the expense of all others.
The flexibility OO offers is not free: comprehensibility suffers as a
consequence.
Ultimate cohesion is not a great design goal: if it were, software
engineering would be rather easy. A good design goal is a
cost-efficient optimisation of flexibility, performance,
comprehensibility, and quality, all while delivering required
functionality on-time. No easy trick.
Do note, however, that Design Patterns also harps on about variance
encapsulation: a strong reason for putting an implementation behind an
interface is that you expect the implementation to change or you expect
to add new implementations, all without changing the interface.
If your two types of vehicle have a tax and a list price, then you
should put both behind the same interface if you expect to encounter
other types of tax and list prices that can be managed with the same
interface. If you can't, then don't bother with the expense of the
abstractions.
> Or are we back to
> every application should be considered on its
> own merits.
Perhaps not every application, but every project should be considered
on its merits, as perhaps has always been the case. For some customers
time-to-market is everything, so quality will take a nose dive;
safety-critical software no doubt takes longer to test so productivity
will take a nose dive. Horses for courses.
.ed
--
www.EdmundKirwan.com - Home of The Fractal Class Composition.