Re: Separation of API and implementation
- From: hforco2@xxxxxxxxxxxxxx
- Date: Tue, 14 Aug 2007 16:29:13 -0000
As a practical matter this would be further enforced at the OOA/D level
by not passing 'y' as a reference to B::foo at all. Instead one would
instantiate a relationship between the B object and 'y'. Whoever
instantiates that relationship (by assigning the reference) would
encapsulate the rule that 'y' can only be a Yb. Then the B object just
collaborates with whoever is on the other end of the relationship
regardless of what interface is used and everything will Just Work. The
main purpose of relationships in the OO paradigm is to limit
participation in collaborations so we should take advantage of that.
Do you have a simple example of this - I don't fully grasp what you
mean by creating a relationship as opposed to a collaboration.
(Really appreciate the response - still trying to understand it all!)
.
- Follow-Ups:
- Re: Separation of API and implementation
- From: H. S. Lahman
- Re: Separation of API and implementation
- References:
- Separation of API and implementation
- From: hforco2
- Re: Separation of API and implementation
- From: H. S. Lahman
- Separation of API and implementation
- Prev by Date: Re: Separation of API and implementation
- Next by Date: Re: Design by Contract vs Law of Demeter : Preconditions
- Previous by thread: Re: Separation of API and implementation
- Next by thread: Re: Separation of API and implementation
- Index(es):
Relevant Pages
|