I am building code for a 2D scene graph and i have a single abstract class, Node that will be used to indicate that a type of item can be used in a scene graph. However, classes that implement from this are of different types such as leaf nodes and transformation nodes. How would i indicate these differences? would i use attributes, other interfaces, or what?
Edit: It would appear that i have given insufficient information. Here is as much information as i can provide on my current hierarchy:
Its difficult to advise you as you have not given us too much information about your problem domain. Also you're mixing your terminology a little so I'm unclear if you see the leaf and transformation nodes as interfaces, abstract classes or classes.
I guess in terms of design you need to ask yourself what differentiates a leaf node from a transformation node. If it is just purely the properties of the node then perhaps using attributes may be the most elegant solution, but if they have different behaviours then it would point me towards separate classes.
Based on the names, we may be able to suppose the transformation node is "transformable" and so has a "Transform" method but a leaf not is not transformable. I'd suggest then that its better for the leaf node not to have a transform method and be in a different class.