What is the better design decision approach?
Posted
by
palm snow
on Programmers
See other posts from Programmers
or by palm snow
Published on 2011-11-22T16:19:55Z
Indexed on
2011/11/23
10:09 UTC
Read the original article
Hit count: 173
I have two classes (MyFoo1
and MyFoo2
) that share some common functionality. So far it does not seem like I need any polymorphic inheritence but at this point I am considering the following options:
- Have the common functionality in a utility class. Both of these classes call these methods from that utility class.
- Have an abstract class and implement common methods in that abstract class. Then derive
MyFoo1
andMyFoo2
from that abstract class.
Any suggestion on what would be a better design decision?
© Programmers or respective owner