Re: D5 - Class\Collection example??
- From: Jamie <jamie_ka1lpa_not_valid_after_ka1lpa_@xxxxxxxxxxx>
- Date: Sun, 14 Oct 2007 15:38:13 -0400
Hans-Peter Diettrich 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 state of Maine (USA), they claim every one is related! :)
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
--
"I'm never wrong, once i thought i was, but was mistaken"
Real Programmers Do things like this.
http://webpages.charter.net/jamie_5
.
- 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: Component for reading DNG files
- Next by Date: Printer Queue
- Previous by thread: Re: D5 - Class\Collection example??
- Next by thread: Re: D5 - Class\Collection example??
- Index(es):
Relevant Pages
|