Have you ever wondered why you should use interfaces instead of abstract
classes, or vice versa? More specifically, when dealing with generalization,
have you struggled with using one or the other? I'll shed some light on what
can be a very confusing issue.
To start, I'll identify two pieces of the development puzzle: the behavior of
an object and the object's implementation.
When designing an entity that can have more than one implementation, the goal
is to describe the entity's behavior in such a way that it can be used
without knowing exactly how the entity's behavior is implemented. In essence,
you're separating the behavior of an object from its implementation. But is
this separation best achieved by way of an interface or by way of an abstract
class? Both can defi... (more)