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="replbq" style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-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><p>
      <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.