[Opensim-dev] Object Representation
Impalah
impalah at gmail.com
Fri Feb 8 14:41:54 UTC 2008
If NHibernate works as I Expect this task will be very easy...
I have some ideas, maybe not brilliant, but... well here they are:
- Objects (items in general) will have their own table with common
properties (id, name, description, permissions...).
- The objects could be a primitive, a texture, clothes, scripts... anything.
- To specialize objects we could use "inheritance" or interface
implementations. I.e. an object of type "primitive" hasn't got the same
properties as a "texture". And we don't need all the properties of an item
all the time. We can save the "extra" properties into another table and
NHibernate (or any other ORM) will query when needed (lazy load).
- These objects will implement one or several "serialize" methods (simple
toString, but toXML and toJSON too, i.e.). The inverse operation is simple
to create as well, from a XML to this object. The object will be persisted
too in DB just calling their own "save" method.
- Relationships between objects (links, attached scripts or textures....)
will have their own normalized table.
The rest of the entities we need (inventory trees, users, regions, etc.)
could be designed this way.
My idea is to convert every object in a DAO (that's what I'm doing now with
my personal hibernate integration). Every entity will know how to persist by
itself in the database, the programmer only will have to say "inherit from
this and that". Maybe it's more a "Java way of working", but this part of
opensim seems more an ERP than a "virtual world server".
More info about persistence (a very interesting article):
http://www.theserverside.net/tt/articles/showarticle.tss?id=NHibernate
Greetingzzz
2008/2/8, Sean Dague <sean at dague.net>:
>
> Per request, lets run with the thread here. The question at hand is
> database refactoring, which well all agree needs to be done. The reason
> it hasn't been done so far is because it turns out we end up with
> objects at least 4 different formats, needed for different things.
>
> Object on the Wire - this definition comes from libsecondlife
> Object in the code - SceneObjectPart / SceneObjectGroup
> Object at rest - Database tables (which actually vary between db
> backends)
> Object in XML - we have 2? versions of this already.
>
> One of the challenges in getting to a grand unified scheme is that
> all those representations are in some ways equal. Today they are
> divergent enough that a lot of work is required at times to chunk them
> into one form or another.
>
> So, here is your chance to be a hero in the OpenSim world. :) Ideas on
> how to reasonably pull all this together to give us a much more
> consistent serialization approach are very welcomed. Please pile on.
>
> I think that solving this is probably our next big battle. I'm excited
> to see the NHibernate work getting very close, as I think that's a huge
> step forward in this regard. This probably also means we need to bring
> up the SOP/SOG discussion that Stephan wanted to kick off as well.
>
> -Sean
>
> --
> __________________________________________________________________
>
> Sean Dague Mid-Hudson Valley
> sean at dague dot net Linux Users Group
> http://dague.net http://mhvlug.org
>
> There is no silver bullet. Plus, werewolves make better neighbors
> than zombies, and they tend to keep the vampire population down.
> __________________________________________________________________
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.6 (GNU/Linux)
>
> iD8DBQFHrFL9SamXem9TdyYRAhYvAJ983zYKkJJ0+O/5zjzF68RbofK++ACfUREs
> hk+lUjrOELFhBXQcdAvaO5s=
> =FQYC
> -----END PGP SIGNATURE-----
>
> _______________________________________________
> Opensim-dev mailing list
> Opensim-dev at lists.berlios.de
> https://lists.berlios.de/mailman/listinfo/opensim-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://opensimulator.org/pipermail/opensim-dev/attachments/20080208/98c54d07/attachment-0001.html>
More information about the Opensim-dev
mailing list