Sunday, July 20, 2008

Dynamic (Class) Mapping in NHibernate

This is my first blog post and it might also be my last knowing myself :) This blog is mainly supposed to be a memory dump for myself so that I can go back and see what I have done and what my findings have been.

Basically I've been working on an application framework for work with an embedded ORM, I've decided to assess if this can be replaced with NHibernate and I've found some things that needs to be addressed like:
  • Dynamic Mapping - (Map from database to Hashtables / Maps instead of to concrete classes as "users" can customize the domain model themselves).
  • Run-time Reconfiguration - (Modifying the mapping should be able to be done run-time without taking down the system, this might be possible with current NHibernate as I haven't researched it properly yet)
  • Linq for NHibernate - (I'm pretty sure that Linq for NHibernate needs to be modified to support querying and returning dynamicly mapped entities (Hashtables instead of concrete classes).
To be honest it seems that most of the job for Dynamic Mapping has already been done by the NH (NHibernate) team and that what is left is to enable it through configuration and of course test it so it works properly. I will get in contact with the current project lead to see how I can assist.

I will type in the blog about what I find while browsing through the NHibernate code, what questions that pops up, what assumptions I get and if I get any revelations while working with the code :-)

Approach will be top-down and tests first as I'm unfamiliar with the code this enables me in the easiest way to find where things blow up. I'll porting tests from Hibernate SVN trunk.