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

How to analyze and Design in UML object-oriented

2025-04-11 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

This article is about how to analyze and design in UML object-oriented. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

Object-oriented analysis

The purpose of object-oriented analysis is to model the objective world of knowledge.

In fact, it is also the analysis and understanding of requirements in the process of object-oriented analysis.

The process of object-oriented analysis based on UML is generally as follows:

Get problem statement-- > identify class-- > prepare data dictionary-- > determine association-- > use inheritance to refine types-- > perfect object model-- > build object dynamic model-- > build system function model.

(1) to obtain the problem statement is to understand the system with the user, figure out the business logic of the system, and find out the user's needs. At this time, we should look at these requirements as a user. Many designers do not do enough function at this time, making the design and maintenance of the system extremely difficult, and begin to complain about the abnormal requirements of users. After figuring out the requirements of the system, let's not start coding right away. If you have already written a few pieces of code at this time, congratulations, you will have enough in the future.

(2) when we get enough questions and understand them, we can sort out the physical entities and conceptual descriptions that appear in the problems and temporarily mark them into a class entity. Then remove redundant classes and classes that have nothing to do with the system. And finally get our model entity.

(3) build a data dictionary from the class analyzed in the second step, which is likely to play an important role in our database design.

(4) through the second and third steps, we have obtained the entity information in the system, and now we need to make a connection between the entity information.

For example, in a student course selection system. The student is defined as an entity, and the course is defined as an entity, which connects the two entities by electing courses. This behavior is caused by the students. The goal is the course, and the result is whether the student has successfully chosen a course. Through this analysis, we can easily design the method of UML middle school students in the future design process.

Class Student {public bool ChooseCurriculum (Curriculum curriculum) {/ /. } / /. } class Curriculum {/ /. }

(5) use inheritance to refine classes

Using inheritance to share common properties to organize classes can generally be implemented in the following two ways.

Bottom-up: discover inheritance by generalizing the common properties of existing classes to parent classes and looking for classes with similar attribute relationships or operations. These results are often based on existing classifications of the objective world, and only possible, existing concepts should be used as much as possible.

Top-down: refine existing classes into more specific subclasses.

(6) perfect the object model.

It is impossible to correctly design what is needed at once in the design process, and it will often deepen the understanding of the requirements in this process. It is often necessary to repeat the previous process.

(7) establishing object dynamic model.

Following the object model in the previous steps, the next step is to build a dynamic model of the object.

Prepare script: dynamic analysis starts by looking for events, and then determines the possible event sequence of each object.

Identify events: identify all external events.

Prepare the event tracking table: represent the script as an event tracking table, that is, the event sorting table between different objects, the objects are the columns in the table, and each object is assigned a separate column.

Construct a state diagram: establish a state diagram for each object class to reflect the events received and sent by the object, and each event tracking corresponds to a path in the state diagram.

(8) establish the system function model.

The function model is used to explain how the value is calculated, to indicate the dependence between values and values and related functions. Data flow diagrams help to represent functional dependencies. The general steps for building a functional model are as follows:

First list the input, output values, input, output values are the parameters of events between the system and the outside world.

Establish a data flow graph, which can show how the output value is converted from the input value. The data flow graph is usually organized in a hierarchy.

Object-oriented design

Object-oriented design is the process of transforming the requirements obtained from the analysis price segment into an abstract system implementation scheme that meets the cost and quality requirements.

(1) object-oriented criteria

Modularization: an object is a module, which closely combines the data structure with the methods of manipulating the data to form a module.

Abstraction: object-oriented methods support not only the abstraction of processes, but also the abstraction of data. The quality of the abstract method and the level of abstraction have a great influence on the system design.

Information hiding: realized through the encapsulation of the object, the number of interfaces exposed by the object and the quality of the interface have a great impact on the system design.

Low coupling: low coupling is an important standard of design, which helps to reduce the impact of changes in one part of the system on other parts.

High cohesion: modules with high cohesion are easy to understand, easily reused, extended, and maintained.

(2) object-oriented practical rules

The results of ◆ design should be clear and easy to understand.

The general depth of the ◆ to the specific structure should be appropriate.

◆ tries to design small and simple classes.

◆ minimizes design changes.

(3) system design

System design is an advanced strategy for solving problems and establishing solutions, and basic methods for solving problems must be worked out. System design generally starts from the high level, and then refinement. The design of the system determines the whole structure and style, which provides the basis for the strategy in the later design stage.

Thank you for reading! This is the end of this article on "how to analyze and design in UML object-oriented". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!

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

Development

Wechat

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

12
Report