Re: Programming to an Interface
- From: Robert Martin <unclebob@xxxxxxxxxxxxxxxx>
- Date: Sun, 28 May 2006 12:45:55 -0500
On 2006-05-13 16:23:01 -0500, ram@xxxxxxxxxxxxxxxxxx (Stefan Ram) said:
"H. S. Lahman" <h.lahman@xxxxxxxxxxx> writes:I think the point here is that one designs the interface first
and then the implementation.
I also think so. Therefore, I was astonished when I read a
printing of »Applying UML and Patterns«, where Craig Larman,
when designing a class first decided which fields are needed
and then which methods.
By »interface first«, I would first decide about the interface
(i.e., which operations should be supported by the object),
then I would ask how to implement them (which includes to
decide which fields [instance variables] are needed).
I agree with the spirit of this idea. Designing interfaces first is a great goal. However, it can only be approached asymptotically. Sometimes we design classes because we know what data they hold, and then we think about their behavior. This is just human nature; and part of the creative process. In such cases the discovery of interfaces can come late rather than early.
--
Robert C. Martin (Uncle Bob) | email: unclebob@xxxxxxxxxxxxxxxx
Object Mentor Inc. | blog: www.butunclebob.com
The Agile Transition Experts | web: www.objectmentor.com
800-338-6716 |
.
- References:
- Programming to an Interface
- From: GoogleEyeJoe
- Re: Programming to an Interface
- From: Patrick May
- Re: Programming to an Interface
- From: GoogleEyeJoe
- Re: Programming to an Interface
- From: H. S. Lahman
- Programming to an Interface
- Prev by Date: Re: Programming to an Interface
- Next by Date: Re: Programming to an Interface
- Previous by thread: Re: Programming to an Interface
- Next by thread: Re: Programming to an Interface
- Index(es):
Relevant Pages
|
|