Hi all,
This is more of a design question than related to a specific NHibernate version.
I am implementing NHibernate in an enteprise app at my company.
All our domain objects inherit from a base class BrandShareObject which has properties Id, CreatedBy, CreatedOn etc.
The only reason they inherit is so I dont have to explicitly define these common properties on all objects.
This is an example of objects in two hierachies (an ActivityFile and an User):
public class ActivityFile : BrandShareObject
public class BinaryActivityFile : ActivityFile
public class TextActivityFile : ActivityFile
public class User : BrandShareObject
Currently these are stored in four tables:
ActivityFile, BinaryActivityFile, TextActivityFile and User.
The ActivityFile and the User tables contains the Id, CreatedBy, CreatedOn etc columns.
Hence the BrandShareObject is not known to the database.
How can I accomplish this with NHibernate? Obvisously I dont want a shared BrandShareObject table because then both Users and ActivityFiles will share the same identity number range.
OR is this bad design? Should I get rid of the BrandShareObject because it doesnt really belong in my domain model?
Hope to get some replies :)
/Niels
|