J
johan Goris
ObjectR is an ObjectA
ObjectS is an ObjectA
....
public ObjectA Copy(ObjectA oa)
{
return ..... // new ObjectR when oa is an ObjectR ..
// new ObjectS when oa is an ObjectS....
}
The code should be in such way that the method will work even when new
classes (derived from class ObjectA) is made. And without altering the code
in Method Copy from ObjectA.
ObjectS is an ObjectA
....
public ObjectA Copy(ObjectA oa)
{
return ..... // new ObjectR when oa is an ObjectR ..
// new ObjectS when oa is an ObjectS....
}
The code should be in such way that the method will work even when new
classes (derived from class ObjectA) is made. And without altering the code
in Method Copy from ObjectA.