Re: Separation of concerns



It means to keep variables, functions, objects, abstractions as focused
as possible.

And how do you trade off with cohesion?

The best pattern depends on the context. How different are A and B's
draw method? How alike are they? Chances are you should have a separate
class that serves as a drawing helper.

The core drawing methods are extremely different. But I agree there
is an initialization part that is done in another class (View), that's
what I need the interface for. I have one class (View) that implements
a method onDraw() that draws all drawable Elements passing the "right"
parameters.

The question on hand is, shall the drawable interface be implement in
the class containing the business logic (means A and B) or rather in
an composed object (A_drawable and B_drawable) that just implement the
drawable interface and inherit the business logic.

Regards,
Thomas Kowalski

.