Walter Meester
HoogkarspelNetherlands
Hi Jim
>Actually, late composition (which is the better design approach) says that you don't subclass any containers that have anything in them. You create a class hierarchy for the container and you create classes for the contained objects. Finally you assemble the container with objects and then use that. You amy have many different assembled containers with different objects in them. You never subclass a container that has anything in it.
Hmmm, this sounds very strange to me. Can you explain a bit more about this 'late composition' ? What is the reasoning behind this concept ?
Does this apply to all containers like forms, toolbars, controls, containers etc ? Are you saying that I should not make a class of a container containing objects or that I should not subclass a container ?
Let's say i've developed a moverbar class which consists out of two lists, four buttons and two labels. How do I define this movebars class without putting it in a container ? Let's say that this is an abstract class, and I subclass this one for moverbars with different layouts and behaviour ? How would I do that ?
Another example: If for my resizeable baseform, I want derived form to have grip in the lower right corner, I add a grip control. Why shouldn't I subclass the baseform now it contains a control ?
If in a project a certain conbination of textboxes and labels occurs at various points, Why shouldn't I create a class of this combination and why should I not use this class for subclassing ?
Walter,
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only