Re: Separation of concerns



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



.



Relevant Pages

  • Re: Is there MVC patter in web-applications
    ... > separation of model and view is a bit trivial, ... responding to users request (again by calling M and filling V). ...
    (comp.object)
  • Re: Wilson Bridge Bike Path Gets Rolling
    ... Since it's already built, it's a little too late for that:-) I was ... just responding to a logistical question on whether a bike/ped ... separation could be accomplished and the impacts of doing so. ...
    (misc.transport.road)
  • Re: Separation of concerns
    ... symptomatic of an abuse of OO generalization that is related to ... separation of concerns. ... One composes objects by providing ... disparate responsibilities through inheritance (often multiple ...
    (comp.object)