In software program engineering, a class diagram in the unified Modeling Language (UML) is a type of static structure diagram that defines the framework of a mechanism by showing the system"s classes, their attributes, to work (or methods), and also the relationships amongst objects.

You are watching: A(n) ____ in a class diagram indicates public access.


Are you looking for a complimentary UML tool for discovering UML faster, easier and quicker? intuitive Paradigm ar Edition is a UML software program that supports every UML diagram types. It is an international award-winning UML modeler, and yet it is easy-to-use, intuitive & totally free.

Free Download
Shows static structure of classifiers in a systemDiagram provides a an easy notation for other structure diagrams prescribed through UMLHelpful for developers and other team members tooBusiness analysts can use course diagrams to version systems indigenous a organization perspective

A UML course diagram is made up of:

A collection of great andA set of relationships in between classes

What is a Class

A description of a team of objects all with comparable roles in the system, which consists of:

Structural features (attributes) specify what objects that the course "know"Represent the state of things of the classAre explanation of the structure or static features of a classBehavioral features (operations) define what objects of the class "can do"Define the means in which objects may interactOperations space descriptions of behavioral or dynamic functions of a class

Class Notation

A course notation is composed of three parts:

Class NameThe name of the class shows up in the an initial partition.Class AttributesAttributes are displayed in the second partition.The attribute kind is presented after the colon.Attributes map ~ above member variables (data members) in code.Class Operations (Methods)Operations are shown in the 3rd partition. Lock are services the course provides.The return form of a method is displayed after the colon at the finish of the technique signature.The return type of method parameters is presented after the colon adhering to the parameter name.Operations map onto course methods in code

The graphical depiction of the class - MyClass as displayed above:

MyClass has actually 3 attributes and also 3 operationsParameter p3 that op2 is of type intop2 return a floatop3 returns a guideline (denoted by a *) come Class6

Class Relationships

A course may be associated in one or an ext relationships with other classes. A relationship have the right to be one of the following types: (Refer to the figure on the appropriate for the graphical depiction of relationships).

Relationship TypeGraphical Representation

Inheritance (or Generalization):

Represents an "is-a" relationship.An abstract course name is presented in italics.SubClass1 and SubClass2 room specializations of super Class.A hard line through a hole arrowhead that allude from the son to the parent class

Simple Association:

A structural link in between two peer classes.There is one association between Class1 and also Class2A solid line connecting two classes


A special kind of association. It to represent a "part of" relationship.

Class2 is component of Class1.Many instances (denoted through the *) the Class2 deserve to be associated with Class1.Objects that Class1 and also Class2 have actually separate lifetimes.A heavy line through an unfilled diamond in ~ the association end connected to the class of composite


A special form of aggregation where parts are destroyed when the entirety is destroyed.

Objects that Class2 live and also die v Class1.Class2 cannot stand by itself.A heavy line through a fill diamond at the association connected to the course of composite


Exists between two great if the alters to the definition of one may cause changes to the various other (but not the other means around).Class1 depends on Class2A dashed line v an open up arrow

Names the relationships are written in the middle of the combination line.Good relationship names make sense as soon as you read them the end loud:"Every spreadsheet contains some number of cells","an expression evaluates to a value"They regularly have a small arrowhead to show the direction in i m sorry direction to read the relationship, e.g., expressions advice to values, but values do not evaluate to expressions.

Relationship - Roles

A role is a directional purpose of an association.Roles room written in ~ the end of an combination line and also describe the objective played by that class in the relationship.E.g., A cell is related to an expression. The nature of the partnership is that the expression is the formula the the cell.


The arrows show whether, given one circumstances participating in a relationship, it is feasible to identify the instances the the other course that are pertained to it.

The diagram above suggests that,

Given a spreadsheet, we can locate all of the cells that it contains, yet thatwe cannot identify from a cabinet in what spreadsheet the is contained.Given a cell, we can obtain the associated expression and also value, butgiven a value (or expression) us cannot find the cabinet of i m sorry those are attributes.

Visibility of course attributes and also Operations

In object-oriented design, there is a notation of visibility because that attributes and also operations. UML identifies four types of visibility: public, protected, private, and package.

The +, -, # and also ~ symbols before an attribute and operation surname in a class denote the visibility the the attribute and also operation.

+ denotes public attributes or operations- denotes private features or operations# denotes protected characteristics or operations~ denotes package qualities or operations

Class Visibility Example

In the instance above:

attribute1 and op1 that MyClassName space publicattribute3 and also op3 room protected.attribute2 and op2 space private.

Access because that each of these visibility varieties is shown listed below for members of different classes.

Access Rightpublic (+)private (-)protected (#)Package (~)
Members that the very same classyesyesyesyes
Members of derived classesyesnoyesyes
Members of any other classyesnonoin exact same package


How many objects that each course take part in the relationships and multiplicity deserve to be express as:

Exactly one - 1Zero or one - 0..1Many - 0..* or *One or more - 1..*Exact Number - e.g. 3..4 or 6Or a complicated relationship - e.g. 0..1, 3..4, 6.* would mean any number of objects various other than 2 or 5

Multiplicity Example

Requirement: A Student have the right to take many Courses and many Students deserve to be enrolled in one Course.In the instance below, the class diagram (on the left), explains the explain of the requirement over for the static design while the object diagram (on the right) shows the photo (an instance of the class diagram) the the food enrollment for the courses software Engineering and also Database monitoring respectively)

Aggregation example - Computer and also parts

An aggregation is a special case of combination denoting a "consists-of" hierarchyThe accumulation is the parental class, the components are the kids classes

Inheritance instance - cabinet Taxonomy

Inheritance is another special instance of an association denoting a "kind-of" hierarchyInheritance simplifies the evaluation model by introducing a taxonomyThe child classes inherit the attributes and also operations of the parental class.

Class diagram - Diagram tool Example

A course diagram may also have note attached come classes or relationships. Notes are shown in grey.


In the example above:

We have the right to interpret the definition of the over class diagram by analysis through the points as following.

Shape is an summary class. That is presented in Italics.Shape is a superclass. Circle, Rectangle and Polygon are derived from Shape. In other words, a one is-a Shape. This is a generalization / inheritance relationship.There is one association in between DialogBox and DataController.Shape is part-of Window. This is an aggregation relationship. Shape deserve to exist without Window.Point is part-of Circle. This is a composition relationship. Suggest cannot exist without a Circle.Window is dependent on Event. However, event is not dependent ~ above Window.The features of Circle are radius and also center. This is an reality class.The technique names the Circle room area(), circum(), setCenter() and setRadius().The parameter radius in one is an in parameter of kind float.The technique area() of class Circle return a worth of form double.The attributes and method names that Rectangle space hidden. Some various other classes in the diagram also have their attributes and technique names hidden.

Dealing with facility System - multiple or single Class Diagram?

Inevitably, if you space modeling a big system or a big business area, there will certainly be countless entities you have to consider. Must we use multiple or a solitary class diagram because that modeling the problem? The price is:

Instead the modeling every entity and its relationship on a solitary class diagram, that is better to usage multiple course diagrams.Dividing a system right into multiple course diagrams makes the system simpler to understand, specifically if each diagram is a graphical representation of a specific component of the system.

Perspectives of course Diagram in Software development Lifecycle

We can use course diagrams in different development phases that a software advance lifecycle and also typically by modeling class diagrams in three different perspectives (levels that detail) increasingly as we relocate forward:

Conceptual perspective: The diagrams are construed as describing points in the genuine world. Thus, if you take the theoretical perspective you attract a diagram the represents the principles in the domain under study. These concepts will naturally relate to the classes that implement them. The conceptual perspective is considered language-independent.

Specification perspective: The diagrams are construed as describing software abstractions or materials with specifications and interfaces but with no commitment come a certain implementation. Thus, if you take the specification perspective we space looking at the interfaces that the software, not the implementation.

Implementation perspective: The diagrams are taken as describing software application implementations in a details technology and also language. Thus, if you take it the implementation view we room looking at the software program implementation.

See more: What Does Rrg Stand For In Texting? 2 Meanings Of Rrg What Does Rrg Mean

You"ve learned what a class Diagram is and how to attract a course Diagram. It"s time to attract a class Diagram of your own. Acquire Visual Paradigm ar Edition, a totally free UML software, and create your own class Diagram v the totally free Class diagram tool. It"s easy-to-use and intuitive.