orm.OneToOne<Person, Role1>(); orm.OneToOne<Person, Role2>(); orm.OneToOne<Person, Role3>(); orm.OneToOne<Person, Role4>(); ;-)
On Fri, Feb 18, 2011 at 10:04 AM, Paulo Quicoli <[email protected]>wrote: > Hi Fábio, > > 5 roles. So is better to do MyRole1->Person, MyRole2->Person and so on... > > thank you Fabio > > 2011/2/18 Fabio Maulo <[email protected]> > > How many roles have your real class in your real application ? >> If few you can use one-to-one (uni or bi directional). >> >> On Fri, Feb 18, 2011 at 8:28 AM, Paulo Quicoli <[email protected]>wrote: >> >>> Hi friends. >>> >>> I need some suggestions, ideas about a design. >>> My app. has a class Person, containing basic information. But, Person can >>> role in many ways. A Person can be a teacher, a student and etc. >>> Our idea is: There will be only one Person. so I think inheritance doesnt >>> fit in this case, but composition can work. Having a class Teacher wich >>> points to Person, a class Student wich point to Person, etc... >>> >>> Or maybe, a Person could have a collection of Roles, and so, Teacher and >>> Student inherited Role. >>> >>> What do you think? >>> >>> >>> >>> >>> >>> >>> -- >>> Paulo Quicoli >>> Editor Técnico: .NET Magazine, ClubeDelphi Magazine; Editor: WebMobile >>> Magazine >>> www.devmedia.com.br >>> www.nhibernatebrasil.net >>> http://pauloquicoli.spaces.live.com >>> twitter:@pauloquicoli >>> >>> -- >>> You received this message because you are subscribed to the Google Groups >>> "nhusers" group. >>> To post to this group, send email to [email protected]. >>> To unsubscribe from this group, send email to >>> [email protected]. >>> For more options, visit this group at >>> http://groups.google.com/group/nhusers?hl=en. >>> >> >> >> >> -- >> Fabio Maulo >> >> -- >> You received this message because you are subscribed to the Google Groups >> "nhusers" group. >> To post to this group, send email to [email protected]. >> To unsubscribe from this group, send email to >> [email protected]. >> For more options, visit this group at >> http://groups.google.com/group/nhusers?hl=en. >> > > > > -- > Paulo Quicoli > Editor Técnico: .NET Magazine, ClubeDelphi Magazine; Editor: WebMobile > Magazine > www.devmedia.com.br > www.nhibernatebrasil.net > http://pauloquicoli.spaces.live.com > twitter:@pauloquicoli > > -- > You received this message because you are subscribed to the Google Groups > "nhusers" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/nhusers?hl=en. > -- Fabio Maulo -- You received this message because you are subscribed to the Google Groups "nhusers" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/nhusers?hl=en.
