Hi Ramon, Thanks, quite explanatory.
You've put things down so clear that I beleive this explanation should takes part in the documentation! See you, Teoman "Ram�n Jim�nez" <rjimenez@@@cicla..com...do> wrote in message news:[EMAIL PROTECTED] > Teoman, > > Short answer - as usual - it depends :) > > Seriously though: > > - Ease of use: relationships. The bi-directional link is managed > automatically by Cach� (e.g. set a parent to a child and Cach� inserts the > child to the parent's children list). On the same note, Cach� enforces > referential integrity on relationships - delete the parent and all children > are gone, cannot create parentless child > > - Performance: should be about the same, there used to be a problem with > one to many relationship in v4 if you didn't create a certain index but v5 > offers to create it for you if you use the wizard to define the relationship > > Do keep in mind that parent-child is composition, i.e. one child can *only* > have a parent and if the parent is deleted everything else goes! On the > other hand one-to-many is more akin to aggregation. > > You can use lists or arrays (collections) when you don't have these > referential integrity requirements, especially if the contained elements > need not a reference to their container class. In this situation collections > are ideal. > > Use lists when you need to store elements without further association > information, i.e. a simple "bag" or "vector" of objects associated with a > container (for the record, a list is an ordered bag; duplicates are allowed > unless you explicitly check against them). If, on the other hand, you want a > "dictionary" data type, where each object in the collection is bound to the > container by a specific key, like a string or number, use an array. Arrays > can have non-numerical, non-sequential keys instead of the auto-incremented > sequence lists possess. Bear in mind, though, only primitive types may be > used as array keys; values can be primitives or objects. > > HTH, > > Ram�n > >
