CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 1 of 1

Thread: case study

  1. #1
    Join Date
    May 2002
    Posts
    171

    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
  •  





Click Here to Expand Forum to Full Width

Featured