Folks,
I have a question on what should be the approach while designing a base class.
My idea of a base class (until few days back) was to have as much code packed in it
and then have minimal changes in the derived class. This way, the coding work in
derived classes is less. But looking at some of the books on writing reusable code,
I think this is not the correct method.
Can someone give direction or point to article that discusses this?
Regards,
|
Mentor
|
![]() |
| 22Aug2010,04:26 | #2 |
|
Any code that's common to all classes would be best placed in the base class.
Any code that's specific to a derived class would be best placed in that derived class. No derived class code should be present in the base class, and similarly no base class code should be present in the derived classes.
sharanbr
like this
|
|
Newbie Member
|
|
| 22Aug2010,17:43 | #3 |
|
Quote:
Originally Posted by xpi0t0s |


