Hello Geert,
Geert Bevin schrieb:
Hi Stefan,
thanks a lot for this overview.
No problem. My company is currently looking into running a project based
on RIFE, so hopefully I will be able to contribute to RIFE more in the
not-too-distant future. Maybe in the form of a sibling project or by
helping with the Eclipse integration or something like that. Oh, that
would be fun. ;)
Getters and setters are optional for Ammentos. So you don't need to
add them for the primary key for example or for the list in Machine.
You only define those accessors that you need in you application.
That leads to much nicer APIs on your entities.
This is something that I'm planning to add to RIFE's persistence,
you're not the first one that asked for it. Also, allowing static
constraints to be declared with annotations is planned too.
Awesome! I'm really looking forward to that.
Please note that I'm not the big expert in persistence, so I may be
totally wrong in every regard. But on the other hand, maybe this
provides some ideas to make persistence easier in RIFE. I did not
look at RIFE constraints in-depth yet, but from what I saw,
references to other objects are more complex than in this example.
One thing I'm wondering about is the loading of the object references.
Does Ammentos automatically load all the references to other objects?
Does it do so recursively?
Ammentos has this class:
public class EntityList<T> extends ArrayList<T> implements EntityCollection
This class has a method called "touch()" that is called whenever
something in the list is accessed. It checks whether the list (and all
objects in it) is already in memory. If it isn't, the method load() gets
called and loads all objects in the list.
So to answer your questions:
> Does Ammentos automatically load all the references to other objects?
Not on spec. Only if the data is actually accessed. (However, you can
configure that behaviour iirc)
> Does it do so recursively?
No.
(For the record: EntityCollection is an interface used by EntityList and
EntityMap that defines save() and delete() methods used internally by
Ammentos.)
By the way, a good introduction to Ammentos can be found at:
http://ammentos.biobytes.it/userguide/index.html - Just in case anyone
needs more info. It also explains Transactions, Inheritance etc.
Best Regards,
Stefan
_______________________________________________
Rife-users mailing list
Rife-users@uwyn.com
http://lists.uwyn.com/mailman/listinfo/rife-users