|
-
February 19th, 2007, 12:25 PM
#1
case study
abstract class A
{
protected int m_nWidth;
public abstract void Compute();
...
}
class B : A
{
public override void Compute()
{
... using m_m ...
}
}
class C : A
{
public override void Compute()
{
... using m_m ...
}
}
Now I need to extend class A's behavier but still need A's data structure, also needs B and C's different implementation without rewrite B and C's code.
what's the best design for the new class(s)?
Last edited by tangjun; February 19th, 2007 at 12:36 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|