{"id":52,"date":"2023-09-04T18:36:43","date_gmt":"2023-09-04T18:36:43","guid":{"rendered":"https:\/\/libraryresources.nse.org.ng\/setextbook\/chapter\/uml-class\/"},"modified":"2026-03-16T14:21:10","modified_gmt":"2026-03-16T14:21:10","slug":"uml-class","status":"publish","type":"chapter","link":"https:\/\/libraryresources.nse.org.ng\/setextbook\/chapter\/uml-class\/","title":{"raw":"Unified Modeling Language Class and Sequence Diagrams","rendered":"Unified Modeling Language Class and Sequence Diagrams"},"content":{"raw":"<div class=\"imgbleed bottom\"><a href=\"https:\/\/open.oregonstate.education\/app\/uploads\/sites\/174\/2023\/09\/CoverChapter05.png\"><img class=\"aligncenter size-full wp-image-33\" src=\"https:\/\/libraryresources.nse.org.ng\/wp-content\/uploads\/sites\/16\/2023\/09\/CoverChapter05.png\" alt=\"Chapter cover\" width=\"2550\" height=\"1320\"><\/a><\/div>\n<h2 class=\"chtitle\">Chapter 4\nUnified Modeling Language Class <span class=\"chtitlesmall\">and<\/span> Sequence Diagrams<\/h2>\n<div class=\"textbox textbox--sidebar\">\u201cNobody, not even the creators of the UML, understand or use all of it.\u201d (Fowler, <span class=\"citation\">[pb_glossary id=\"672\"]2004[\/pb_glossary]<\/span>)<\/div>\nAfter a discussion of diagrams in general, this chapter covers two common Unified Modeling Language (UML) diagram types: [pb_glossary id=\"860\"]class diagrams[\/pb_glossary] and [pb_glossary id=\"861\"]sequence diagrams[\/pb_glossary].\n<h1>4.1 How Diagrams Help<\/h1>\nDiagrams can help in at least two major ways:\n<ol>\n \t<li>They can <strong>help you plan software<\/strong> you will create. Once you\u2019ve created diagrams for planning your software, you can use them to communicate to the development team what will\/should be implemented and decide (evaluate) whether your plans are any good (e.g., are clear, are logical, reflect your project\u2019s desired quality attributes, and so on).<\/li>\n \t<li>They can <strong>help you describe software<\/strong> you\u2019ve already created. If your software is already created, diagrams are good for documentation and, as mentioned above, for evaluating how satisfactory your software is. The purpose of including diagrams in documentation is to communicate something about your software to somebody. There are many different audiences you could be trying to communicate with.<\/li>\n<\/ol>\nExample audiences for your diagrams include other developers on the project, your supervisor or manager, developers who might be interested in joining the team, developers who want to integrate with your system, curious end users, and students of software engineering. Depending on the [pb_glossary id=\"862\"]integrated development environment (IDE)[\/pb_glossary]\/tools you\u2019re using, diagrams can be automatically generated from your code, which helps make documentation maintenance easier and more likely to happen.\n<h1>4.2 What Diagrams Must Do Well<\/h1>\nTo be helpful, diagrams must communicate <strong>clearly<\/strong> and at an <strong>appropriate level of detail<\/strong> for your intended audience. If your intended audience does not understand your diagram\u2014or misunderstands it\u2014your diagram has failed.\n<h1>4.3 What Is UML?<\/h1>\nUnified Modeling Language is a family of graphical notations for describing and designing software through diagrams. It is especially applicable to object-oriented software, but some parts of UML are applicable to many types of software. Different UML notations are used for different types of UML diagrams, each of which has a specific purpose. UML was first published in 1994, became a standard of the Object Management Group (OMG) in 1997, and became an ISO standard in 2005. UML is currently on version 2.\n<h1>4.4 Why Use UML?<\/h1>\nThere are multiple <strong>benefits<\/strong> of creating diagrams using UML:\n<ul>\n \t<li>UML gives you (1) <strong>notation for designing<\/strong> software so that your implementation will be structured and (2) <strong>notation for describing<\/strong> the existing design of software so that you can evaluate whether the design is any good.<\/li>\n \t<li>UML diagramming <strong>forces you to think<\/strong> about software design in a structured way. When people try to design software in their minds, they can be sloppy about it\u2014thinking about the aspects of the design they want to think about. UML can encourage you to face the trickier parts of software design.<\/li>\n \t<li>UML diagramming gives you a view of the software at <strong>different levels of design<\/strong> (e.g., class level, component level, package level).<\/li>\n \t<li>UML provides a <strong>common language<\/strong> between software professionals. Because UML is well known, it gives developers and managers a way to communicate in detail about software. That being said, expect to encounter variations in how UML notation is used\u2014it can be difficult to remember UML notation; developers will make mistakes or adapt the notation to their own way of thinking. It can help to provide a legend or explanation of what your notation means.<\/li>\n \t<li>UML diagrams give you a way to tell people about your software\u2019s structure <strong>without asking them to look through code<\/strong>. This is nice, for example, when onboarding new developers or communicating with managers.<\/li>\n<\/ul>\n<h1>4.5 Why NOT Use UML?<\/h1>\n<div class=\"textbox textbox--sidebar\">Some IDEs will automatically generate some types of UML diagrams from your code. This is nice because it\u2019s easy to regenerate your diagram when your code changes. The generated diagrams can sometimes have more detail than you want, however, making them less good for communicating.<\/div>\nThere are some <strong>drawbacks<\/strong> to UML diagramming:\n<ul>\n \t<li>People tend to <strong>vary their UML notation<\/strong>, which can cause <strong>confusion<\/strong>. Some tips for avoiding that problem include (1) keeping your notation basic and (2) explaining more complex notation.<\/li>\n \t<li>Getting UML notation right <strong>can take a lot of time<\/strong>. Remember that diagrams are for communicating. If creating the diagram takes longer than explaining the code a different way, the diagram isn\u2019t helping.<\/li>\n \t<li>UML diagrams <strong>can require a lot of maintenance<\/strong>. If your software design changes frequently, so must your UML diagrams if you want them to be accurate. Fortunately, some IDEs can generate some UML diagrams from your code.<\/li>\n<\/ul>\n<h1>4.6 Class Diagrams<\/h1>\nA class diagram describes a system\u2019s classes and the static relationships that exist among them. Class diagrams also show properties and operations of a class. Properties represent the structure of a class (e.g., instance variables) and operations represent the functionality provided by the class (e.g., methods; Fowler, <span class=\"citation\">[pb_glossary id=\"672\"]2004[\/pb_glossary]<\/span>).\n\nFigure 4.1 shows an example class diagram. In the diagram, there are relationships between three classes: Customer, Order, and SharedOrder. An Order has one Customer\u2014but the same Customer can be on multiple Orders. A SharedOrder is a type of Order that can have multiple Customers. The classes have attributes (e.g., id) and operations (e.g., getId()).\n\n[caption id=\"attachment_87\" align=\"aligncenter\" width=\"1140\"]<a href=\"https:\/\/open.oregonstate.education\/app\/uploads\/sites\/174\/2023\/09\/Fig05.01.png\"><img class=\"wp-image-34 size-full\" src=\"https:\/\/libraryresources.nse.org.ng\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.01.png\" alt=\"An example of a sequence diagram\" width=\"1140\" height=\"626\"><\/a> <strong>Figure 4.1<\/strong>\u00a0Simple Class Diagram[\/caption]\n\nThe next section explains each of the notational elements shown in the example.\n<h2>4.6.1 UML Class Diagram Notation<\/h2>\nThis section contains some of the most common UML class diagram notation.\n<div class=\"largeimg\">\n\n[caption id=\"attachment_88\" align=\"aligncenter\" width=\"528\"]<a href=\"https:\/\/open.oregonstate.education\/app\/uploads\/sites\/174\/2023\/09\/Fig05.02.png\"><img class=\"wp-image-35 size-full\" src=\"https:\/\/libraryresources.nse.org.ng\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.02.png\" alt=\"A box with text reading &quot;Some text&quot;\" width=\"528\" height=\"406\"><\/a> <strong>Figure 4.2<\/strong> Note[\/caption]\n\n<\/div>\n<em>Note. <\/em>Notes are for placing comments on class diagrams.\n<div class=\"largeimg\">\n\n[caption id=\"attachment_102\" align=\"aligncenter\" width=\"1118\"]<a href=\"https:\/\/open.oregonstate.education\/app\/uploads\/sites\/174\/2023\/09\/Fig05.03.png\"><img class=\"wp-image-36 size-full\" src=\"https:\/\/libraryresources.nse.org.ng\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.03.png\" alt=\"Underneath the section &quot;ClassName&quot; are examples of attributes and operations\" width=\"1118\" height=\"876\"><\/a> <strong>Figure 4.3<\/strong> Class[\/caption]\n\n<\/div>\n<em>Note.<\/em> Attributes are properties that are listed within a class box and the operations are methods. The + indicates a public method, - is private, and # is protected. The notation includes attribute types (e.g., int, Token, etc.), method parameters and return types, and default values for attributes.\n\n[caption id=\"attachment_130\" align=\"aligncenter\" width=\"1304\"]<a href=\"https:\/\/open.oregonstate.education\/app\/uploads\/sites\/174\/2023\/09\/Fig05.04.png\"><img class=\"wp-image-37 size-full\" src=\"https:\/\/libraryresources.nse.org.ng\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.04.png\" alt=\"Two boxes, &quot;Class 1&quot; and &quot;Class 2,&quot; are linked by a horizonal line\" width=\"1304\" height=\"400\"><\/a> <strong>Figure 4.4<\/strong> Association[\/caption]\n\n<em>Note. <\/em>Association means that a class contains a reference to an object(s) of the other class in the form of a property. In this example, we aren\u2019t told whether Class1 references Class2 or vice versa.\n\n[caption id=\"attachment_103\" align=\"aligncenter\" width=\"1304\"]<a href=\"https:\/\/open.oregonstate.education\/app\/uploads\/sites\/174\/2023\/09\/Fig05.05.png\"><img class=\"wp-image-38 size-full\" src=\"https:\/\/libraryresources.nse.org.ng\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.05.png\" alt=\"A box, &quot;Class 1,&quot; is linked in one direction by an arrow to another box, &quot;Class 2&quot;\" width=\"1304\" height=\"400\"><\/a> <strong>Figure 4.5<\/strong>\u00a0Unidirectional Association[\/caption]\n\n<em>Note. <\/em>The arrow indicates that Class1 <strong>has a<\/strong> Class2.\n\n[caption id=\"attachment_104\" align=\"aligncenter\" width=\"1768\"]<a href=\"https:\/\/open.oregonstate.education\/app\/uploads\/sites\/174\/2023\/09\/Fig05.06.png\"><img class=\"wp-image-39 size-full\" src=\"https:\/\/libraryresources.nse.org.ng\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.06.png\" alt=\"Two linked boxes, &quot;Class 1&quot; and &quot;Class 2,\u201d have a property titled &quot;+instance1&quot;\" width=\"1768\" height=\"400\"><\/a> <strong>Figure 4.6\u00a0<\/strong>Unidirectional Association with Property Name[\/caption]\n\n<em>Note.<\/em> Class1 has a property named instance1. It is an instance of Class2.\n\n[caption id=\"attachment_105\" align=\"aligncenter\" width=\"1768\"]<a href=\"https:\/\/open.oregonstate.education\/app\/uploads\/sites\/174\/2023\/09\/Fig05.07.png\"><img class=\"wp-image-40 size-full\" src=\"https:\/\/libraryresources.nse.org.ng\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.07.png\" alt=\"Two linked boxes, &quot;Class 1&quot; and &quot;Class 2,&quot; have a property titled &quot;+instance1.&quot; Underneath the property is listed &quot;0..1&quot;\" width=\"1768\" height=\"400\"><\/a> <strong>Figure 4.7<\/strong> Unidirectional Association with Property Name and Target Multiplicity[\/caption]\n\n<em>Note. <\/em>Class1 has a property named instance1 containing zero or one instances of Class2.\n\n[caption id=\"attachment_89\" align=\"aligncenter\" width=\"1768\"]<a href=\"https:\/\/open.oregonstate.education\/app\/uploads\/sites\/174\/2023\/09\/Fig05.08.png\"><img class=\"wp-image-41 size-full\" src=\"https:\/\/libraryresources.nse.org.ng\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.08.png\" alt=\"Two linked boxes, &quot;Class 1&quot; and &quot;Class 2,&quot; have a property. Underneath the property is listed &quot;0..1.&quot; Next to box &quot;Class 1&quot; is an asterisk\" width=\"1768\" height=\"400\"><\/a> <strong>Figure 4.8<\/strong> Unidirectional Association with Property Name, Target Multiplicity, and Source Multiplicity[\/caption]\n\n<em>Note. <\/em>Zero or more instances of Class1 have properties named instance1 containing zero or one instance of Class2.\n\n[caption id=\"attachment_106\" align=\"aligncenter\" width=\"1768\"]<a href=\"https:\/\/open.oregonstate.education\/app\/uploads\/sites\/174\/2023\/09\/Fig05.09.png\"><img class=\"wp-image-42 size-full\" src=\"https:\/\/libraryresources.nse.org.ng\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.09.png\" alt=\"Two boxes, &quot;Class 1&quot; and &quot;Class 2,&quot; are linked by a bidirectional arrow. Next to box &quot;Class 1&quot; is &quot;1.&quot; Next to box &quot;Class 2&quot; is an asterisk\" width=\"1768\" height=\"400\"><\/a> <strong>Figure 4.9<\/strong>\u00a0Bidirectional Association and Target\/Source Multiplicity[\/caption]\n\n<em>Note. <\/em>Class1 has zero or more instances of Class2. Class2 has exactly one instance of Class1.\n<div class=\"largeimg\">\n\n[caption id=\"attachment_107\" align=\"aligncenter\" width=\"526\"]<a href=\"https:\/\/open.oregonstate.education\/app\/uploads\/sites\/174\/2023\/09\/Fig05.10.png\"><img class=\"wp-image-43 size-full\" src=\"https:\/\/libraryresources.nse.org.ng\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.10.png\" alt=\"Two boxes, &quot;Class 1&quot; and &quot;Class 2,&quot; are in a column. An arrow from &quot;Class 2&quot; points upwards to &quot;Class 1&quot;\" width=\"526\" height=\"930\"><\/a> <strong>Figure 4.10<\/strong> Inheritance[\/caption]\n\n<\/div>\n<em>Note. <\/em>Class2 is a subclass of Class1; Class2 <strong>is a <\/strong>Class1.\n<h2>4.6.2 Real-World Class Diagram Examples<\/h2>\nThese PDFs contain class diagrams for actual software.\n<ul>\n \t<li><a href=\"https:\/\/research-repository.griffith.edu.au\/bitstream\/handle\/10072\/401215\/Estivill-Castro165057-Published.pdf?sequence=2\"><em>EvoloPy: An open-source nature-inspired optimization framework in Python<\/em><\/a> (Faris et al., <span class=\"citation\">[pb_glossary id=\"671\"]2016[\/pb_glossary]<\/span>).<\/li>\n \t<li><a href=\"https:\/\/www.mdpi.com\/2220-9964\/4\/4\/2219\/pdf\"><em>Processing: A Python framework for the seamless integration of geoprocessing tools in QGIS<\/em><\/a> (Graser &amp; Olaya, <span class=\"citation\">[pb_glossary id=\"670\"]2015[\/pb_glossary]<\/span>).<\/li>\n \t<li><a href=\"https:\/\/citeseerx.ist.psu.edu\/document?repid=rep1&amp;type=pdf&amp;doi=cdb5e5d28a9bd6a04f969d6465110f875e706e71\"><em>Java-based graphical user interface for MRUI, a software package for quantitation of in vivo\/medical magnetic resonance spectroscopy signals<\/em><\/a> (Naressi et al., <span class=\"citation\">[pb_glossary id=\"673\"]2001[\/pb_glossary]<\/span>).<\/li>\n \t<li><a href=\"https:\/\/arxiv.org\/pdf\/2111.11807.pdf\"><em>RepoMiner: A language-agnostic Python framework to mine software repositories for defect prediction<\/em> [PDF]<\/a> (Palma et al., <span class=\"citation\">[pb_glossary id=\"674\"]2021[\/pb_glossary]<\/span>).<\/li>\n \t<li><a href=\"https:\/\/www.ars.usda.gov\/ARSUserFiles\/40820\/Thorp2022%20-%20pyfao56.pdf\"><em>pyfao56: FAO-56 evapotranspiration in<\/em> <em>Python<\/em> [PDF]<\/a> (Thorp, <span class=\"citation\">[pb_glossary id=\"675\"]2022[\/pb_glossary]<\/span>).<\/li>\n<\/ul>\nIf any links are broken, try the <a href=\"https:\/\/web.archive.org\/\">Wayback Machine<\/a>.\n<h1>4.7 Sequence Diagrams<\/h1>\n<div class=\"textbox textbox--sidebar\">When making any diagram, know your audience and what you\u2019re trying to communicate. If your audience is a human, they have limited capacity for absorbing tiny details (and probably limited time). Focus on showing them what\u2019s most important in a way they will understand.<\/div>\nA sequence diagram describes interactions between objects. Usually, the diagram shows a single use case or scenario. Sequence diagrams are a type of [pb_glossary id=\"863\"]interaction diagram[\/pb_glossary] and are not as good for showing object implementation details.\n\nThis section provides an example sequence diagram and commonly used sequence diagram notation. For more detailed information, see Fowler (<span class=\"citation\">[pb_glossary id=\"672\"]2004[\/pb_glossary]<\/span>).\n\nIn Figure 4.11, the example sequence diagram represents interactions between instances of the Manager, Employee, and Order classes. Manager asks the Employee for a status update, Employee complies, Employee creates an Order, Manager asks Employee to close the shop, Employee closes the Order.\n\nIn the example, the columns (called [pb_glossary id=\"864\"]participants[\/pb_glossary]) are objects, but this is not always the case. For example, a participant can be a user. Users, if they are human, are sometimes represented as stick figures (without the box). Another possible non-object participant could be a database (although in some cases, a database is considered an object). What\u2019s most important when creating diagrams is not following the rules or conventions but communicating with your audience.\n\n[caption id=\"attachment_108\" align=\"aligncenter\" width=\"1110\"]<a href=\"https:\/\/open.oregonstate.education\/app\/uploads\/sites\/174\/2023\/09\/Fig05.11.png\"><img class=\"wp-image-44 size-full\" src=\"https:\/\/libraryresources.nse.org.ng\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.11.png\" alt=\"An example of a Simple Sequence Diagram\" width=\"1110\" height=\"792\"><\/a> <strong>Figure 4.11<\/strong>\u00a0Simple Sequence Diagram[\/caption]\n<h2>4.7.1 UML Sequence Diagram Notation<\/h2>\n[caption id=\"attachment_109\" align=\"aligncenter\" width=\"726\"]<a href=\"https:\/\/open.oregonstate.education\/app\/uploads\/sites\/174\/2023\/09\/Fig05.12.png\"><img class=\"wp-image-45 size-full\" src=\"https:\/\/libraryresources.nse.org.ng\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.12.png\" alt=\"Two rectangles, labelled &quot;a Manager&quot; and &quot;an Employee&quot; are side by side\" width=\"726\" height=\"364\"><\/a> <strong>Figure 4.12<\/strong>\u00a0Participant[\/caption]\n\n<em>Note.<\/em> The \u201ccolumns\u201d of a sequence diagram are each participants. Participants are often objects. The name of the participant goes in the box.\n\n[caption id=\"attachment_110\" align=\"aligncenter\" width=\"706\"]<a href=\"https:\/\/open.oregonstate.education\/app\/uploads\/sites\/174\/2023\/09\/Fig05.13.png\"><img class=\"wp-image-46 size-full\" src=\"https:\/\/libraryresources.nse.org.ng\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.13.png\" alt=\"Two boxes, side by side, with a dashed vertical line from the bottom of each box\" width=\"706\" height=\"452\"><\/a> <strong>Figure 4.13<\/strong>\u00a0Lifeline[\/caption]\n\n<em>Note.<\/em> Vertical dashed line represents the life span of the participant. Top is beginning of life, and bottom is the end. Life ends when the participant is deleted.\n\n[caption id=\"attachment_111\" align=\"aligncenter\" width=\"706\"]<a href=\"https:\/\/open.oregonstate.education\/app\/uploads\/sites\/174\/2023\/09\/Fig05.14.png\"><img class=\"wp-image-47 size-full\" src=\"https:\/\/libraryresources.nse.org.ng\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.14.png\" alt=\"Two boxes, side by side, with a dashed vertical line from the bottom of each. An arrow, &quot;getStatus(),&quot; runs between the lines\" width=\"706\" height=\"452\"><\/a> <strong>Figure 4.14\u00a0<\/strong>Message[\/caption]\n\n<em>Note.<\/em> Interaction from one participant to another is shown by the solid line with arrow. Often a method call.\n\n[caption id=\"attachment_90\" align=\"aligncenter\" width=\"706\"]<a href=\"https:\/\/open.oregonstate.education\/app\/uploads\/sites\/174\/2023\/09\/Fig05.15.png\"><img class=\"wp-image-48 size-full\" src=\"https:\/\/libraryresources.nse.org.ng\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.15.png\" alt=\"Two boxes, side by side, with a dashed vertical line from the bottom of each. An arrow, &quot;getStatus(),&quot; runs between the lines. There is a box on each line\" width=\"706\" height=\"452\"><\/a> <strong>Figure 4.15<\/strong> Activation Bar[\/caption]\n\n<em>Note. <\/em>Box on lifeline indicates when the participant is active. Indicates method is on call stack.\n\n[caption id=\"attachment_112\" align=\"aligncenter\" width=\"706\"]<a href=\"https:\/\/open.oregonstate.education\/app\/uploads\/sites\/174\/2023\/09\/Fig05.16.png\"><img class=\"wp-image-49 size-full\" src=\"https:\/\/libraryresources.nse.org.ng\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.16.png\" alt=\"Two boxes with a dashed vertical line from the bottom of each. An arrow, &quot;getStatus(),&quot; runs between the lines. Another arrow, \u201cstatus,\u201d points in the opposite direction\" width=\"706\" height=\"452\"><\/a> <strong>Figure 4.16<\/strong>\u00a0Return[\/caption]\n\n<em>Note. <\/em>Dashed line with arrow indicates method return. Use only when it helps communicate something important about the interaction.\n\n[caption id=\"attachment_113\" align=\"aligncenter\" width=\"706\"]<a href=\"https:\/\/open.oregonstate.education\/app\/uploads\/sites\/174\/2023\/09\/Fig05.17.png\"><img class=\"wp-image-50 size-full\" src=\"https:\/\/libraryresources.nse.org.ng\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.17.png\" alt=\"Two boxes with a dashed vertical line from the bottom of each. An arrow, &quot;sumOfChildren(),&quot; runs from one line and loops back to the same line\" width=\"706\" height=\"506\"><\/a> <strong>Figure 4.17<\/strong>\u00a0Self-Call[\/caption]\n\n<em>Note. <\/em>Method calling self. Solid line with arrow points back to participant\u2019s own lifeline.\n\n[caption id=\"attachment_114\" align=\"aligncenter\" width=\"726\"]<a href=\"https:\/\/open.oregonstate.education\/app\/uploads\/sites\/174\/2023\/09\/Fig05.18.png\"><img class=\"wp-image-51 size-full\" src=\"https:\/\/libraryresources.nse.org.ng\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.18.png\" alt=\"Two boxes with a dashed vertical line from the bottom of each. An arrow runs from the left line to the right. The line on the right terminates with an &quot;X&quot;\" width=\"726\" height=\"510\"><\/a> <strong>Figure 4.18<\/strong>\u00a0Deletion[\/caption]\n\n<em>Note. <\/em>End of participant\u2019s life. Indicated by an X on the lifeline.\n<h2>4.7.2 Real-World Sequence Diagram Examples<\/h2>\nThese PDFs contain sequence diagrams for actual software.\n<ul>\n \t<li><a href=\"https:\/\/ricerca.uniba.it\/bitstream\/11586\/256332\/9\/PID5822281-PrePrint%28con-DOI%29.pdf\"><em>Py4JFML: A Python wrapper for using the IEEE Std 1855-2016 through JFML<\/em> [PDF]<\/a> (Alcal\u00e1-Fdez et al., <span class=\"citation\">[pb_glossary id=\"666\"]2019[\/pb_glossary]<\/span>).<\/li>\n \t<li><a href=\"https:\/\/www.sciencedirect.com\/science\/article\/pii\/S2352711019300950\"><em>COFFEE\u2014An MPI-parallelized Python package for the numerical evolution of differential equations<\/em><\/a> (Doulis et al., <span class=\"citation\">[pb_glossary id=\"667\"]2019[\/pb_glossary]<\/span>).<\/li>\n \t<li><a href=\"https:\/\/openresearchsoftware.metajnl.com\/articles\/10.5334\/jors.163\"><em>Teetool\u2014A probabilistic trajectory analysis tool<\/em><\/a> (Eerland et al., <span class=\"citation\">[pb_glossary id=\"668\"]2017[\/pb_glossary]<\/span>).<\/li>\n \t<li><a href=\"https:\/\/hal.science\/hal-02335530\/file\/DTIS19188.1570026732_preprint.pdf\"><em>GEMS: A Python library for automation of multidisciplinary design optimization process generation<\/em> [PDF]<\/a> (Gallard et al., <span class=\"citation\">[pb_glossary id=\"669\"]2018[\/pb_glossary]<\/span>).<\/li>\n<\/ul>\nIf any links are broken, try the <a href=\"https:\/\/web.archive.org\/\">Wayback Machine<\/a>.\n<h1>4.8 Summary<\/h1>\nUML diagrams can be helpful for communicating how your code works. Class diagrams and sequence diagrams are two commonly used types of UML diagrams. Each type of diagram emphasizes some part of the code design while leaving out other parts. UML diagrams are for communicating with humans\u2014not computers.\n<h1>References<\/h1>\n<p class=\"hanging-indent\">Alcal\u00e1-Fdez, J., Alonso, J. M., Castiello, C., Mencar, C., &amp; Soto-Hidalgo, J. M. (2019, June). <em>Py4JFML: A Python wrapper for using the IEEE Std 1855-2016 through JFML<\/em>. Paper presented at the 2019 IEEE International Conference on Fuzzy Systems (FUZZ-IEEE), New Orleans, LA, USA. <a href=\"https:\/\/ricerca.uniba.it\/bitstream\/11586\/256332\/9\/PID5822281-PrePrint%28con-DOI%29.pdf\">https:\/\/ricerca.uniba.it\/bitstream\/11586\/256332\/9\/PID5822281-PrePrint%28con-DOI%29.pdf<\/a><\/p>\n<p class=\"hanging-indent\">Doulis, G., Frauendiener, J., Stevens, C., &amp; Whale, B. (2019). COFFEE\u2014An MPI-parallelized Python package for the numerical evolution of differential equations. <em>SoftwareX<\/em>, 10, 100283. <a href=\"https:\/\/www.sciencedirect.com\/science\/article\/pii\/S2352711019300950\">https:\/\/www.sciencedirect.com\/science\/article\/pii\/S2352711019300950<\/a><\/p>\n<p class=\"hanging-indent\">Eerland, W., Box, S., Fangohr, H., &amp; S\u00f3bester, A. (2017). Teetool\u2014A probabilistic trajectory analysis tool. <em>Journal of Open Research Software<\/em>, <em>5<\/em>(1). <a href=\"https:\/\/openresearchsoftware.metajnl.com\/articles\/10.5334\/jors.163\">https:\/\/openresearchsoftware.metajnl.com\/articles\/10.5334\/jors.163<\/a><\/p>\n<p class=\"hanging-indent\">Faris, H., Aljarah, I., Mirjalili, S., Castillo, P. A., &amp; Guerv\u00f3s, J. J. M. (2016). EvoloPy: An open-source nature-inspired optimization framework in python. In <em>Proceedings of the 8th International Joint Conference on Computational Intelligence (IJCCI): Evolutional Computational Theory and Applications (ECTA), 1<\/em>, 171-177. <a href=\"https:\/\/research-repository.griffith.edu.au\/bitstream\/handle\/10072\/401215\/Estivill-Castro165057-Published.pdf?sequence=2\">https:\/\/research-repository.griffith.edu.au\/bitstream\/handle\/10072\/401215\/Estivill-Castro165057-Published.pdf?sequence=2<\/a><\/p>\n<p class=\"hanging-indent\">Fowler, M. (2004). <em>UML distilled: A brief guide to the standard object modeling language<\/em>. Addison-Wesley Professional.<\/p>\n<p class=\"hanging-indent\">Gallard, F., Vanaret, C., Gu\u00e9not, D., Gachelin, V., Lafage, R., Pauwels, B., Barjhoux, P.-J., &amp; Gazaix, A. (2018). <em>GEMS: A Python library for automation of multidisciplinary design optimization process generation<\/em>. Paper presented at the 2018 AIAA\/ASCE\/AHS\/ASC Structures, Structural Dynamics, and Materials Conference, Kissimmee, FL, USA.. <a href=\"https:\/\/hal.science\/hal-02335530\/file\/DTIS19188.1570026732_preprint.pdf\">https:\/\/hal.science\/hal-02335530\/file\/DTIS19188.1570026732_preprint.pdf<\/a><\/p>\n<p class=\"hanging-indent\">Graser, A., &amp; Olaya, V. (2015). Processing: A python framework for the seamless integration of geoprocessing tools in QGIS. <em>ISPRS International Journal of Geo-Information<\/em>, <em>4<\/em>(4), 2219-2245. <a href=\"https:\/\/www.mdpi.com\/2220-9964\/4\/4\/2219\/pdf\">https:\/\/www.mdpi.com\/2220-9964\/4\/4\/2219\/pdf<\/a><\/p>\n<p class=\"hanging-indent\">Naressi, A., Couturier, C., Castang, I., De Beer, R., &amp; Graveron-Demilly, D. (2001). Java-based graphical user interface for MRUI, a software package for quantitation of in vivo\/medical magnetic resonance spectroscopy signals. <em>Computers in Biology and Medicine<\/em>, <em>31<\/em>(4), 269-286. <a href=\"https:\/\/citeseerx.ist.psu.edu\/document?repid=rep1&amp;type=pdf&amp;doi=cdb5e5d28a9bd6a04f969d6465110f875e706e71\">https:\/\/citeseerx.ist.psu.edu\/document?repid=rep1&amp;type=pdf&amp;doi=cdb5e5d28a9bd6a04f969d6465110f875e706e71<\/a><\/p>\n<p class=\"hanging-indent\">Palma, S. D., Di Nucci, D., &amp; Tamburri, D. (2021). RepoMiner: A language-agnostic Python framework to mine software repositories for defect prediction. <em>arXiv preprint arXiv:2111.11807<\/em>. <a href=\"https:\/\/arxiv.org\/pdf\/2111.11807.pdf\">https:\/\/arxiv.org\/pdf\/2111.11807.pdf<\/a><\/p>\n<p class=\"hanging-indent\">Thorp, K. R. (2022). pyfao56: FAO-56 evapotranspiration in Python. <em>SoftwareX<\/em>, <em>19<\/em>, 101208. <a href=\"https:\/\/www.ars.usda.gov\/ARSUserFiles\/40820\/Thorp2022%20-%20pyfao56.pdf\">https:\/\/www.ars.usda.gov\/ARSUserFiles\/40820\/Thorp2022%20-%20pyfao56.pdf<\/a><\/p>","rendered":"<div class=\"imgbleed bottom\"><a href=\"https:\/\/open.oregonstate.education\/app\/uploads\/sites\/174\/2023\/09\/CoverChapter05.png\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-33\" src=\"https:\/\/libraryresources.nse.org.ng\/wp-content\/uploads\/sites\/16\/2023\/09\/CoverChapter05.png\" alt=\"Chapter cover\" width=\"2550\" height=\"1320\" srcset=\"https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2023\/09\/CoverChapter05.png 2550w, https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2023\/09\/CoverChapter05-300x155.png 300w, https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2023\/09\/CoverChapter05-1024x530.png 1024w, https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2023\/09\/CoverChapter05-768x398.png 768w, https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2023\/09\/CoverChapter05-1536x795.png 1536w, https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2023\/09\/CoverChapter05-2048x1060.png 2048w, https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2023\/09\/CoverChapter05-65x34.png 65w, https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2023\/09\/CoverChapter05-225x116.png 225w, https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2023\/09\/CoverChapter05-350x181.png 350w\" sizes=\"(max-width: 2550px) 100vw, 2550px\" \/><\/a><\/div>\n<h2 class=\"chtitle\">Chapter 4<br \/>\nUnified Modeling Language Class <span class=\"chtitlesmall\">and<\/span> Sequence Diagrams<\/h2>\n<div class=\"textbox textbox--sidebar\">\u201cNobody, not even the creators of the UML, understand or use all of it.\u201d (Fowler, <span class=\"citation\">2004<\/span>)<\/div>\n<p>After a discussion of diagrams in general, this chapter covers two common Unified Modeling Language (UML) diagram types: class diagrams and sequence diagrams.<\/p>\n<h1>4.1 How Diagrams Help<\/h1>\n<p>Diagrams can help in at least two major ways:<\/p>\n<ol>\n<li>They can <strong>help you plan software<\/strong> you will create. Once you\u2019ve created diagrams for planning your software, you can use them to communicate to the development team what will\/should be implemented and decide (evaluate) whether your plans are any good (e.g., are clear, are logical, reflect your project\u2019s desired quality attributes, and so on).<\/li>\n<li>They can <strong>help you describe software<\/strong> you\u2019ve already created. If your software is already created, diagrams are good for documentation and, as mentioned above, for evaluating how satisfactory your software is. The purpose of including diagrams in documentation is to communicate something about your software to somebody. There are many different audiences you could be trying to communicate with.<\/li>\n<\/ol>\n<p>Example audiences for your diagrams include other developers on the project, your supervisor or manager, developers who might be interested in joining the team, developers who want to integrate with your system, curious end users, and students of software engineering. Depending on the integrated development environment (IDE)\/tools you\u2019re using, diagrams can be automatically generated from your code, which helps make documentation maintenance easier and more likely to happen.<\/p>\n<h1>4.2 What Diagrams Must Do Well<\/h1>\n<p>To be helpful, diagrams must communicate <strong>clearly<\/strong> and at an <strong>appropriate level of detail<\/strong> for your intended audience. If your intended audience does not understand your diagram\u2014or misunderstands it\u2014your diagram has failed.<\/p>\n<h1>4.3 What Is UML?<\/h1>\n<p>Unified Modeling Language is a family of graphical notations for describing and designing software through diagrams. It is especially applicable to object-oriented software, but some parts of UML are applicable to many types of software. Different UML notations are used for different types of UML diagrams, each of which has a specific purpose. UML was first published in 1994, became a standard of the Object Management Group (OMG) in 1997, and became an ISO standard in 2005. UML is currently on version 2.<\/p>\n<h1>4.4 Why Use UML?<\/h1>\n<p>There are multiple <strong>benefits<\/strong> of creating diagrams using UML:<\/p>\n<ul>\n<li>UML gives you (1) <strong>notation for designing<\/strong> software so that your implementation will be structured and (2) <strong>notation for describing<\/strong> the existing design of software so that you can evaluate whether the design is any good.<\/li>\n<li>UML diagramming <strong>forces you to think<\/strong> about software design in a structured way. When people try to design software in their minds, they can be sloppy about it\u2014thinking about the aspects of the design they want to think about. UML can encourage you to face the trickier parts of software design.<\/li>\n<li>UML diagramming gives you a view of the software at <strong>different levels of design<\/strong> (e.g., class level, component level, package level).<\/li>\n<li>UML provides a <strong>common language<\/strong> between software professionals. Because UML is well known, it gives developers and managers a way to communicate in detail about software. That being said, expect to encounter variations in how UML notation is used\u2014it can be difficult to remember UML notation; developers will make mistakes or adapt the notation to their own way of thinking. It can help to provide a legend or explanation of what your notation means.<\/li>\n<li>UML diagrams give you a way to tell people about your software\u2019s structure <strong>without asking them to look through code<\/strong>. This is nice, for example, when onboarding new developers or communicating with managers.<\/li>\n<\/ul>\n<h1>4.5 Why NOT Use UML?<\/h1>\n<div class=\"textbox textbox--sidebar\">Some IDEs will automatically generate some types of UML diagrams from your code. This is nice because it\u2019s easy to regenerate your diagram when your code changes. The generated diagrams can sometimes have more detail than you want, however, making them less good for communicating.<\/div>\n<p>There are some <strong>drawbacks<\/strong> to UML diagramming:<\/p>\n<ul>\n<li>People tend to <strong>vary their UML notation<\/strong>, which can cause <strong>confusion<\/strong>. Some tips for avoiding that problem include (1) keeping your notation basic and (2) explaining more complex notation.<\/li>\n<li>Getting UML notation right <strong>can take a lot of time<\/strong>. Remember that diagrams are for communicating. If creating the diagram takes longer than explaining the code a different way, the diagram isn\u2019t helping.<\/li>\n<li>UML diagrams <strong>can require a lot of maintenance<\/strong>. If your software design changes frequently, so must your UML diagrams if you want them to be accurate. Fortunately, some IDEs can generate some UML diagrams from your code.<\/li>\n<\/ul>\n<h1>4.6 Class Diagrams<\/h1>\n<p>A class diagram describes a system\u2019s classes and the static relationships that exist among them. Class diagrams also show properties and operations of a class. Properties represent the structure of a class (e.g., instance variables) and operations represent the functionality provided by the class (e.g., methods; Fowler, <span class=\"citation\">2004<\/span>).<\/p>\n<p>Figure 4.1 shows an example class diagram. In the diagram, there are relationships between three classes: Customer, Order, and SharedOrder. An Order has one Customer\u2014but the same Customer can be on multiple Orders. A SharedOrder is a type of Order that can have multiple Customers. The classes have attributes (e.g., id) and operations (e.g., getId()).<\/p>\n<figure id=\"attachment_87\" aria-describedby=\"caption-attachment-87\" style=\"width: 1140px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/open.oregonstate.education\/app\/uploads\/sites\/174\/2023\/09\/Fig05.01.png\"><img decoding=\"async\" class=\"wp-image-34 size-full\" src=\"https:\/\/libraryresources.nse.org.ng\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.01.png\" alt=\"An example of a sequence diagram\" width=\"1140\" height=\"626\" srcset=\"https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.01.png 1140w, https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.01-300x165.png 300w, https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.01-1024x562.png 1024w, https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.01-768x422.png 768w, https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.01-65x36.png 65w, https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.01-225x124.png 225w, https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.01-350x192.png 350w\" sizes=\"(max-width: 1140px) 100vw, 1140px\" \/><\/a><figcaption id=\"caption-attachment-87\" class=\"wp-caption-text\"><strong>Figure 4.1<\/strong>\u00a0Simple Class Diagram<\/figcaption><\/figure>\n<p>The next section explains each of the notational elements shown in the example.<\/p>\n<h2>4.6.1 UML Class Diagram Notation<\/h2>\n<p>This section contains some of the most common UML class diagram notation.<\/p>\n<div class=\"largeimg\">\n<figure id=\"attachment_88\" aria-describedby=\"caption-attachment-88\" style=\"width: 528px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/open.oregonstate.education\/app\/uploads\/sites\/174\/2023\/09\/Fig05.02.png\"><img decoding=\"async\" class=\"wp-image-35 size-full\" src=\"https:\/\/libraryresources.nse.org.ng\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.02.png\" alt=\"A box with text reading &quot;Some text&quot;\" width=\"528\" height=\"406\" srcset=\"https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.02.png 528w, https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.02-300x231.png 300w, https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.02-65x50.png 65w, https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.02-225x173.png 225w, https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.02-350x269.png 350w\" sizes=\"(max-width: 528px) 100vw, 528px\" \/><\/a><figcaption id=\"caption-attachment-88\" class=\"wp-caption-text\"><strong>Figure 4.2<\/strong> Note<\/figcaption><\/figure>\n<\/div>\n<p><em>Note. <\/em>Notes are for placing comments on class diagrams.<\/p>\n<div class=\"largeimg\">\n<figure id=\"attachment_102\" aria-describedby=\"caption-attachment-102\" style=\"width: 1118px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/open.oregonstate.education\/app\/uploads\/sites\/174\/2023\/09\/Fig05.03.png\"><img decoding=\"async\" class=\"wp-image-36 size-full\" src=\"https:\/\/libraryresources.nse.org.ng\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.03.png\" alt=\"Underneath the section &quot;ClassName&quot; are examples of attributes and operations\" width=\"1118\" height=\"876\" srcset=\"https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.03.png 1118w, https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.03-300x235.png 300w, https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.03-1024x802.png 1024w, https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.03-768x602.png 768w, https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.03-65x51.png 65w, https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.03-225x176.png 225w, https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.03-350x274.png 350w\" sizes=\"(max-width: 1118px) 100vw, 1118px\" \/><\/a><figcaption id=\"caption-attachment-102\" class=\"wp-caption-text\"><strong>Figure 4.3<\/strong> Class<\/figcaption><\/figure>\n<\/div>\n<p><em>Note.<\/em> Attributes are properties that are listed within a class box and the operations are methods. The + indicates a public method, &#8211; is private, and # is protected. The notation includes attribute types (e.g., int, Token, etc.), method parameters and return types, and default values for attributes.<\/p>\n<figure id=\"attachment_130\" aria-describedby=\"caption-attachment-130\" style=\"width: 1304px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/open.oregonstate.education\/app\/uploads\/sites\/174\/2023\/09\/Fig05.04.png\"><img decoding=\"async\" class=\"wp-image-37 size-full\" src=\"https:\/\/libraryresources.nse.org.ng\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.04.png\" alt=\"Two boxes, &quot;Class 1&quot; and &quot;Class 2,&quot; are linked by a horizonal line\" width=\"1304\" height=\"400\" srcset=\"https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.04.png 1304w, https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.04-300x92.png 300w, https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.04-1024x314.png 1024w, https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.04-768x236.png 768w, https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.04-65x20.png 65w, https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.04-225x69.png 225w, https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.04-350x107.png 350w\" sizes=\"(max-width: 1304px) 100vw, 1304px\" \/><\/a><figcaption id=\"caption-attachment-130\" class=\"wp-caption-text\"><strong>Figure 4.4<\/strong> Association<\/figcaption><\/figure>\n<p><em>Note. <\/em>Association means that a class contains a reference to an object(s) of the other class in the form of a property. In this example, we aren\u2019t told whether Class1 references Class2 or vice versa.<\/p>\n<figure id=\"attachment_103\" aria-describedby=\"caption-attachment-103\" style=\"width: 1304px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/open.oregonstate.education\/app\/uploads\/sites\/174\/2023\/09\/Fig05.05.png\"><img decoding=\"async\" class=\"wp-image-38 size-full\" src=\"https:\/\/libraryresources.nse.org.ng\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.05.png\" alt=\"A box, &quot;Class 1,&quot; is linked in one direction by an arrow to another box, &quot;Class 2&quot;\" width=\"1304\" height=\"400\" srcset=\"https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.05.png 1304w, https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.05-300x92.png 300w, https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.05-1024x314.png 1024w, https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.05-768x236.png 768w, https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.05-65x20.png 65w, https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.05-225x69.png 225w, https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.05-350x107.png 350w\" sizes=\"(max-width: 1304px) 100vw, 1304px\" \/><\/a><figcaption id=\"caption-attachment-103\" class=\"wp-caption-text\"><strong>Figure 4.5<\/strong>\u00a0Unidirectional Association<\/figcaption><\/figure>\n<p><em>Note. <\/em>The arrow indicates that Class1 <strong>has a<\/strong> Class2.<\/p>\n<figure id=\"attachment_104\" aria-describedby=\"caption-attachment-104\" style=\"width: 1768px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/open.oregonstate.education\/app\/uploads\/sites\/174\/2023\/09\/Fig05.06.png\"><img decoding=\"async\" class=\"wp-image-39 size-full\" src=\"https:\/\/libraryresources.nse.org.ng\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.06.png\" alt=\"Two linked boxes, &quot;Class 1&quot; and &quot;Class 2,\u201d have a property titled &quot;+instance1&quot;\" width=\"1768\" height=\"400\" srcset=\"https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.06.png 1768w, https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.06-300x68.png 300w, https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.06-1024x232.png 1024w, https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.06-768x174.png 768w, https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.06-1536x348.png 1536w, https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.06-65x15.png 65w, https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.06-225x51.png 225w, https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.06-350x79.png 350w\" sizes=\"(max-width: 1768px) 100vw, 1768px\" \/><\/a><figcaption id=\"caption-attachment-104\" class=\"wp-caption-text\"><strong>Figure 4.6\u00a0<\/strong>Unidirectional Association with Property Name<\/figcaption><\/figure>\n<p><em>Note.<\/em> Class1 has a property named instance1. It is an instance of Class2.<\/p>\n<figure id=\"attachment_105\" aria-describedby=\"caption-attachment-105\" style=\"width: 1768px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/open.oregonstate.education\/app\/uploads\/sites\/174\/2023\/09\/Fig05.07.png\"><img decoding=\"async\" class=\"wp-image-40 size-full\" src=\"https:\/\/libraryresources.nse.org.ng\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.07.png\" alt=\"Two linked boxes, &quot;Class 1&quot; and &quot;Class 2,&quot; have a property titled &quot;+instance1.&quot; Underneath the property is listed &quot;0..1&quot;\" width=\"1768\" height=\"400\" srcset=\"https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.07.png 1768w, https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.07-300x68.png 300w, https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.07-1024x232.png 1024w, https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.07-768x174.png 768w, https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.07-1536x348.png 1536w, https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.07-65x15.png 65w, https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.07-225x51.png 225w, https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.07-350x79.png 350w\" sizes=\"(max-width: 1768px) 100vw, 1768px\" \/><\/a><figcaption id=\"caption-attachment-105\" class=\"wp-caption-text\"><strong>Figure 4.7<\/strong> Unidirectional Association with Property Name and Target Multiplicity<\/figcaption><\/figure>\n<p><em>Note. <\/em>Class1 has a property named instance1 containing zero or one instances of Class2.<\/p>\n<figure id=\"attachment_89\" aria-describedby=\"caption-attachment-89\" style=\"width: 1768px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/open.oregonstate.education\/app\/uploads\/sites\/174\/2023\/09\/Fig05.08.png\"><img decoding=\"async\" class=\"wp-image-41 size-full\" src=\"https:\/\/libraryresources.nse.org.ng\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.08.png\" alt=\"Two linked boxes, &quot;Class 1&quot; and &quot;Class 2,&quot; have a property. Underneath the property is listed &quot;0..1.&quot; Next to box &quot;Class 1&quot; is an asterisk\" width=\"1768\" height=\"400\" srcset=\"https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.08.png 1768w, https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.08-300x68.png 300w, https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.08-1024x232.png 1024w, https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.08-768x174.png 768w, https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.08-1536x348.png 1536w, https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.08-65x15.png 65w, https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.08-225x51.png 225w, https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.08-350x79.png 350w\" sizes=\"(max-width: 1768px) 100vw, 1768px\" \/><\/a><figcaption id=\"caption-attachment-89\" class=\"wp-caption-text\"><strong>Figure 4.8<\/strong> Unidirectional Association with Property Name, Target Multiplicity, and Source Multiplicity<\/figcaption><\/figure>\n<p><em>Note. <\/em>Zero or more instances of Class1 have properties named instance1 containing zero or one instance of Class2.<\/p>\n<figure id=\"attachment_106\" aria-describedby=\"caption-attachment-106\" style=\"width: 1768px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/open.oregonstate.education\/app\/uploads\/sites\/174\/2023\/09\/Fig05.09.png\"><img decoding=\"async\" class=\"wp-image-42 size-full\" src=\"https:\/\/libraryresources.nse.org.ng\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.09.png\" alt=\"Two boxes, &quot;Class 1&quot; and &quot;Class 2,&quot; are linked by a bidirectional arrow. Next to box &quot;Class 1&quot; is &quot;1.&quot; Next to box &quot;Class 2&quot; is an asterisk\" width=\"1768\" height=\"400\" srcset=\"https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.09.png 1768w, https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.09-300x68.png 300w, https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.09-1024x232.png 1024w, https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.09-768x174.png 768w, https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.09-1536x348.png 1536w, https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.09-65x15.png 65w, https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.09-225x51.png 225w, https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.09-350x79.png 350w\" sizes=\"(max-width: 1768px) 100vw, 1768px\" \/><\/a><figcaption id=\"caption-attachment-106\" class=\"wp-caption-text\"><strong>Figure 4.9<\/strong>\u00a0Bidirectional Association and Target\/Source Multiplicity<\/figcaption><\/figure>\n<p><em>Note. <\/em>Class1 has zero or more instances of Class2. Class2 has exactly one instance of Class1.<\/p>\n<div class=\"largeimg\">\n<figure id=\"attachment_107\" aria-describedby=\"caption-attachment-107\" style=\"width: 526px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/open.oregonstate.education\/app\/uploads\/sites\/174\/2023\/09\/Fig05.10.png\"><img decoding=\"async\" class=\"wp-image-43 size-full\" src=\"https:\/\/libraryresources.nse.org.ng\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.10.png\" alt=\"Two boxes, &quot;Class 1&quot; and &quot;Class 2,&quot; are in a column. An arrow from &quot;Class 2&quot; points upwards to &quot;Class 1&quot;\" width=\"526\" height=\"930\" srcset=\"https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.10.png 526w, https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.10-170x300.png 170w, https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.10-65x115.png 65w, https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.10-225x398.png 225w, https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.10-350x619.png 350w\" sizes=\"(max-width: 526px) 100vw, 526px\" \/><\/a><figcaption id=\"caption-attachment-107\" class=\"wp-caption-text\"><strong>Figure 4.10<\/strong> Inheritance<\/figcaption><\/figure>\n<\/div>\n<p><em>Note. <\/em>Class2 is a subclass of Class1; Class2 <strong>is a <\/strong>Class1.<\/p>\n<h2>4.6.2 Real-World Class Diagram Examples<\/h2>\n<p>These PDFs contain class diagrams for actual software.<\/p>\n<ul>\n<li><a href=\"https:\/\/research-repository.griffith.edu.au\/bitstream\/handle\/10072\/401215\/Estivill-Castro165057-Published.pdf?sequence=2\"><em>EvoloPy: An open-source nature-inspired optimization framework in Python<\/em><\/a> (Faris et al., <span class=\"citation\">2016<\/span>).<\/li>\n<li><a href=\"https:\/\/www.mdpi.com\/2220-9964\/4\/4\/2219\/pdf\"><em>Processing: A Python framework for the seamless integration of geoprocessing tools in QGIS<\/em><\/a> (Graser &amp; Olaya, <span class=\"citation\">2015<\/span>).<\/li>\n<li><a href=\"https:\/\/citeseerx.ist.psu.edu\/document?repid=rep1&amp;type=pdf&amp;doi=cdb5e5d28a9bd6a04f969d6465110f875e706e71\"><em>Java-based graphical user interface for MRUI, a software package for quantitation of in vivo\/medical magnetic resonance spectroscopy signals<\/em><\/a> (Naressi et al., <span class=\"citation\">2001<\/span>).<\/li>\n<li><a href=\"https:\/\/arxiv.org\/pdf\/2111.11807.pdf\"><em>RepoMiner: A language-agnostic Python framework to mine software repositories for defect prediction<\/em> [PDF]<\/a> (Palma et al., <span class=\"citation\">2021<\/span>).<\/li>\n<li><a href=\"https:\/\/www.ars.usda.gov\/ARSUserFiles\/40820\/Thorp2022%20-%20pyfao56.pdf\"><em>pyfao56: FAO-56 evapotranspiration in<\/em> <em>Python<\/em> [PDF]<\/a> (Thorp, <span class=\"citation\">2022<\/span>).<\/li>\n<\/ul>\n<p>If any links are broken, try the <a href=\"https:\/\/web.archive.org\/\">Wayback Machine<\/a>.<\/p>\n<h1>4.7 Sequence Diagrams<\/h1>\n<div class=\"textbox textbox--sidebar\">When making any diagram, know your audience and what you\u2019re trying to communicate. If your audience is a human, they have limited capacity for absorbing tiny details (and probably limited time). Focus on showing them what\u2019s most important in a way they will understand.<\/div>\n<p>A sequence diagram describes interactions between objects. Usually, the diagram shows a single use case or scenario. Sequence diagrams are a type of interaction diagram and are not as good for showing object implementation details.<\/p>\n<p>This section provides an example sequence diagram and commonly used sequence diagram notation. For more detailed information, see Fowler (<span class=\"citation\">2004<\/span>).<\/p>\n<p>In Figure 4.11, the example sequence diagram represents interactions between instances of the Manager, Employee, and Order classes. Manager asks the Employee for a status update, Employee complies, Employee creates an Order, Manager asks Employee to close the shop, Employee closes the Order.<\/p>\n<p>In the example, the columns (called participants) are objects, but this is not always the case. For example, a participant can be a user. Users, if they are human, are sometimes represented as stick figures (without the box). Another possible non-object participant could be a database (although in some cases, a database is considered an object). What\u2019s most important when creating diagrams is not following the rules or conventions but communicating with your audience.<\/p>\n<figure id=\"attachment_108\" aria-describedby=\"caption-attachment-108\" style=\"width: 1110px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/open.oregonstate.education\/app\/uploads\/sites\/174\/2023\/09\/Fig05.11.png\"><img decoding=\"async\" class=\"wp-image-44 size-full\" src=\"https:\/\/libraryresources.nse.org.ng\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.11.png\" alt=\"An example of a Simple Sequence Diagram\" width=\"1110\" height=\"792\" srcset=\"https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.11.png 1110w, https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.11-300x214.png 300w, https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.11-1024x731.png 1024w, https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.11-768x548.png 768w, https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.11-65x46.png 65w, https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.11-225x161.png 225w, https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.11-350x250.png 350w\" sizes=\"(max-width: 1110px) 100vw, 1110px\" \/><\/a><figcaption id=\"caption-attachment-108\" class=\"wp-caption-text\"><strong>Figure 4.11<\/strong>\u00a0Simple Sequence Diagram<\/figcaption><\/figure>\n<h2>4.7.1 UML Sequence Diagram Notation<\/h2>\n<figure id=\"attachment_109\" aria-describedby=\"caption-attachment-109\" style=\"width: 726px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/open.oregonstate.education\/app\/uploads\/sites\/174\/2023\/09\/Fig05.12.png\"><img decoding=\"async\" class=\"wp-image-45 size-full\" src=\"https:\/\/libraryresources.nse.org.ng\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.12.png\" alt=\"Two rectangles, labelled &quot;a Manager&quot; and &quot;an Employee&quot; are side by side\" width=\"726\" height=\"364\" srcset=\"https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.12.png 726w, https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.12-300x150.png 300w, https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.12-65x33.png 65w, https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.12-225x113.png 225w, https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.12-350x175.png 350w\" sizes=\"(max-width: 726px) 100vw, 726px\" \/><\/a><figcaption id=\"caption-attachment-109\" class=\"wp-caption-text\"><strong>Figure 4.12<\/strong>\u00a0Participant<\/figcaption><\/figure>\n<p><em>Note.<\/em> The \u201ccolumns\u201d of a sequence diagram are each participants. Participants are often objects. The name of the participant goes in the box.<\/p>\n<figure id=\"attachment_110\" aria-describedby=\"caption-attachment-110\" style=\"width: 706px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/open.oregonstate.education\/app\/uploads\/sites\/174\/2023\/09\/Fig05.13.png\"><img decoding=\"async\" class=\"wp-image-46 size-full\" src=\"https:\/\/libraryresources.nse.org.ng\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.13.png\" alt=\"Two boxes, side by side, with a dashed vertical line from the bottom of each box\" width=\"706\" height=\"452\" srcset=\"https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.13.png 706w, https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.13-300x192.png 300w, https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.13-65x42.png 65w, https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.13-225x144.png 225w, https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.13-350x224.png 350w\" sizes=\"(max-width: 706px) 100vw, 706px\" \/><\/a><figcaption id=\"caption-attachment-110\" class=\"wp-caption-text\"><strong>Figure 4.13<\/strong>\u00a0Lifeline<\/figcaption><\/figure>\n<p><em>Note.<\/em> Vertical dashed line represents the life span of the participant. Top is beginning of life, and bottom is the end. Life ends when the participant is deleted.<\/p>\n<figure id=\"attachment_111\" aria-describedby=\"caption-attachment-111\" style=\"width: 706px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/open.oregonstate.education\/app\/uploads\/sites\/174\/2023\/09\/Fig05.14.png\"><img decoding=\"async\" class=\"wp-image-47 size-full\" src=\"https:\/\/libraryresources.nse.org.ng\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.14.png\" alt=\"Two boxes, side by side, with a dashed vertical line from the bottom of each. An arrow, &quot;getStatus(),&quot; runs between the lines\" width=\"706\" height=\"452\" srcset=\"https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.14.png 706w, https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.14-300x192.png 300w, https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.14-65x42.png 65w, https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.14-225x144.png 225w, https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.14-350x224.png 350w\" sizes=\"(max-width: 706px) 100vw, 706px\" \/><\/a><figcaption id=\"caption-attachment-111\" class=\"wp-caption-text\"><strong>Figure 4.14\u00a0<\/strong>Message<\/figcaption><\/figure>\n<p><em>Note.<\/em> Interaction from one participant to another is shown by the solid line with arrow. Often a method call.<\/p>\n<figure id=\"attachment_90\" aria-describedby=\"caption-attachment-90\" style=\"width: 706px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/open.oregonstate.education\/app\/uploads\/sites\/174\/2023\/09\/Fig05.15.png\"><img decoding=\"async\" class=\"wp-image-48 size-full\" src=\"https:\/\/libraryresources.nse.org.ng\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.15.png\" alt=\"Two boxes, side by side, with a dashed vertical line from the bottom of each. An arrow, &quot;getStatus(),&quot; runs between the lines. There is a box on each line\" width=\"706\" height=\"452\" srcset=\"https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.15.png 706w, https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.15-300x192.png 300w, https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.15-65x42.png 65w, https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.15-225x144.png 225w, https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.15-350x224.png 350w\" sizes=\"(max-width: 706px) 100vw, 706px\" \/><\/a><figcaption id=\"caption-attachment-90\" class=\"wp-caption-text\"><strong>Figure 4.15<\/strong> Activation Bar<\/figcaption><\/figure>\n<p><em>Note. <\/em>Box on lifeline indicates when the participant is active. Indicates method is on call stack.<\/p>\n<figure id=\"attachment_112\" aria-describedby=\"caption-attachment-112\" style=\"width: 706px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/open.oregonstate.education\/app\/uploads\/sites\/174\/2023\/09\/Fig05.16.png\"><img decoding=\"async\" class=\"wp-image-49 size-full\" src=\"https:\/\/libraryresources.nse.org.ng\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.16.png\" alt=\"Two boxes with a dashed vertical line from the bottom of each. An arrow, &quot;getStatus(),&quot; runs between the lines. Another arrow, \u201cstatus,\u201d points in the opposite direction\" width=\"706\" height=\"452\" srcset=\"https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.16.png 706w, https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.16-300x192.png 300w, https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.16-65x42.png 65w, https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.16-225x144.png 225w, https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.16-350x224.png 350w\" sizes=\"(max-width: 706px) 100vw, 706px\" \/><\/a><figcaption id=\"caption-attachment-112\" class=\"wp-caption-text\"><strong>Figure 4.16<\/strong>\u00a0Return<\/figcaption><\/figure>\n<p><em>Note. <\/em>Dashed line with arrow indicates method return. Use only when it helps communicate something important about the interaction.<\/p>\n<figure id=\"attachment_113\" aria-describedby=\"caption-attachment-113\" style=\"width: 706px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/open.oregonstate.education\/app\/uploads\/sites\/174\/2023\/09\/Fig05.17.png\"><img decoding=\"async\" class=\"wp-image-50 size-full\" src=\"https:\/\/libraryresources.nse.org.ng\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.17.png\" alt=\"Two boxes with a dashed vertical line from the bottom of each. An arrow, &quot;sumOfChildren(),&quot; runs from one line and loops back to the same line\" width=\"706\" height=\"506\" srcset=\"https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.17.png 706w, https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.17-300x215.png 300w, https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.17-65x47.png 65w, https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.17-225x161.png 225w, https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.17-350x251.png 350w\" sizes=\"(max-width: 706px) 100vw, 706px\" \/><\/a><figcaption id=\"caption-attachment-113\" class=\"wp-caption-text\"><strong>Figure 4.17<\/strong>\u00a0Self-Call<\/figcaption><\/figure>\n<p><em>Note. <\/em>Method calling self. Solid line with arrow points back to participant\u2019s own lifeline.<\/p>\n<figure id=\"attachment_114\" aria-describedby=\"caption-attachment-114\" style=\"width: 726px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/open.oregonstate.education\/app\/uploads\/sites\/174\/2023\/09\/Fig05.18.png\"><img decoding=\"async\" class=\"wp-image-51 size-full\" src=\"https:\/\/libraryresources.nse.org.ng\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.18.png\" alt=\"Two boxes with a dashed vertical line from the bottom of each. An arrow runs from the left line to the right. The line on the right terminates with an &quot;X&quot;\" width=\"726\" height=\"510\" srcset=\"https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.18.png 726w, https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.18-300x211.png 300w, https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.18-65x46.png 65w, https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.18-225x158.png 225w, https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-content\/uploads\/sites\/16\/2026\/03\/Fig05.18-350x246.png 350w\" sizes=\"(max-width: 726px) 100vw, 726px\" \/><\/a><figcaption id=\"caption-attachment-114\" class=\"wp-caption-text\"><strong>Figure 4.18<\/strong>\u00a0Deletion<\/figcaption><\/figure>\n<p><em>Note. <\/em>End of participant\u2019s life. Indicated by an X on the lifeline.<\/p>\n<h2>4.7.2 Real-World Sequence Diagram Examples<\/h2>\n<p>These PDFs contain sequence diagrams for actual software.<\/p>\n<ul>\n<li><a href=\"https:\/\/ricerca.uniba.it\/bitstream\/11586\/256332\/9\/PID5822281-PrePrint%28con-DOI%29.pdf\"><em>Py4JFML: A Python wrapper for using the IEEE Std 1855-2016 through JFML<\/em> [PDF]<\/a> (Alcal\u00e1-Fdez et al., <span class=\"citation\">2019<\/span>).<\/li>\n<li><a href=\"https:\/\/www.sciencedirect.com\/science\/article\/pii\/S2352711019300950\"><em>COFFEE\u2014An MPI-parallelized Python package for the numerical evolution of differential equations<\/em><\/a> (Doulis et al., <span class=\"citation\">2019<\/span>).<\/li>\n<li><a href=\"https:\/\/openresearchsoftware.metajnl.com\/articles\/10.5334\/jors.163\"><em>Teetool\u2014A probabilistic trajectory analysis tool<\/em><\/a> (Eerland et al., <span class=\"citation\">2017<\/span>).<\/li>\n<li><a href=\"https:\/\/hal.science\/hal-02335530\/file\/DTIS19188.1570026732_preprint.pdf\"><em>GEMS: A Python library for automation of multidisciplinary design optimization process generation<\/em> [PDF]<\/a> (Gallard et al., <span class=\"citation\">2018<\/span>).<\/li>\n<\/ul>\n<p>If any links are broken, try the <a href=\"https:\/\/web.archive.org\/\">Wayback Machine<\/a>.<\/p>\n<h1>4.8 Summary<\/h1>\n<p>UML diagrams can be helpful for communicating how your code works. Class diagrams and sequence diagrams are two commonly used types of UML diagrams. Each type of diagram emphasizes some part of the code design while leaving out other parts. UML diagrams are for communicating with humans\u2014not computers.<\/p>\n<h1>References<\/h1>\n<p class=\"hanging-indent\">Alcal\u00e1-Fdez, J., Alonso, J. M., Castiello, C., Mencar, C., &amp; Soto-Hidalgo, J. M. (2019, June). <em>Py4JFML: A Python wrapper for using the IEEE Std 1855-2016 through JFML<\/em>. Paper presented at the 2019 IEEE International Conference on Fuzzy Systems (FUZZ-IEEE), New Orleans, LA, USA. <a href=\"https:\/\/ricerca.uniba.it\/bitstream\/11586\/256332\/9\/PID5822281-PrePrint%28con-DOI%29.pdf\">https:\/\/ricerca.uniba.it\/bitstream\/11586\/256332\/9\/PID5822281-PrePrint%28con-DOI%29.pdf<\/a><\/p>\n<p class=\"hanging-indent\">Doulis, G., Frauendiener, J., Stevens, C., &amp; Whale, B. (2019). COFFEE\u2014An MPI-parallelized Python package for the numerical evolution of differential equations. <em>SoftwareX<\/em>, 10, 100283. <a href=\"https:\/\/www.sciencedirect.com\/science\/article\/pii\/S2352711019300950\">https:\/\/www.sciencedirect.com\/science\/article\/pii\/S2352711019300950<\/a><\/p>\n<p class=\"hanging-indent\">Eerland, W., Box, S., Fangohr, H., &amp; S\u00f3bester, A. (2017). Teetool\u2014A probabilistic trajectory analysis tool. <em>Journal of Open Research Software<\/em>, <em>5<\/em>(1). <a href=\"https:\/\/openresearchsoftware.metajnl.com\/articles\/10.5334\/jors.163\">https:\/\/openresearchsoftware.metajnl.com\/articles\/10.5334\/jors.163<\/a><\/p>\n<p class=\"hanging-indent\">Faris, H., Aljarah, I., Mirjalili, S., Castillo, P. A., &amp; Guerv\u00f3s, J. J. M. (2016). EvoloPy: An open-source nature-inspired optimization framework in python. In <em>Proceedings of the 8th International Joint Conference on Computational Intelligence (IJCCI): Evolutional Computational Theory and Applications (ECTA), 1<\/em>, 171-177. <a href=\"https:\/\/research-repository.griffith.edu.au\/bitstream\/handle\/10072\/401215\/Estivill-Castro165057-Published.pdf?sequence=2\">https:\/\/research-repository.griffith.edu.au\/bitstream\/handle\/10072\/401215\/Estivill-Castro165057-Published.pdf?sequence=2<\/a><\/p>\n<p class=\"hanging-indent\">Fowler, M. (2004). <em>UML distilled: A brief guide to the standard object modeling language<\/em>. Addison-Wesley Professional.<\/p>\n<p class=\"hanging-indent\">Gallard, F., Vanaret, C., Gu\u00e9not, D., Gachelin, V., Lafage, R., Pauwels, B., Barjhoux, P.-J., &amp; Gazaix, A. (2018). <em>GEMS: A Python library for automation of multidisciplinary design optimization process generation<\/em>. Paper presented at the 2018 AIAA\/ASCE\/AHS\/ASC Structures, Structural Dynamics, and Materials Conference, Kissimmee, FL, USA.. <a href=\"https:\/\/hal.science\/hal-02335530\/file\/DTIS19188.1570026732_preprint.pdf\">https:\/\/hal.science\/hal-02335530\/file\/DTIS19188.1570026732_preprint.pdf<\/a><\/p>\n<p class=\"hanging-indent\">Graser, A., &amp; Olaya, V. (2015). Processing: A python framework for the seamless integration of geoprocessing tools in QGIS. <em>ISPRS International Journal of Geo-Information<\/em>, <em>4<\/em>(4), 2219-2245. <a href=\"https:\/\/www.mdpi.com\/2220-9964\/4\/4\/2219\/pdf\">https:\/\/www.mdpi.com\/2220-9964\/4\/4\/2219\/pdf<\/a><\/p>\n<p class=\"hanging-indent\">Naressi, A., Couturier, C., Castang, I., De Beer, R., &amp; Graveron-Demilly, D. (2001). Java-based graphical user interface for MRUI, a software package for quantitation of in vivo\/medical magnetic resonance spectroscopy signals. <em>Computers in Biology and Medicine<\/em>, <em>31<\/em>(4), 269-286. <a href=\"https:\/\/citeseerx.ist.psu.edu\/document?repid=rep1&amp;type=pdf&amp;doi=cdb5e5d28a9bd6a04f969d6465110f875e706e71\">https:\/\/citeseerx.ist.psu.edu\/document?repid=rep1&amp;type=pdf&amp;doi=cdb5e5d28a9bd6a04f969d6465110f875e706e71<\/a><\/p>\n<p class=\"hanging-indent\">Palma, S. D., Di Nucci, D., &amp; Tamburri, D. (2021). RepoMiner: A language-agnostic Python framework to mine software repositories for defect prediction. <em>arXiv preprint arXiv:2111.11807<\/em>. <a href=\"https:\/\/arxiv.org\/pdf\/2111.11807.pdf\">https:\/\/arxiv.org\/pdf\/2111.11807.pdf<\/a><\/p>\n<p class=\"hanging-indent\">Thorp, K. R. (2022). pyfao56: FAO-56 evapotranspiration in Python. <em>SoftwareX<\/em>, <em>19<\/em>, 101208. <a href=\"https:\/\/www.ars.usda.gov\/ARSUserFiles\/40820\/Thorp2022%20-%20pyfao56.pdf\">https:\/\/www.ars.usda.gov\/ARSUserFiles\/40820\/Thorp2022%20-%20pyfao56.pdf<\/a><\/p>\n<div class=\"glossary\"><span class=\"screen-reader-text\" id=\"definition\">definition<\/span><template id=\"term_52_672\"><div class=\"glossary__definition\" role=\"dialog\" data-id=\"term_52_672\"><div tabindex=\"-1\"><\/div><button><span aria-hidden=\"true\">&times;<\/span><span class=\"screen-reader-text\">Close definition<\/span><\/button><\/div><\/template><template id=\"term_52_860\"><div class=\"glossary__definition\" role=\"dialog\" data-id=\"term_52_860\"><div tabindex=\"-1\"><\/div><button><span aria-hidden=\"true\">&times;<\/span><span class=\"screen-reader-text\">Close definition<\/span><\/button><\/div><\/template><template id=\"term_52_861\"><div class=\"glossary__definition\" role=\"dialog\" data-id=\"term_52_861\"><div tabindex=\"-1\"><\/div><button><span aria-hidden=\"true\">&times;<\/span><span class=\"screen-reader-text\">Close definition<\/span><\/button><\/div><\/template><template id=\"term_52_862\"><div class=\"glossary__definition\" role=\"dialog\" data-id=\"term_52_862\"><div tabindex=\"-1\"><\/div><button><span aria-hidden=\"true\">&times;<\/span><span class=\"screen-reader-text\">Close definition<\/span><\/button><\/div><\/template><template id=\"term_52_671\"><div class=\"glossary__definition\" role=\"dialog\" data-id=\"term_52_671\"><div tabindex=\"-1\"><\/div><button><span aria-hidden=\"true\">&times;<\/span><span class=\"screen-reader-text\">Close definition<\/span><\/button><\/div><\/template><template id=\"term_52_670\"><div class=\"glossary__definition\" role=\"dialog\" data-id=\"term_52_670\"><div tabindex=\"-1\"><\/div><button><span aria-hidden=\"true\">&times;<\/span><span class=\"screen-reader-text\">Close definition<\/span><\/button><\/div><\/template><template id=\"term_52_673\"><div class=\"glossary__definition\" role=\"dialog\" data-id=\"term_52_673\"><div tabindex=\"-1\"><\/div><button><span aria-hidden=\"true\">&times;<\/span><span class=\"screen-reader-text\">Close definition<\/span><\/button><\/div><\/template><template id=\"term_52_674\"><div class=\"glossary__definition\" role=\"dialog\" data-id=\"term_52_674\"><div tabindex=\"-1\"><\/div><button><span aria-hidden=\"true\">&times;<\/span><span class=\"screen-reader-text\">Close definition<\/span><\/button><\/div><\/template><template id=\"term_52_675\"><div class=\"glossary__definition\" role=\"dialog\" data-id=\"term_52_675\"><div tabindex=\"-1\"><\/div><button><span aria-hidden=\"true\">&times;<\/span><span class=\"screen-reader-text\">Close definition<\/span><\/button><\/div><\/template><template id=\"term_52_863\"><div class=\"glossary__definition\" role=\"dialog\" data-id=\"term_52_863\"><div tabindex=\"-1\"><\/div><button><span aria-hidden=\"true\">&times;<\/span><span class=\"screen-reader-text\">Close definition<\/span><\/button><\/div><\/template><template id=\"term_52_864\"><div class=\"glossary__definition\" role=\"dialog\" data-id=\"term_52_864\"><div tabindex=\"-1\"><\/div><button><span aria-hidden=\"true\">&times;<\/span><span class=\"screen-reader-text\">Close definition<\/span><\/button><\/div><\/template><template id=\"term_52_666\"><div class=\"glossary__definition\" role=\"dialog\" data-id=\"term_52_666\"><div tabindex=\"-1\"><\/div><button><span aria-hidden=\"true\">&times;<\/span><span class=\"screen-reader-text\">Close definition<\/span><\/button><\/div><\/template><template id=\"term_52_667\"><div class=\"glossary__definition\" role=\"dialog\" data-id=\"term_52_667\"><div tabindex=\"-1\"><\/div><button><span aria-hidden=\"true\">&times;<\/span><span class=\"screen-reader-text\">Close definition<\/span><\/button><\/div><\/template><template id=\"term_52_668\"><div class=\"glossary__definition\" role=\"dialog\" data-id=\"term_52_668\"><div tabindex=\"-1\"><\/div><button><span aria-hidden=\"true\">&times;<\/span><span class=\"screen-reader-text\">Close definition<\/span><\/button><\/div><\/template><template id=\"term_52_669\"><div class=\"glossary__definition\" role=\"dialog\" data-id=\"term_52_669\"><div tabindex=\"-1\"><\/div><button><span aria-hidden=\"true\">&times;<\/span><span class=\"screen-reader-text\">Close definition<\/span><\/button><\/div><\/template><\/div>","protected":false},"author":1,"menu_order":4,"template":"","meta":{"pb_show_title":"","pb_short_title":"Unified Modeling Language","pb_subtitle":"","pb_authors":[],"pb_section_license":""},"chapter-type":[48],"contributor":[],"license":[],"class_list":["post-52","chapter","type-chapter","status-publish","hentry","chapter-type-standard"],"part":19,"_links":{"self":[{"href":"https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-json\/pressbooks\/v2\/chapters\/52","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-json\/pressbooks\/v2\/chapters"}],"about":[{"href":"https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-json\/wp\/v2\/types\/chapter"}],"author":[{"embeddable":true,"href":"https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-json\/wp\/v2\/users\/1"}],"version-history":[{"count":1,"href":"https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-json\/pressbooks\/v2\/chapters\/52\/revisions"}],"predecessor-version":[{"id":53,"href":"https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-json\/pressbooks\/v2\/chapters\/52\/revisions\/53"}],"part":[{"href":"https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-json\/pressbooks\/v2\/parts\/19"}],"metadata":[{"href":"https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-json\/pressbooks\/v2\/chapters\/52\/metadata\/"}],"wp:attachment":[{"href":"https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-json\/wp\/v2\/media?parent=52"}],"wp:term":[{"taxonomy":"chapter-type","embeddable":true,"href":"https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-json\/pressbooks\/v2\/chapter-type?post=52"},{"taxonomy":"contributor","embeddable":true,"href":"https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-json\/wp\/v2\/contributor?post=52"},{"taxonomy":"license","embeddable":true,"href":"https:\/\/libraryresources.nse.org.ng\/setextbook\/wp-json\/wp\/v2\/license?post=52"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}