Re: OODesign - OPF, design pattern
- From: "Joanna Carter [TeamB]" <joanna@xxxxxxxxxxxxx>
- Date: Wed, 29 Aug 2007 17:31:05 +0100
Aleksander Oven a écrit :
What I had in mind were very specific design patterns, which (if you're
using them) force you to write code in a round-about way. For example,
when I hear someone tell me they're going to use the Visitor pattern to
extend their class, I always cringe a little. Why can't they simply
change the class in question? It's under their control, for goodness
sake!
Because, as Peter said, the Visitor is a way of applying additional functionality, not just to one class, but usually, to a hierarchy of classes, without having to touch all of the classes on the hierarchy. If there is only one class involved, then there really isn't a need for a Visitor.
I can see a big problem with this. It may be fine for a single
developer, or even two developers who think alike. But a team of
developers can hardly be left waiting while one of them is tweaking
the framework. It becomes a serious bottleneck!
I was project leader with a company that needed to write a Delphi GUI to represent and manage a hierarchical data mechanism written in Java.
The first task was to define an interface to the data nmechanism.
Then, one team wrote the Java data mechanism to comply with that interface whilst the Delphi team lashed together a dummy data mechanism in Delphi so that they could test the GUI. Once the interface was decided, both teams could work in perfect isolation until the moment when the Java side of things was ready. Then all it took was changing three lines of code to acces the real data instead of the dumy data.
Oooh, another pet peeve! Code generators.
Now here I would agree with you, but only since switching to .NET 2.0 with generics which obviates the need for typesafe repetition of things like collection classes, etc.
My problem is, I've seen no convincing real-world examples where it
actually made sense to do things so radically differently from the
conventional ways. It all seems to be just focus-shifting in the end -
do you make all your changes here, or do you make them there (and
there... oh, yes, and over there, too :))?
Unfortunately, many of us who at at the "cutting edge" of framework design are in the same position as Peter, where we are not allowed to share too freely that which we know for contractual reasons.
Joanna
--
Joanna Carter [TeamB]
Consultant Software Engineer
.
- Follow-Ups:
- Re: OODesign - OPF, design pattern
- From: Peter Morris
- Re: OODesign - OPF, design pattern
- References:
- OODesign - OPF, design pattern
- From: Alan T
- Re: OODesign - OPF, design pattern
- From: Peter Morris
- Re: OODesign - OPF, design pattern
- From: Alan T
- Re: OODesign - OPF, design pattern
- From: Peter Morris
- Re: OODesign - OPF, design pattern
- From: Aleksander Oven
- Re: OODesign - OPF, design pattern
- From: Peter Morris
- Re: OODesign - OPF, design pattern
- From: Aleksander Oven
- OODesign - OPF, design pattern
- Prev by Date: Re: dcc32.cfg question
- Next by Date: Re: Highlander entitlement??
- Previous by thread: Re: OODesign - OPF, design pattern
- Next by thread: Re: OODesign - OPF, design pattern
- Index(es):
Relevant Pages
|