<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body class='hmmessage'>This should play well with the notion of having a 'model' assembly that has been discussed at a couple of occasions, and that I believe both me and MW are vehement proponents of;<BR>
<BR>
This 'model' assembly (say, 'OpenSim.Model' ) would consist of base classes looking very much like Seans nhibernate-friendly classes, with no real methods associated to them, just data.<BR>
<BR>
These classes would then be specialized into different context (like nhibernate, apps, other db, xml, http requests, remoting) but the contexts would still be signature-compatible with each other. <BR>
<BR>
(For example, if we had a OpenSim.Region.Environment.SceneObjectGroup it could be xmlserializabled and then deserialized into a OpenSim.Web.RemotePrimStorage.SceneObjectGroup)<BR>
<BR>
An 'ScenePresence' would probably have three or four subclasses, each tailored for a different context. (One on the regionserver and one on the grid server)<BR>
<BR>
A very important factor is that this assembly would be considered a root assembly, referenced probably by all other assemblies, but referencing nothing itself.<BR>
<BR>
(I actually think that this means we would not allow libsl types in the model, but in subsequent specializations)<BR>
<BR>
Now, the BIG win would actually not be intra-OpenSim but extra-OpenSim: It would let us create applications, tools and services outside of the core OpenSim set that could re-use the model as a foundation for an 'Service API' of sorts.<BR>
<BR>
I think the best strategy is just to agree that this is something we want, then establish the assembly, and then start moving type by type into it.<BR>
<BR>
Best,<BR>
/Stefan<BR><BR><BR><BR><BR>
<BLOCKQUOTE>
<HR id=EC_stopSpelling>
Date: Thu, 3 Apr 2008 16:17:03 +0100<BR>From: michaelwri22@yahoo.co.uk<BR>To: opensim-dev@lists.berlios.de<BR>Subject: Re: [Opensim-dev] nhibernate progress, baby steps<BR><BR>ahh okay that sounds fine. I just wasn't sure if you were talking about having the nhibernate code (for storing via nhibernate) directly in the core classes. As I believe was talked about some time ago. But yeah making classes use Properties rather than Public variables is something we should be doing anyway.<BR><BR><B><I>Sean Dague <sean@dague.net></I></B> wrote:
<BLOCKQUOTE class=EC_replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px">On Thu, Apr 03, 2008 at 03:05:31PM +0100, Michael Wright wrote:<BR>> I'm not quite clear on how you plan to integrate this into<BR>> opensim. Will it be via interfaces like current db systems are. So a<BR>> call is made on the interface asking the db system to store that<BR>> object. Or are you planning on having these nhibernate objects<BR>> directly in the core.<BR>> <BR>> I'm really unsure of that, if that is the plan, as it ties the core to<BR>> nhibernate without any chance of implementing a non nhibernate based<BR>> storage system. I think we should have interfaces like currently ,but<BR>> of course improved and more standardised. That would have a call like<BR>> StorageAsset(AssetBase asset). But we can't rely on AssetBase asset<BR>> being of type NHibernateAssetData. As that again would be restricting<BR>> us to nhibernate.<BR><BR>It goes into the standard OpenSim.Data.* model that happens today. No<BR>changes to the data layer there at this point.<BR><BR>> Maybe AssetBase isn't the best example of what I'm thinking. But if<BR>> we had NhibernateSceneObjectGroup. We couldn't expect all<BR>> SceneObjectGroup objects in the core to be of that sub type. As what<BR>> if a Module add some sceneobjects and just used the base type.<BR><BR>As an example, this is what a NHibernate friendly AssetBase looks like.<BR>Notice, there is really nothing NHibernate specific about this. Code<BR>wise it is binary compatible (just attributes replaced by properties).<BR>Someone that knows how serialization works could tell me whether or not<BR>the serialization will be the same. I added one convenience property so<BR>that we can get/set UUID as a string. SceneObjectGroup/Part already<BR>looks much more like this, and I think probably won't need any changes.<BR><BR>using System;<BR>using libsecondlife;<BR><BR>namespace OpenSim.Framework<BR>{<BR>[Serializable]<BR>public class AssetBase<BR>{<BR>private byte[] _data;<BR>private LLUUID _fullid;<BR>private sbyte _type;<BR>private sbyte _invtype;<BR>private string _name = String.Empty;<BR>private string _description = String.Empty;<BR>private bool _local = false;<BR>private bool _temporary = false;<BR><BR>public AssetBase()<BR>{<BR>}<BR><BR>public AssetBase(LLUUID assetId, string name)<BR>{<BR>FullID = assetId;<BR>Name = name;<BR>}<BR><BR>public virtual LLUUID FullID {<BR>get { return _fullid; }<BR>set { _fullid = value; }<BR>}<BR><BR>public virtual string ID {<BR>get { return _fullid.ToString(); }<BR>set { _fullid = new LLUUID(value); }<BR>}<BR><BR>public virtual byte[] Data {<BR>get { return _data; }<BR>set { _data = value; }<BR>}<BR><BR>public virtual sbyte Type {<BR>get { return _type; }<BR>set { _type = value; }<BR>}<BR><BR>public virtual sbyte InvType {<BR>get { return _invtype; }<BR>set { _invtype = value; }<BR>}<BR><BR>public virtual string Name {<BR>get { return _name; }<BR>set { _name = value; }<BR>}<BR><BR>public virtual string Description {<BR>get { return _description; }<BR>set { _description = value; }<BR>}<BR><BR>public virtual bool Local {<BR>get { return _local; }<BR>set { _local = value; }<BR>}<BR><BR>public virtual bool Temporary {<BR>get { return _temporary; }<BR>set { _temporary = value; }<BR>}<BR>}<BR>}<BR><BR>-Sean<BR><BR>-- <BR>__________________________________________________________________<BR><BR>Sean Dague Mid-Hudson Valley<BR>sean at dague dot net Linux Users Group<BR>http://dague.net http://mhvlug.org<BR><BR>There is no silver bullet. Plus, werewolves make better neighbors<BR>than zombies, and they tend to keep the vampire population down.<BR>__________________________________________________________________<BR>_______________________________________________<BR>Opensim-dev mailing list<BR>Opensim-dev@lists.berlios.de<BR>https://lists.berlios.de/mailman/listinfo/opensim-dev<BR></BLOCKQUOTE><BR>
<HR SIZE=1>
Sent from <A href="http://us.rd.yahoo.com/mailuk/taglines/isp/control/*http://us.rd.yahoo.com/evt=52418/*http://uk.docs.yahoo.com/nowyoucan.html" target=_blank>Yahoo! Mail</A>. <BR>A Smarter Inbox.</BLOCKQUOTE></body>
</html>