design patterns - Advice on designing loosely-coupled complete systems? -
how 1 design loosely-coupled systems may require data each-other don't belong in same category?
for instance, lets take old pet-shop example one-step further , create pet-store franchise. each pet-store has own website listing contact information, promotions, , current stock.
the franchise owners want have listing of franchised pet-stores along contact information , possibly few photos available on corporate site. want able update information, , have updates pushed automatically both-ways. want provide promotions information stores' sites in automated way.
so, in instance stock lists "owned" stores, , contact information part-"owned" both entities, , promotion information "owned" hq. due arbitrary reasons data can't stored in same place.
are there best-practices or common strategies coping situation this?
i've been thinking problem, , express saying relationships between classes contextually determined. , model assumes global static associations (inherent coupling) between classes problematic.
another example use products.
a product can play bunch of different roles. it's associated orderitem, associated order, associated customer.
it's provided vendor.
it's in catalogue, maybe section , page.
it's responsibility of buyer, availability multiple vendors.
the ability handle complexity fundamental benefit of relational data model; , i've not seen dealt in terms of oop.
aside: there's orm (object role modeling, see visiomodeler, infomodeler, etc.) looks @ question relational side, quite usefully (imho).
when isolate relationality of database (by using crud generators, activerecords, etc.) hiding important aspect. (i think linq has same problem, introducing fundamental coupling problems, haven't worked out yet.)
i think can work way through if you're careful, becomes easy embed coupling in design, if work database rest of application, rather other direction.
Comments
Post a Comment