Re: Separation of concerns
- From: "H. S. Lahman" <h.lahman@xxxxxxxxxxx>
- Date: Wed, 28 Mar 2007 18:49:47 GMT
Responding to Kowalski...
Hi everyone,
I am currently quite confused about the separation of concerns things
and search here for enlightenment.
I have some classes. lets say A and B that shall implement a certain
interface (e.g. Drawable).
Now it would not be very nice if A and B would implement then directly
or?
Should I subclass like A_Draw and B_Draw or what is the current
pattern to solve this?
I'm afraid I'm not sure I understand what you are asking. It sounds like you are describing:
[Drawable]
A
|
+-----+-----+
| |
[A] [B]
where the [Drawable] is an abstract superclass that defines a common interface that both [A] and [B] must implement in some acceptable fashion.
That is a matter of generalization rather than separation of concerns.
However, the notion of -able (drawable, persistable, etc.) is often symptomatic of an abuse of OO generalization that is related to separation of concerns. This is a variation on the sort of composition one finds in functional programming. One composes objects by providing disparate responsibilities through inheritance (often multiple inheritance). The resulting object is a hybrid of logically unrelated groups of properties.
That sort of composition violates OO separation of concerns because the object is not cohesive (i.e., focused on a single set of logically related concerns). The acid test is looking for a corresponding entity in the customer problem space. One can generalize various flavors of Vehicle and a domain expert like a car dealer will have no difficulty with the notion of a Honda Accord. But try asking that same car dealer to test drive a Drawable Honda Accord.
*************
There is nothing wrong with me that could
not be cured by a capful of Drano.
H. S. Lahman
hsl@xxxxxxxxxxxxxxxxx
Pathfinder Solutions
http://www.pathfindermda.com
blog: http://pathfinderpeople.blogs.com/hslahman
"Model-Based Translation: The Next Step in Agile Development". Email
info@xxxxxxxxxxxxxxxxx for your copy.
Pathfinder is hiring: http://www.pathfindermda.com/about_us/careers_pos3.php.
(888)OOA-PATH
.
- Follow-Ups:
- Re: Separation of concerns
- From: Thomas Kowalski
- Re: Separation of concerns
- References:
- Separation of concerns
- From: Thomas Kowalski
- Separation of concerns
- Prev by Date: Re: Design pattern to sync objects
- Next by Date: Re: Separation of concerns
- Previous by thread: Re: Separation of concerns
- Next by thread: Re: Separation of concerns
- Index(es):
Relevant Pages
|