Re: D5 - Class\Collection example??
- From: Don <don81846<NODAMSPAM>@earthlink.net>
- Date: Sun, 14 Oct 2007 21:44:07 -0700
On Sun, 14 Oct 2007 18:21:46 +0200, Hans-Peter Diettrich
<DrDiettrich1@xxxxxxx> wrote:
Maarten Wiltink wrote:
The social consequences of this code are left as an exercise to the
reader.
IMO this is the point that makes it really complicated. When a partner
dies, will it be wiped out, or will it stay in the history? What after a
divorce, will it be allowed to marry the same partner later again? What
if the real parents are unknown, or differ from the current caretakers
(adoption...)? Are multiple marriages legal, what when illegal bigamy is
found out?
In the basic model a collection of partners (children...) can be
implemented, with the desired filtering in derived classes. Then the
base class has to check only for Self and IsPartner, before adding an
new partner to the collection. The IsPartner method might take into
account the current date, date of marriage, and date of divorce, so that
it will be possible to add the same partner later again.
One also could implement a bureaucracy (object), which determines
whether a relation is legal, and updates the partners' records
appropriately.
DoDi
Of course my example of a collection of wives was to be funny but the
substance of your points are well worth considering when designing an
object heirarchy. It's hard to anticipate all the possible twists and
turns.
Thanks to Tom and all that responded. It will help me understand the
Delphi way.
Thank you,
Don
.
- Follow-Ups:
- Re: D5 - Class\Collection example??
- From: Hans-Peter Diettrich
- Re: D5 - Class\Collection example??
- References:
- D5 - Class\Collection example??
- From: Don
- Re: D5 - Class\Collection example??
- From: Tom de Neef
- Re: D5 - Class\Collection example??
- From: Maarten Wiltink
- Re: D5 - Class\Collection example??
- From: Hans-Peter Diettrich
- D5 - Class\Collection example??
- Prev by Date: Re: D5 - Class\Collection example??
- Next by Date: Re: D5 - Class\Collection example??
- Previous by thread: Re: D5 - Class\Collection example??
- Next by thread: Re: D5 - Class\Collection example??
- Index(es):
Relevant Pages
|