I am developing a Java application that will be used by contractors to host diagrams. I am currently in the modeling phase and am creating a UML class diagram. My problem is that I'm not sure if this is the perfect way to model some of my objects. Users will โdrawโ home elements such as walls, lights, doors, windows, etc. Each element has an initial set of required properties. Based on this initial set of required properties, an additional set of different properties will be required for this element.
As an example, I will use my Structure class. One of the things that a user will draw on a chart is structure. The structure of two basic properties is the type of structure and composition. The composition is simple. The client provides a list of possible compositions that the user will select, so I put this data in the combo box and allow me to choose from the drop-down list. However, based on structType, additional properties will be required.
IE) if StructureType = Wall, then length and height. If StructureType = Ceiling, then length, width and height are required.
The example is simplified and may seem trivial, but sub-properties can be much more active than this, and there are many of them. Some of them give rise to additional sub-properties. However, in spite of a more simplified one, this gives a rather concrete idea of โโthe problem that I am trying to solve.
My thinking is that I should have subclasses extending Structure, each of which has a set of properties that are unique to each subclass. IE) The Wall class extends the Structure class and contains a group of member variables unique to Walls.
Some advice on what I think about this, I would appreciate it, and if I leave the base, then a push in the right direction will be appreciated. Similarly, if there are considerations that I missed when making decisions, constructive criticism can be welcomed.