nus-cs2103-AY2122S2 / forum

14 stars 1 forks source link

How do we compartmentalise out subcomponents in class diagram #265

Open benmurphyy opened 2 years ago

benmurphyy commented 2 years ago

Let say I have a component, for example UI, for which i am constructing the class diagram for. However, there are many classes, different kinds of UI pages etc, making the overall diagram very large and complicated. We learnt about using reference frames for sequence diagrams to simplify them and abstract out the inner workings of a section to elsewhere. However we have not learnt an equivalent to that for class diagrams (at least not that I can find in the notes).

Hence my question is how do we go about organising our class diagrams into sub-components, detailing the individual class diagrams of the sub-components elsewhere in the document? What construct would be appropriate for this, would a simple blank box with the title of the sub-component suffice?

damithc commented 2 years ago

would a simple blank box with the title of the sub-component suffice?

yes, that should do, @benmurphyy

Also, you can omit less important class altogether, or use separate class diagrams to show clusters of classes that work together. There is no rule to say that a class diagram should represent all classes in the component directly or indirectly. It depends on the accompanying text as well. For example, when describing the parsing of commands by the Logic component, you can use a class diagram that shows only the classes that take part in parsing.