[Zope-dev] Implementing [XOR A] 1 object connections in ZPatterns
Steve Spicklemire
steve@spvi.com
Tue, 5 Dec 2000 08:17:06 -0500 (EST)
Hi Itai,
>>>>> "Itai" == Itai Tavor <itai@optusnet.com.au> writes:
...
Itai> The 2nd way seems to go better with OO principles - all
Itai> handling of photos is delegated to the Photos Specialist and
Itai> the Product doesn't care if the photo exists or not, or
Itai> where it comes from. But it also increases complexity in
Itai> Photos, because I need to implement an efficient way to
Itai> retrieve photos (with a Catalog, or SQL searches), and
Itai> because it introduces the photo_key. Storing photo_id in
Itai> Product eliminates these complexities, but it moves some of
Itai> the responsibility for managing photos into Product.
Hmmm.. it seems to me that it makes more sense for the Product
to know the id of the Photo that *it* needs to display itself than
for the Photo to have to know that it belongs to a particular
Product. Also.. I can imagine that the Photo class might be useful
for lots of other things besides Products, and how would you teach
it what type of object it belongs to?
Just my $0.02.
;-)
-steve