Introduction to UML, Visual Modeling with UML, UML class diagram, UML class diagrams of the one diagram most used in Learn Quest courses. In fact, over many, many years of teaching classes for many companies, including internally at IBM, they're by far the most commonly used that I've encountered. The only other one that has come up with any regularity outside, of course, is on El itself or sequence diagrams as a reminder. This is an ontological hierarchy of UML diagrams. Now let's look more deeply at the class diagram. From a programmers perspective, we're looking for a complete and detailed class diagram. Other UML diagrams connect to the class diagram, either informing its content or drawing from it. The class diagram documents relationships between this class and its collaborators, and therefore relationships between their instances at runtime. Class diagram isn't about just one glass. It shows a class, and it's relationships to other classes and their relationships, and so on. The overall class diagram for a system will link many, many class diagrams together. Classes have associations. Associations are shown on a class diagram via a line connecting classes. Different types of associations such as inheritance, aggregation and composition will be indicated by adornments on those lines. Here is an example. We've Class A and Class B. They haven't association. That association has a name. Each class has a specific role within that association, for example, employee and manager. And finally, the association has a multiplicity. For example, an employee has one manager, but a manager might have zero arm or employees to recap here. The types of adornments, several of which we just saw the association name describing the association an arrow indicating the direction of the association, for example, inheritance who have an arrow pointing to the parent. The default is no arrowhead and means bi directional role, which we just covered when talking about the example a reverse flow arrow which is not commonly needed. Multiplicity, which can be a very important concept of which programs need to be aware when goading the default Multiplicity is one, meaning that there must be one and Onley one. Here's some additional examples of multiplicity. Putting a number such as to means that there must be exactly that number. Putting a range means that any number within that range is acceptable. The range zero dot dot one, which we would read a 0 to 1 means that there can be at most one, but it is optional optional because it could be zero. An asterisk means zero or more, so it is optional, but there could be many to make it mandatory. And many we would say one dot dot asterisk ranges don't have to begin with zero and or end with an asterisk. 2 to 4 right to dot dot for 2 to 4 is acceptable as air dis joint ranges, such as the one shown here 224 and six. We've previously discussed the aggregation relationship, but how do we show in, El Aggregation is the has a relationship. An employee has a project. It is more specific than general association. Remember, aggregation means that the two objects Aaron A. Has a relationship, but that destroying the owning object does not mean that the owned object must also be destroyed graphically. In el, we represent aggregation by adorning the owning objects end of the association line with Hollow Diamond. Remember that composition is aggregation, but with a change to the life cycle. Destroying the owning object does mean that the owned object also must be destroyed graphically. In el, we represent composition by adorning the owning objects. End of the association line with a solid diamond. Here is an example of both. Employee is in a composition relationship with address using the name resides at, and this is a 1 to 1 association. There is no other Multiplicity listed employees is also in an aggregation relationship with Project. This is a one to many relationship, and there must always be a project. These are important concepts. Programmers, database designers, D B, A S and managers will all act based on what is described here and here. Mawr Examples of aggregation. Mailman has one route. A route has zero or more houses and destroying the route has no effect on the houses. Word processor has one or more fonts. Removing the word processor also requires removing all of the fonts. A space vehicle known as a mother ship has a composition with to toe eight other space vehicles known as escape pods. Mind you, the idea that destroying the mothership means destroying the escape pods. It seems to defeat their purpose. Finally, an automobile has exactly four wheels which have an independent existence just in case the car is totaled. Inheritance is also a form of association one where the subclass inherits all of the characteristics of the parent glass. This is a tight bond, a tight form of association. We've already seen, als notation for this and discussed it. The open arrowhead points to the parent class here arm or examples showing inheritance in, el All of these things can be combined on a single class diagram. Here we see eight classes, but not all of which are represented in great detail. We see association, we see multiplicity, we see composition, we see inheritance. But the Onley class that has fleshed out in any detail in this diagram is account which has private data called balance and a public method called apply interest. Depending on Ruml tooling, we might need to link to other class diagrams for the other classes to see their details. And with this, we have concluded our coverage of the UML class diagram and our brief introduction to El