Use composition instead of inheritance.

http://www.cs.sjsu.edu/faculty/pearce/modules/patterns/analysis/Actor.htm

On Fri, Feb 20, 2009 at 3:59 PM, deuce <[email protected]> wrote:

>
> I have the following simple class structure, simplified for post:
>
> class Person
> {
>    public int ID;
>  }
>
> class Student : Person
> {
>   public Student(Person person){}
> }
>
> The problem I am facing is when I pass in the person and assign all
> the values to this object including the ID, it wants to update when I
> call SaveOrUpdate.  I need to save the student WITHOUT modifying the
> ID of the person.  So since the person class has already been
> persisted, I just need the INSERT for the subclass.
>
> On the other end of this, how would I go about removing the Student
> subclass BUT leaving the person?
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to