Question about designing a abstract class
Hi guys, this is a question about design pattern.
I wanna ask if I have a I have base class A, and derived class B, C, D.
And class A is a abstract class, but all of the instance of B , C, D have a same data member.
I want to ask should I declare a data member in all these three derived class or is it normal to declare it in the base class A? Also if I have some methods for B C D all doing the same thing,
In this case, I would like to implement this common methods in the abstract base class. But
my friend argue me about we should use abstract class without any implementation or any data member in base class (like interface in JAVA?) So he suggests me to change my codes in base class to be pure virtual functions. And implement all the same common methods in each subclasses and declare the same data member in sub class. I don't know what's the merit of doing this...
Looking for any suggestion, thx.