Re: Long Life Objects
- From: timeisfire8@xxxxxxxxxxx
- Date: 30 Mar 2007 02:22:00 -0700
Thanks for your continued detailed posts Lahman. The time and effort
is appreciated.
But even if the flavors of Address are more dynamically flexible you
could still do:
[Shipper] [Invoicer]
| 1 |
| |
| R1 | R2
| |
+----- [Customer] -----+
ships to 1 | 1 * bills for
|
| R3
|
| has
| *
[Address]
+ addressType
The Shipper and Invoicer now need to search the R3 set of addresses to
get the right type, but that set will be a whole lot smaller than the
total set of addresses one would need to search to find the right
customer in an AddressType dictionary. IOW, the R3 collection just
optimizes the search scope to the smaller set of individual customer
addresses rather than the larger scope of all addresses of a given type.
As an added bonus, every object is clearly a problem space entity while
the details of collections are abstracted as simple associations that
reflect existing relationships in the problem space. In contrast, in
your solution each Dictionary is a first class object in the OOA/D even
though it doesn't directly represent an entity in the problem space.
[Try talking to the warehouse foreman about AddressType entities. B-)]
Yes, your warehouse foreman statement is a great example of why these
'xxxType' objects do not feel right in my design. I use them when I
need to package data that does not seem to belong in its containing
class. So AddressType might also have a bool attribute 'isDefault'
that can be used, for example, in the GUI to prepare controls. Thus if
an admin user set 'Delivery' to be the default AddressType, any
delivery address created for any customer from that point on would be
their default. Would you suggest that 'isDefault' and any other
similar attributes are redesigned to be attributes of Address and do
away with [AddressType] completely?
.
- Follow-Ups:
- Re: Long Life Objects
- From: H. S. Lahman
- Re: Long Life Objects
- References:
- Long Life Objects
- From: timeisfire8
- Re: Long Life Objects
- From: H. S. Lahman
- Re: Long Life Objects
- From: timeisfire8
- Re: Long Life Objects
- From: H. S. Lahman
- Re: Long Life Objects
- From: timeisfire8
- Re: Long Life Objects
- From: H. S. Lahman
- Long Life Objects
- Prev by Date: Re: Is Procedural Paradigm a basis of OO Paradigm?
- Next by Date: Re: Long Life Objects
- Previous by thread: Re: Long Life Objects
- Next by thread: Re: Long Life Objects
- Index(es):
Relevant Pages
|