[Home] [Groups] - Message: [Prev in Group] [Next in Group]

nu.kanga.list.mud-dev

15838: Re: [MUD-Dev] Object Models

[Full Header] [Plain Text]
From: Miroslav Silovic <silovic@zesoi.fer.hr>
Newsgroups: nu.kanga.list.mud-dev
Date: 28 Nov 2000 15:05:38 +0100
References: [1]
Organization: Kanga.Nu
"John Buehler" <johnbue@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@kanga.nu
https://www.kanga.nu/lists/listinfo/mud-dev