You get a bonus - 1 coin for daily activity. Now you have 1 coin

Introduction to UML

Lecture



Principles of modeling

UML is based on the following general modeling principles:

  • abstraction - the model should include only those elements of the designed system that are directly related to the performance of its functions or its intended purpose. Other elements are omitted in order not to complicate the process of analyzing and researching the model;
  • multi -model - no single model can describe various aspects of the system with a sufficient degree of accuracy. It is allowed to describe the system by a number of interrelated representations, each of which reflects a certain aspect of its behavior or structure;
  • hierarchical construction - when describing a system, different levels of abstraction and detailing are used within fixed representations. In this case, the first representation of the system describes it in the most general terms and is a representation of the conceptual level, and the subsequent levels reveal various aspects of the system with an increasing degree of detailing down to the physical level. The model of the physical layer in the UML language reflects the component composition of the designed system in terms of its implementation on hardware and software platforms of specific manufacturers.

Entities in UML

UML defines four types of entities: structural , behavioral , grouping, and annotation . Entities are the main object-oriented elements of the language with which models are created.

Structural entities are nouns in UML models. As a rule, they represent the static parts of the model corresponding to the conceptual or physical elements of the system. Examples of structural entities are “class”, “interface”, “cooperation”, “precedent”, “component”, “node”, “actor”.

Behavioral entities are dynamic components of the UML model. These are verbs that describe the behavior of the model in time and in space. There are two main types of behavioral entities:

  • interaction - this behavior, the essence of which lies in the exchange of messages between objects within a specific context to achieve a specific goal;
  • automaton - an algorithm of behavior that determines the sequence of states through which an object or interaction passes in response to various events.

Grouping entities are organizing parts of the UML model. These are the blocks into which the model can be expanded. This primary entity is in a single copy - this is a package.

Packages are a universal mechanism for organizing elements into groups. Structural, behavioral, and other grouping entities can be placed in the package. In contrast to the components that actually exist during the operation of the program, the packages are purely conceptual in nature, that is, they exist only during the development process.

Annotation entities are explanatory parts of the UML model: comments for additional description, clarification, or comment to any element of the model. There is only one basic type of annotation elements - a note. A note is used to provide charts with comments or restrictions expressed in informal or formal text.

Relationships in UML

The following types of relationships are defined in UML: dependency , association , generalization, and implementation . These relationships are the main linking structures of UML and are also used as entities for building models.

Dependency (dependency) is a semantic relationship between two entities, in which a change in one of them, independent, can affect the semantics of the other, dependent.

Association (association) - the structural relation describing set of semantic or logical communications between objects.

Generalization is a relationship in which an object of a specialized element (descendant) can be substituted for an object of a generalized element (ancestor). In this case, in accordance with the principles of object-oriented programming, the descendant (child) inherits the structure and behavior of its ancestor (parent).

Implementation (realization) is a semantic relationship between classifiers, in which one classifier defines an obligation, and the other guarantees its fulfillment. Attitude realization occurs in two cases:

  • between interfaces and the classes or components that implement them;
  • between precedents and cooperative implementations.

  Common UML mechanisms

For an exact description of the system in UML, so-called general mechanisms are used :

  • specifications (specifications);
  • additions (adornments);
  • divisions (common divisions);
  • extensions (extensibility mechanisms).

UML is not only a graphic language. Behind each graphic element of its notation is a specification containing a textual representation of the corresponding language construct. For example, a class icon corresponds to a specification that describes its attributes, operations, and behavior, although visually on a diagram, an icon often reflects only a small part of this information. Moreover, the model may contain a different representation of this class, reflecting its completely different aspects, but, nevertheless, corresponding to the specification. Thus, the graphical notation of UML is used to visualize the system, and with the help of specifications describe its details.

Virtually every element of UML has a unique graphic image that gives a visual representation of its most important characteristics. The notation of the “class” entity contains its name, attributes, and operations. The class specification may contain other details, such as the visibility of attributes and operations, comments, or an indication that the class is abstract. Many of these details can be visualized as graphic or text additions to the standard rectangle that represents the class.

When modeling object-oriented systems, there is a certain division of the represented entities.

First, there is a division into classes and objects. A class is an abstraction, and an object is a concrete embodiment of this abstraction. In this regard, almost all language constructs are characterized by a class / object duality. So, there are precedents and instances of precedents, components and instances of components, nodes and instances of nodes. In the graphical representation for the object it is customary to use the same symbol as for the class, and the name to underline.

Secondly, there is a division into an interface and its implementation. The interface declares obligations, and the implementation represents a concrete embodiment of these obligations and ensures the exact following of the declared semantics. In this regard, almost all UML constructs are characterized by interface / implementation duality. For example, precedents are implemented by cooperatives, and operations by methods.

UML is an open language, that is, it allows controlled extensions to reflect the characteristics of domain models. UML extension mechanisms include:

  • stereotypes (stereotype) - expand the UML vocabulary, allowing you to create new ones oriented on the basis of the existing language elements, oriented to solve a specific problem;
  • Tagged values - extend the properties of the main UML constructs, allowing you to include additional information in the element specification;
  • constraints (constraints) - extend the semantics of UML structures, allowing you to create new and cancel existing rules.

Together, these three mechanisms of language extension allow you to modify it in accordance with the needs of the project or the features of the development technology.

UML diagram types

Graphic images of system models in UML are called diagrams . In terms of the UML language, the following types of them are defined:

  • use case diagram or use case (use case diagram)
  • class diagram (class diagram)
  • behavior diagrams (behavior diagrams)
  • statechart diagram
  • activity diagram
  • interaction diagrams
  • sequence diagram
  • collaboration diagram
  • implementation diagrams
  • component diagram
  • deployment diagram

Each of these diagrams specifies a different view of the system model. At the same time, the use-case diagram represents a conceptual model of the system, which is the starting point for the construction of all other diagrams. The class diagram is a logical model that reflects the static aspects of the structural construction of the system, and the behavior diagrams, which are also variations of the logical model, reflect the dynamic aspects of its functioning. Implementation diagrams serve to represent the components of the system and relate to its physical model.

Some of the diagrams listed above are used to denote two or more subspecies. As independent representations, the following diagrams are used: use cases , classes , states , activities , consistency , cooperation , components, and deployment .

For UML diagrams, there are three types of visual symbols that are important in terms of the information they contain:

  • connections that are represented by different lines on the plane;
  • text contained within the boundaries of individual geometric shapes;
  • graphic symbols depicted near visual elements of diagrams.

When graphing diagrams, it is recommended to adhere to the following rules:

  • each diagram must be a complete representation of a certain fragment of the domain being modeled;
  • The entities of the model presented on the diagram should be of the same conceptual level;
  • all information about the entities must be clearly shown in the diagram;
  • charts should not contain conflicting information;
  • charts should not be overloaded with textual information;
  • each diagram should be self-sufficient for the correct interpretation of all its elements;
  • the number of chart types needed to describe a particular system is not strictly fixed and is determined by the developer;
  • system models should contain only those elements that are defined

 

created: 2015-05-07
updated: 2024-11-14
316



Rating 9 of 10. count vote: 2
Are you satisfied?:



Comments


To leave a comment
If you have any suggestion, idea, thanks or comment, feel free to write. We really value feedback and are glad to hear your opinion.
To reply

System modeling

Terms: System modeling