This is a fairly simple architecture question, just can't seem to wrap
my head around the answer.
I am using NHibernate 1.2 from the trunk to leverage generics support.
I have a User Table that has 4 different types of users:
Patron
Promoter
Admin
I am using generics in a Reospitory class to wrap NHibernate logic
within a Repository assembly. Upon login, I need to load the relevant
object depending on the usertype which is an integer column within
SQL, i.e. (Patron = UserType 2, Promoter = UserType 3, etc..)
I am having a hard time picturing how this would fit into my
repository at the time of selecting the entity from the backend and
then returning to my domain layer.
I am thinking maybe creating an abstract UserRepository class, that
would be where my factory code would be located and defer
instantiation to concrete PatronRepository, PromoterRepository etc..
classes.
Any help/guidance would be greatly appreciated! Thank you!
|