Re: A Design Problem
- From: "Daniel T." <daniel_t@xxxxxxxxxxxxx>
- Date: Fri, 24 Aug 2007 16:35:36 -0400
Nick Keighley <nick_keighley_nospam@xxxxxxxxxxx> wrote:
-> Tool class will have all the methods which can be called on at
least one type of tool and have the default implementation which will
just throw some exception.
ah. that frightened me as well. I was thinking a do-nothing method
instead was a good idea, but apparently not.
A do-nothing method is perfectly acceptable, and IMHO preferred. Just
keep in mind, this means the method can have no post-condition (strictly
speaking the post-condition is "true".)
The natural question then becomes, why bother calling such a method? You
see, the purpose of the method changes in this case. You are calling the
method to inform the object of something, rather than to get it to do
something. This changes the entire design paradigm from procedural to OO.
You should be sending messages to objects, informing it of things it
wants to know about, not sending commands demanding it change its state
in a particular way.
.
- Follow-Ups:
- Re: A Design Problem
- From: Dmitry A. Kazakov
- Re: A Design Problem
- References:
- A Design Problem
- From: Mousam
- Re: A Design Problem
- From: H. S. Lahman
- Re: A Design Problem
- From: Nick Keighley
- A Design Problem
- Prev by Date: Re: A Design Problem
- Next by Date: Re: Shortcuts in UML activity diagrams
- Previous by thread: Re: A Design Problem
- Next by thread: Re: A Design Problem
- Index(es):