[MUD-Dev] Object Models

Miroslav Silovic silovic at zesoi.fer.hr
Tue Nov 28 15:05:38 CET 2000


"John Buehler" <johnbue at msn.com> writes:

> Imagine the 'loose' contract in construction of a fastener as opposed to a
> bolt, screw, rivet or rubber band.  If you order 1000 fasteners from a
> supplier, who knows what you'll get.  The tighter contracts of bolt, etc,
> are still pretty loose.  Would you just order 1000 bolts?  You still don't
> know enough for your purposes.  So you order certain length, shaft, thread,
> etc bolts.  That's a tight contract.

The Right solution to this is to use a slight variant of the
covariance principle in OO language design. Components (or libraries
or modules or whatever you choose to call them) should guarantee as
tight a contract as possible, while modules that use these components
should impose as loose contracts as possible. In other words,
components should be specced in a way that says 'no less than this'
while the clients should have requirements that end with 'and nothing
more than this'. This way, even if you are forced to change one side
of a contract, there's a good chance that you won't hit the wall on
the other side.

--
How to eff the ineffable?
_______________________________________________
MUD-Dev mailing list
MUD-Dev at kanga.nu
https://www.kanga.nu/lists/listinfo/mud-dev



More information about the mud-dev-archive mailing list