I've just started with NHibernate and I've searched the forum and went over the documentation. There are articles about usage of multiple databases, but I'm still not clear about something - it is possible to achieve something like that:
Three data models (describing it with namespaces) and only one database:
-Company.CoreApplication.Model
-Company.ExtensionApplication1.Model
-Company.ExtensionApplication2.Model
-CoreApplication is a standalone application which doesn't know anything about ExtensionApplication, it only knows about CoreApplication.Model in it's own assembly.
-On the other hand ExtensionApplication1 knows about (and uses) both CoreApplication.Model and ExtensionApplication1.Model, it somehow inherits from it.
-ExtensionApplication2 knows about (and uses) both CoreApplication.Model and ExtensionApplication2.Model.
-ExtensionApplication1.Model and ExtensionApplication2.Model are not referenced in any way, they only include CoreApplication.Model
All models use the same database, all tables for CoreApplication.Model are selfsufficient, but in tables for ExtensionApplication1.Model and ExtensionApplication2.Model,, there are some foreign keys referencing to CoreApplication.Model's tables.
Application modules then use the data model for their own application.
|