Sunday, January 16, 2005

NTrans ramblings

So I'm writing this O/R Mapper called NTrans. (The letter N seems very "in" and I couldn't think of anything). It's hosted at http://projectdistributor.com under the Eronel group. It's a prototype right now, but I hope to build it into something useful rather quickly (hopefully the basics will all be there by the end of this month).

Curious? Ok, go check it out. I'll wait.

You didn't did you? Ok, well none of this is going to mean much to you probably then. :)

I'm having a problem with the ObjectScope and Context classes. I'm not even sure they should be seperate classes really, but I like how the Context factory works. I think basically I need to move more of the IDbCommand stuff into the Context I suppose.

I also need to add more granular tracking of objects I think. Specifically wether individual properties are Clean, Dirty, or Unloaded. Once I have that, Lazy Loading should be a snap. Right now it's not because I can't differentiate between nulls that are just not loaded, or nulls that are really null.

I also need to create a FillProperty(object obj, string propertyName) method for lazy loading. I think it should be internal since lazy loading is the only situation it should be used, and that should be transparent.

I really need to get around to creating some UnitTests. I've created a Test Project full of stubs, but haven't filled it in with anything usefull. I wish I could say it's because I write perfect code, but the truth is I just haven't gotten motivated about it. :)

So what now? Well, I have a hunch the property state I mentioned above for lazy loading will fit into a QueryAPI somehow. Plus it'll help me update just the EmbeddedValue properties that are actually dirty.

Actually, can you modify Attributes at runtime? I mean, if I added a LazyLoadedAttribute to the project, could I expose an IsLoaded property, and after loading the property, the LazyLoader would set the IsLoaded property to true so the property wouldn't be loaded multiple times. Definitely something to test. Actually, if I can do this, then there probably isn't even a need for the PersistentObject class. I could just expose internal properties of the PersistentAttribute instead.

Comments: Post a Comment

<< Home

This page is powered by Blogger. Isn't yours?