wickedcoolthoughts
Thursday, January 17, 2008
  Classification of objects
Think no software for this post!

1. I have a collection of objects of different classes, some rectangles, some circles, some hexagons and few points. All of the above objects can be drawn and draw is the core/distinguishing behaviour of all the objects above. How can I classify the above objects/classes further? Is it possible to come up with a single common class that can represent all the objects? If so, is that class good enough to convey a concept without ambiquity?


2. I have another collection of objects lets say some humans, some robots and some cars. Lets say all the humans party on the weekends ;-), the robots assemble cars and the cars can be driven. Assume that these are core behaviour of the respective classes. Given the requirements above can I classify the objects further? With the above mentioned core/distinguishing behaviours of the objects further meaningful classification is not possible.


3. Now let us say there is a radar which needs to track all moving objects.

From problem 2 (above) the humans, robots and cars are all objects which can move and we were not interested in the move behaviour until the tracking requirement was introduced. Now we can say humans, robots and cars has ability to move and we are interested in this behaviour.

The objects which were otherwise unrelated is now related because of the new behaviour move. And move here is not the distinguishing behaviour of any of the objects/classes.


OK, now we can group objects/classes based on their distinguishing behaviours or some other common behaviour. When objects/classes are classified based on their distinguishing behaviour the resulting class is widely accepted and is applicable whereever the objects are used.

Eg: Rectangle is a kind of Shape and holds good always.

However in the grouping based on a non-distinguishing behaviour the resulting group does not define a class will not be applicable always.

Eg: Robot is a kind of Movable (even if we say so) was not applicable till the tracking requirement was introduced.

So what is the distinguishing behaviour of the objects? Its up to YOU to decide as needed by the domain.

The design of the above in a programming languge is a personal preference and I prefer to maintain the conceptual integrity in the design. Some considerations are covered in the post Abstract Class vs Interface.

 
Comments: Post a Comment

Subscribe to Post Comments [Atom]





<< Home

My Photo
Name:
Location: India

I am passionate about making Better Software Solutions,that helps businesses to stay agile, by applying Agile,Lean and Systems Thinking principles. Also I grow coffee,spices and in general has big interest in pesticide free food!

Archives
December 2007 / January 2008 / February 2008 / March 2008 / June 2011 /


Powered by Blogger

Subscribe to
Posts [Atom]