Florian Minjat a écrit :
Hi again Chris,
Chris Muller wrote:
Hi Florian, recall from http://wiki.squeak.org/squeak/2638:
"The minimumDepth is how far it reads for any object, all objects, every time, all the time."
My understanding of this is that if I ask Magma for a Player object with a minDepth of 3, it will follow references and reify objects on a depth of 3.
"As a programmer, you can change this default 0, 1, 2 or 3 (or maybe even 4, but I wouldn't go beyond that) by supplying a ReadStrategy."
My problem is that my application is a game. And every 12h it need to go through the whole hierarchy of the whole players to update them. If I let the minDepth to 1, the read, update and commit of one player takes something like 15min due to the heavy number of requests to magma (lot of very small objects). So I want to reify the whole object hierarchy of my Player before updating it. Therefore I use a minDepth of 10 (the max depth is : Player->(1)Dungeon->(*)MonsterRoom->(*)Adventurer->(1)Treasure->(*)SmallInteger).
I got such a kind of problem (well I envision I will have it). One solution I found was to redesign my objects to get a more flat structure where it is easy to do where: request to retrieve the exact object I need. Try to get more top level Magma collection in your design.
Not sure it can apply to your problem...
Hilaire