UML use

Software engineering project this week to pay a design document, which involves drawing UML diagrams, according to the class to make a record of ppt.

Introduction about UML will not repeat them here, directly open the whole!

The basic model of the UML

Of course, the necessary introduction essential here to introduce the basic UML, and then according to the order of presentation of the FIG.

After a brief introduction to object-oriented programming principles. This section is a review of my prior knowledge, we want to see UML friends can jump directly to the next chapter.

Objects

Overview objects

Object is an abstract entity that contains real-world object features, which not only represent specific things, can also indicate specific rules or events. For example, the user public health reimbursement reimbursement system is an object.
Object has state , that is, the object also has properties . For example, reimbursement user name, age, unit status and so on.
Further comprising an object operation , we call the method , it is used to change the state of the object. For example, a user in operation for reimbursement may be changes to your personal information.

Classification of objects

Objects can be roughly divided into five categories: namely, physical objects, characters, events, and interaction specifications.

  • Physical objects
    and more representation in real life most likely to be abstract objects, such as student or teacher reimbursement system is a unit of physical objects;

  • Roles
    For example, the reimbursement system, the role of a unit of student teachers are reimbursed users.

  • Event
    herein understood not determined, the individual is understood that the role of the event object events associated state is stored for subsequent read operations.

  • Interaction
    interaction represents the relationship between the two objects. Its practical use when a relationship between entities is many to many, can be reduced to an interactive object using two-to-many relationship. Understand, interactive relationship between performance in Java for the interface, it can prevent multiple implement a similar method in different classes.

  • Specifications
    indicate that a combination of certain physical requirements, can be understood as config item.

Encapsulation, inheritance and polymorphism

Our widely mentioned in the object-oriented class, in fact, it can be understood as artificially defined the rules of the computer constructed object. Package presented here, inheritance and polymorphism are more general, to be followed specifically wrote an essay introduction (Gugu Gu?)

Package

The use of abstract data types and data based on the operation data packaged together. Borrowing an example of a class, for a smart phone, most users just need to learn how to use the phone, do not need to learn how to repair phones, so mobile phone repair related attributes and operations do not have to open to a user.
Java provides four modifiers control methods and properties that control access permissions:

  • public: open to the public

  • protected: Section of the same sub-classes in the package disclosed in

  • private: only you can access the class itself, not public

  • Unmodified symbols: the type disclosed in the same package

Theoretically a good object-oriented design, classes are private property should

inherit

Main code reuse is to solve the problem, when a plurality of objects with similar properties and methods from classes such as the abstract parent class, these same properties and methods defined in the parent class, subclass needs only define your own unique properties and methods can be. Java extends statement in use implementation inheritance.

Polymorphism

Polymorphic knowledge is not introduced here, see the other essays (Gugu Gu?)

UML things

Things are the most representative model of the abstract section.

Structure of things

Structure things are static portion of the UML model, including classes, active classes, interfaces, objects, use cases, participants cooperate member, nodes, etc.

  • Class: The following diagram shows a class.

  • Active class (class activity): Example should be one or more processes or threads, and may conduct other types of elements working in parallel.

  • Interface: describes the classes or components external, visible operation, is described in a set of operations, rather than the specific implementation.

  • Object: instance of a class, its name should be underlined, properties of an object need to be clearly given.

  • Use Case: a set of sequences of actions to be described, the system represents a desired behavior implemented.

  • Participants: also known roles, and represents part of the information exchange system, can be people, software, hardware, and so on.

  • Collaboration: Describe a set of roles and other entities how to accomplish a function or behavior work together.

  • Member (assembly): describes the physical package some logic elements.

  • Node: represents a quantifiable resource, typically having a memory and processing capabilities.

Behavior of things

Things are part of the dynamic behavior of the UML model, including interactions and state machines in two parts.

  • Interaction: interaction message transmitted between a set of objects by the completion of certain tasks in a particular context in the composition.

  • The state machine: a description of the interaction or an object in response to events experienced by state sequence in the life cycle and record their responses to events. Talking is to describe cooperative behavior between a set of classes.

Packet things

Packet thing is the package, the package model elements organized into groups.

Notes things

Any explanation UML model UML elements

The relationship between the UML

The overall relationship is represented as shown in FIG. Next introduced in turn:

Generalization

Generalization is the inheritance relationship between the general classes and special classes. Note that generalization is directed to the instance of the class is not a class. Further, the generalization can be further divided into general and limited generalization generalization.

A little skill, generalization relationship can be expressed as the is-a, namely SUV is a car, then the car is a generalization of the SUV.

  • Ordinary generalization: Allows single and multiple inheritance.

  • Limited generalization: Usually there are four constrained cross (overlapping), do not intersect (in disjoint), complete (Complete) and incomplete (imcomplete).

Realization relationship

generalization relationship to implement a combination of dependency, emphasis inherit an abstract class (abstract or interface), and a specific class inherits generalization.

connection relation

It described connection relationship between two or more classes of control. Can be divided into ordinary association, association is defined, the association class, aggregation and navigation.

  • Ordinary association:
    is the most common kind of association. It can be divided into binary association and diverse association. Binary association multiplicity describes the correspondence class instance associated with a number of ends. You can also attach an association end role name, while also allowing the association class itself.

    It refers to the association between a polyhydric association three or more than three classes.

  • Defining association:
    defining commonly used in association or many-to-many relationship, the multiplicity can be from one into many, or many-to-many simplified. The specific implementation is placed at the end qualifier relationship.

  • Association class:
    the need for a detailed definition of the relationship, then use the association class.

  • Polymerization:
    polymerization is a special relevance, describes the relationship between the part and the whole. It can be divided into a polymerization compound and a polymerization shared.

    Shared polymerization: Some examples can participate in a plurality of integrally configured instances simultaneously. For example, an actor may be cast simultaneously in the plurality. Cast and configured to share the polymerization.

    Polymerizable compound: Some examples of completely dependent on the overall instance, i.e. part of the overall strength coexist with examples. For example, a relationship of the form and the form is a composite button polymerization.

  • Navigation:
    Navigation is a feature of the relationship, the navigation direction indicates a plus arrow associated endpoint. Popular is understood that all objects can be obtained by the object of another class of a class.

Dependencies

Describe the semantic relationship between two things, one thing changes will affect the semantics of the other things. More simply, a class implementation needs the assistance of another class, for example, modern computer class dependent class.

UML diagrams

Ah exhausted. . . Although not speak theory, or pull so much QAQ. Now officially begun! The figure below clearly shows the relationship between the UML diagrams.

Use Case Diagram

The most basic, the best draw of map! It describes the system functions performed by those who understand. Used for requirements analysis phase. In UML, a use-case model described by a number of use-case diagram, with the main elements of the embodiment and the embodiment of FIG actors use.

FIG embodiment use is a performer, a system boundary (a rectangle) closed with a group of cases, the association between actors and use cases, and generalization to the relationship between actors with FIG.

Use case (use case) the reaction system is described how the external request, a technique to obtain the user's requirements by using the scene.

There may be between the generalized embodiment, extension using three relationships (comprises) a.

Generalization relationship can be understood as inherited OO in some cases child and parent use cases with substantially similar, only in some places there are differences.

Expanded relationship is actually a manifestation of refinement function, here is an example, such as the system allows users to print or export the query to the record, here either export or print, that query is the same, so that the two use case queries can be used as an extension of this use case use case.

Containment relationship is too small to prevent the design of system functions. For example, example, we want to maintain a database, we can design deletions check changed as four cases, but in a large system such use cases is divided too thin, it can maintain a database as a use case, the deletions check change as containing the four use case.

In fact, we can see that, to define the relationship between the three is not very clear, it was a distinction between optimization focus from this point of view the relationship between use cases:

  • Generalization focused by the sub-mutually exclusive embodiment

  • Comprising focus indirectly indicates the services provided by comprising the Actor

  • Extended trigger denotes an extended focus on the uncertainty of the use case (personal understanding expanded relationship will not affect the normal operation of the system, use cases belonging to the icing on the cake)

When you get two use cases, to use these three questions can be determined. The following is a UML use case diagram drawn according to this soft work items.

Class Diagram

FIGS static relationships between classes and class and type described, which is a system from the static point of view, and therefore belongs to a class static model of FIG. The class diagram is the foundation for other figures, there is no class diagram is no other state diagram, collaboration diagram, etc., there is not a characteristic of other systems.

Modeling class may be used in association, aggregation and generalization (inheritance) relationship.

Flowchart

Sequence diagram to describe the dynamic interactions between objects, focusing on the performance time sequence of message passing between objects.

State diagram

State diagram describes a particular object of all possible states and state transitions caused by events. Most object-oriented techniques diagram shows the behavior of a single object in his lifetime by the state. A state diagram including a series of transfers between states, events, and states.

FIG FIG deployment member &

Ah really be kept out of this thing. . . I do not know what he was painting what the QAQ.

to sum up

Sure enough, or do not understand the theory, still have to use hands-effective. . . UML diagram text of fallible, please let us know!

Ah really hard for me to get up early again tomorrow. . .

Guess you like

Origin www.cnblogs.com/LuoboLiam/p/11768938.html