Re: Separation of concerns
- From: "Thomas Kowalski" <th-ko@xxxxxx>
- Date: 29 Mar 2007 00:50:36 -0700
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
.
- Follow-Ups:
- Re: Separation of concerns
- From: Daniel T.
- Re: Separation of concerns
- References:
- Separation of concerns
- From: Thomas Kowalski
- Re: Separation of concerns
- From: Daniel T.
- Separation of concerns
- Prev by Date: Re: Separation of concerns
- Next by Date: Re: Double Dispatch Problem: Mobile Creatures and Projectiles in a Game World
- Previous by thread: Re: Separation of concerns
- Next by thread: Re: Separation of concerns
- Index(es):