Legacy data, NHibernate and CSLA problems...

Legacy data, NHibernate and CSLA problems...

Old forum URL: forums.lhotka.net/forums/t/4111.aspx


AAKLebanon posted on Thursday, January 03, 2008

Hi.
I have a domain model that I want to reuse it for multiple databases.

the problem is that each database have a different schema, and maybe a different server (Ms sql, oracle, access...)

but all the databases are related to the same domain (accounting).

Now, I know that an ORM tool (specialy NHibernate) will eanble us to develop a domain model without any knowledge about the database. the mapping file is the only one who know about the database and the domain model also. So each time I want to work with another database, a different mapping file is required, but the domain model still unchanged.

So in theory, I should have no problem with my desgin choice (with NHibernate...), but in reality i have one problem (and maybe more, I don't know yet): how I can work with the different Id's in the legacy databases ? one database will work with Id's of type interger (auto generated), another onw will have a GUI Id's ...

I am obliged to define a new Id property in my domain model for each database type. how I can solve this problem ?

Copyright (c) Marimer LLC