Board index » delphi » Data Object design for 1-N related data?

Data Object design for 1-N related data?

Hi,

sorry for my bad English, it's not my native spoken language.

I need to expone from my data object/s some data which are in 1-N
relationship (read from a relational database), i.e. an entity (a
product) and its description translated in N languages.
I wonder what is the best design approach in this case.
I suppose this is related to relational <-> OO mapping, but my knowledge
of design patterns and a-like is far from perfect (euphemism 8-).

I can see at least 2 approaches:

1) class A for the entity and class B for translations (A uses B)
This sounds better to me if B is splitted in B-collection, aggregation
of B-class (the single translation, only one language).

2) only 1 class for the entity handling translations too (how? Maybe
switched by a "lang" property?).

NOTE: implementation will be (sadly enough) in Visual Basic (God knows
how much I wish I could write that in Delphi!), but I think this will
not interfere with the design (I hope).

Any idea, documentation and reference will be greatly appreciated.

TIA
--
Roal Zanazzi
<roal.zana...@tiscalinet.it>

 

Re:Data Object design for 1-N related data?


Quote

> Any idea, documentation and reference will be greatly appreciated.

Hi,

you might want to check ..
http://www.objectarchitects.de/ObjectArchitects/orpatterns/MappingObj...
or a paper on this and more ..
http://www.objectarchitects.de/ObjectArchitects/papers/Published/Zipp...

Hope that helps

Cheers

Wolfgang

Other Threads