Analytical class diagram PB007 Software engineering I Marián Macik originally by Stanislav Chren Week 05 Software engineering I (PB007) Analytical class diagram Week 05 1 / 13 Analytical class diagram Class diagram represents a static view of classes, their attributes, operations and relationships. Analytical class diagram depicts analytical classes, which represent concepts from the business domain, i.e. it does not capture implementation details Software engineering I (PB007) Analytical class diagram Week 05 2 / 13 Properties of analytical classes Well-designed analytical class should have the following properties: a name that clearly represents the purpose it has a small number (3-5) of responsibilities/operations it is not isolated from other classes it has high cohesion Example: class ShoppingCart, operations addItem(), removeItem(), displayContents(), acceptPayment(),printInvoice() it has low coupling Be careful about: a large number of very small classes a low number of very large classes functoids - functions/procedures, which are represented by a separate class. complex classes that manage other classes. They are often called as system, controller or manager. complex inheritance hierarchy (over 2 levels). Software engineering I (PB007) Analytical class diagram Week 05 3 / 13 Analytical class discovery Analysis of noun and verbs: gather available resources (specifications, use case documentation, ...) nouns are candidates for classes or attributes verbs or verb forms are candidates for operation/responsibilities of classes watch out for „hidden classes/attributes/operations CRC (class, responsibilities, collaborators) analysis group activity involving brainstorming cards represent candidate classes. They consist of - class name, responsibilities and collaborators (other classes that are related to the class). Software engineering I (PB007) Analytical class diagram Week 05 4 / 13 Relationships between classes The basic relationships include: Generalization Association Dependency Association is the semantic relationship between classes. It can have the following attributes: name name of roles multiplicity navigability Software engineering I (PB007) Analytical class diagram Week 05 5 / 13 Relationships between classes II Name of association and names of roles Note: You should use only one option, not both for the given association. Software engineering I (PB007) Analytical class diagram Week 05 6 / 13 Relationships between classes III Multiple and reflexive associations: Software engineering I (PB007) Analytical class diagram Week 05 7 / 13 Relationships between classes IV Association class: Software engineering I (PB007) Analytical class diagram Week 05 8 / 13 Procedure for creating aclass diagram 1 Find classes, attributes, operations and collaborators 2 Determine inheritance between the classes 3 Capture relationships with associations 4 Name the associations or roles 5 Determine the multiplicities of associations 6 Determine navigability of the associations 7 Specify dependencies 8 Add additional attributes and operations that a part of the domain. Software engineering I (PB007) Analytical class diagram Week 05 9 / 13 Information sources www.uml.org.cn/umlapplication/pdf/crcmodeling.pdf www.agilemodeling.com/artifacts/classDiagram.htm sourcemaking.com/uml/modeling-it-systems/ structural-view/class-diagram http://sourcemaking.com/uml/modeling-it-systems/ structural-view/constructing-class-diagrams Catalogue of common mistakes Available in the interactive syllabus Software engineering I (PB007) Analytical class diagram Week 05 10 / 13 Tasks Fix the issues from previous week Based on the project assignment, look for analytical classes, attributes, operations and relationships Create an analytical class diagram, including the inheritance, multiplicities and association names/roles. Bonus: specify also the navigability of associations. Generate a PDF report and upload it to the homework vault (Week 05). Software engineering I (PB007) Analytical class diagram Week 05 11 / 13 Rules for report submission 1 Submit the PDF report, not the VP source file and not an exported image. 2 PDF report must be created using the procedure shown on the seminars including the report settings. 3 The name of the PDF report file should be lastname1-lastname2-lastname3 of the team members. 4 PDF report must contain all diagrams modelled until now. 5 PDF report must be uploaded to the homework vault by the specified deadline. 6 PDF report must be uploaded to the correct homework vault. The name of the homework vault is always specified on the slides. 7 Each team uploads only a single PDF report for the whole team. 8 Submitted diagrams must be clear and readable. 9 Submitted diagrams should not contain serious mistakes. At least, they should not contain mistakes mentioned in the Catalogue of common mistakes. Software engineering I (PB007) Analytical class diagram Week 05 12 / 13 VP report settings Software engineering I (PB007) Analytical class diagram Week 05 13 / 13