Hi,
I'm new to magma and I've read the docs in the swiki and browsed the magma tests to get a basic understanding how to work with it. In the FAQs I found an answer: "With the standard dependency mechanism, dependents are not directly connected, so they will not be persisted". What does this mean? Lets say I have some classes:
Building Floor Room
A Buidling has floors and floors have rooms. As far as I understand - if I save a building instance in magma, the assoicated floors and there rooms will also be saved. So I can get a building instance from magma and ask it for its children. But how do I look for a specific room in magma without traversing the whole tree structure starting at the building node. In a RDBMS I would query for the room - get the foreign key of the floor and so on.
Or should I put all tree nodes (building, floor and room instances) in there own MagmaCollection to use them with a MagmaCollectionReader? What would be the best way to save such a tree like structure with the ability to query for one of the nodes and to get after that the parents of that node? The goal is not only to traverse the tree from top but also to answer questions like "What room has the user carsten and in which building can I find this room?".
Thanks, Carsten
_______________________________________________________________________ Jetzt neu! Schützen Sie Ihren PC mit McAfee und WEB.DE. 3 Monate kostenlos testen. http://www.pc-sicherheit.web.de/startseite/?mc=022220
Hi Carsten,
try to evade using rational model if the ODB gives you the power to prioritize the conceptual model. This in your example will be storig the big root composed object just the way you designed it conceptually and prototyped it in the image.
The MagmaCollections will be needed when you have to manage lots of objects. In your example if the building has 200 floors you may or may not justify a magma collection for that. If I need to query I'll tend to index them in a magma collection regardeless they are 100 or 100 thousand.
If instead of your example you have car part's you will easily need to query among 50 thousand instances. For sure they should be stored indexed in a magma collection.
As far as I know nothing stops you to have in other part of the odb the cars that also refers (have in its instVars) lots of those parts. That way you won both: the easiness of having all the parts indexed in a magma collection (usually the only efficient approach in the relational world) and the conceptual model of it's position in the "car space".
I hope this helps,
cheers,
Sebastian Sastre
-----Mensaje original----- De: magma-bounces@lists.squeakfoundation.org [mailto:magma-bounces@lists.squeakfoundation.org] En nombre de Carsten Karkola Enviado el: Jueves, 22 de Noviembre de 2007 18:03 Para: magma@lists.squeakfoundation.org Asunto: Save and query dependent objects
Hi,
I'm new to magma and I've read the docs in the swiki and browsed the magma tests to get a basic understanding how to work with it. In the FAQs I found an answer: "With the standard dependency mechanism, dependents are not directly connected, so they will not be persisted". What does this mean? Lets say I have some classes:
Building Floor Room
A Buidling has floors and floors have rooms. As far as I understand - if I save a building instance in magma, the assoicated floors and there rooms will also be saved. So I can get a building instance from magma and ask it for its children. But how do I look for a specific room in magma without traversing the whole tree structure starting at the building node. In a RDBMS I would query for the room - get the foreign key of the floor and so on.
Or should I put all tree nodes (building, floor and room instances) in there own MagmaCollection to use them with a MagmaCollectionReader? What would be the best way to save such a tree like structure with the ability to query for one of the nodes and to get after that the parents of that node? The goal is not only to traverse the tree from top but also to answer questions like "What room has the user carsten and in which building can I find this room?".
Thanks, Carsten
Jetzt neu! Schützen Sie Ihren PC mit McAfee und WEB.DE. 3 Monate kostenlos testen. http://www.pc-sicherheit.web.de/startseite/?mc=022220
Magma mailing list Magma@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/magma
magma@lists.squeakfoundation.org