Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Summary of UML-1 used in Agile Development

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/03 Report--

How to use UML

Draft

Blueprint

Development language

In agile development, we often use UML in a draft way.

Figure

Class diagrams and sequence diagrams are commonly used in agile development. We use these two diagrams to analyze and identify domain models. The concepts identified by these graphics will form a set of languages for our description of related fields.

1. Class diagram (Class Diagram)

Used to describe the type of object, is the description of static information. This static information includes the relationship and limitations between the Features of the class and the class.

-related concepts

The properties of a class include properties (Property) and operations (Operation). Property includes the Attribute and Association of the class. Note the difference between Operation and Method. Operation is a declaration of the process. Method is the concrete implementation of the process. This difference is easier to explain when there is polymorphism. For example, we have doAction () in our parent class and different implementations in different subclasses. In this case, we can say that we have one operation and multiple Method implementations. Generalization, from the point of view of software development, inheritance can explain this problem very well. An important principle for judging inheritance is the Liskov Substitution Principle-LSP principle. Dependency, if the transformation of the relevant definition of one unit will cause changes in other units, we can assume that there is a dependency between the two. When designing the software. By identifying dependencies, we can analyze the problems of dependencies in the design. Usually we want to achieve one-way dependence, the formation of circular dependence requires us to pay special attention to avoid. In addition, we try to rely on stable units. The interface is stable relative to the specific implementation. According to the definition of dependency, association,generalization actually establishes the dependency relationship between classes. But in the graphical expression, we have to choose whether to use dependency or association or generalization according to the core intention that we want to express. The transitivity of dependency is determined according to the type of specific dependency. General dependence is not transitive. Some also have transitivity, such as inheritance.

-pay attention.

When we identify generalization relationships, we pay attention to the concept of classification. The reason is that generalization is transitive, classification is not transitive, and it describes the relationship between objects and types. For example, monkeys are primates and primates are animals. Primates are a classification of animals according to their order. Let's try to organize it with a transitive relationship. We can say that monkeys are animals, but we cannot say that monkeys are classified according to their purpose. Note that "primates are a classification of animals by order" is classification. So note that not all "yes" relationships here are generalization.

two。 Sequence diagram (Sequence Diagram)

Sequence diagram is a kind of interaction diagram (Interaction Diagram). The interaction diagram describes the behavior between objects (note that it is between objects, not classes). In addition, there may be collaborative relationships between not only the objects of the class, but also other participants. Sequence diagrams are used to help us capture behavior in a scene. When drawing sequence diagrams, we often aim at a use case and find out the instance objects and the information about the interaction between them.

-effect

This diagram cannot clearly describe the algorithm, but it can clearly describe the invocation relationship. This is in line with our agile development needs. As sketches, we don't need to pay much attention to the details of the algorithm.

This diagram can clearly distinguish the responsibilities of each object. As a beginner or beginner of OO development, it is often easy to write centralized control (centralized control) code, because this is more in line with the process of thinking habits. We advocate distributed logical control (distributed control), which is to closely combine data and behavior into a single object of responsibility.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report