The application comparison of structured method and object-oriented method

Source: Internet
Author: User

Nowadays, there are two kinds of common software development methods, one is the structured method and the other is the object-oriented development method. This paper introduces the different and compatible points of two kinds of software development methods in application.

First, structured software development Method 1, demand analysis

In the phase of demand analysis, the structural analysis method is generally from the direction of data processing to think about the problem. Structured analysis method in the face of a demand, the developer will think of this requirement as a set of functions, in other words, the whole program is split into several large functions. Then use a small function module to combine to meet the entire needs. On the other hand, the use of small functional modules to form a large function to meet the needs of the process, is also the process of developer analysis needs, the function of a large system split into a number of small pieces to understand, which helps the gradual refinement of requirements. From macro to detail, top to bottom.

In the process of completing this process, the developer summarizes the experience and develops the experience into some mature analytical techniques. Among them, a commonly used technology is a data flow chart, the flow chart for the analysis of system data processing process, starting from the top, along the direction of data flows, from top to bottom, for each of the functions of the module to operate the traffic is clear and clear description. That is, what to do with the data, what data to output after the operation is completed, etc.

2. Program Design

In the program design phase, the same is to follow the top-down thinking. First in the demand analysis phase has produced a data flow chart, the system has basically determined which modules, that is, according to the flow chart, extracting the function of each processing point, each function is a module, of course, also need to repeat the function of merging, too complex function to reasonable decomposition. Therefore, the main work in the program design phase is to design the implementation of each module of the program, and design the relationship between the modules, the interface between the module design clearly.

In the module relationship design, there are some more mature design methods, such as the system structure diagram to illustrate the function and function of the system, including the call relationship, cooperative relations, parallel sequential execution relationship and so on. This completes the overall structure design of the system.

After the overall structure design is complete, the concrete details inside the module can be designed in depth. Each module as a small program, there is a saying, the program equals the algorithm plus data structure, so the deep design of each module is to find out what each module is to use what kind of algorithm to achieve, using what data structure to save data information. In addition, since the module is not alone, it is also necessary to consider how the module communicates with other modules.

3. Program Development

When the program is finished, it can be developed. In the process of program development, the structured development method only needs to be expressed in computer language according to the design results produced during the design stage. Mainly to choose the appropriate development language, in the process-oriented development language, generally have C language, Pascal language and so on.

4. Program Test

Of course, black-box testing is naturally no different from the systems produced by other forms of development. But in the white box test or gray box test, it is necessary to combine the program characteristics of the structured development method to test the design of the process. The functionality of each function module needs to be tested first, and then the functional combination of the data flow path is tested for coverage. Find the problem, if it is within the module or can be quickly resolved, if there is a problem between the module cohesion, this can cause a lot of confusion, may be reaching.

5. Evaluation of development methods

The structure design method takes the function of the thing as the main consideration object, extracts the relation of their function in the abstraction from the realization thing, therefore the structural design does not reflect the actual therein in the realization the real relation, the module and the module connection will compare the personal, is not conducive to the entire team's cooperation. For example, I think that these two functions should be the relationship between calls, and you think that the relationship between the parallel cooperation is more reasonable. But because it is only a function of the extraction of things, which reduces the need for many outside the introduction of the link. If the function module is designed properly, it will make the program quite concise, which greatly guarantees the operation efficiency of the whole system. This is also an important reason why many of today's foundational systems will be developed using a structured development approach.

Two, object-oriented software development method

  

1. Demand Analysis

Object-oriented in the requirements analysis phase, the developer mainly engaged in the realization of the State to consider. They will abstract specific things into a dataset and feature set, which is a class. And then, according to each class in the implementation of the relationship to connect them to meet the needs of the effect. This aspect of understanding the requirements is extremely simple, because it has little to do with the function of the program itself, but rather to try to get the program to simulate the reality of things and the relationship between things, it is the realization of the problem. In this process, it is generally not considered what algorithm to implement.

In the object-oriented requirements analysis phase, the commonly used method is the use case diagram (Diagram). The use case diagram analyzes the functions of the system from the user's perspective and describes all the transactions that the user interacts with the system.

2. Program Design

Based on the requirement analysis, it can be programmed according to the use case diagram. In a use case diagram, you can clearly see what is involved in the system and what is the relationship between them. Then you can roughly analyze what classes are required for the entire program. The class may be used to determine the first, and then the function of the system to achieve a reasonable allocation to each class, so that the whole system into a local, we just follow the implementation of the relationship between the various things in the system and the real thing corresponding to the class and class relationship, the entire program is designed to complete.

In the design phase, commonly used techniques are, class diagrams, object graphs, and package diagrams. Object the system, and then classify the objects in a package. This is done by the small and the large, and the class as the basic unit, the entire system can be built out. The system is designed by the class diagram, and then the dynamic process of the system needs to be designed. According to the timing state or the interaction of the system execution, the behavior of the system can be described so as to construct a dynamic model, including interaction diagram, state diagram and activity diagram.

3. Program Development

Object-oriented programming languages include C + +, C #, Java, and so on.

4. Program Test

In testing the design, the object-oriented program can test the functionality of each class individually, because each class can be instantiated individually, so it is easy to test. Furthermore, it is necessary to test the correctness of the inter-class cooperation, according to the system function, the instantiation Department classification, and the Inter-class data processing in-depth testing.

5. Evaluation of development methods

The idea of object-oriented design method is simple and suitable for team cooperation. Because the class is the basic unit, and the relationship between the class and the class is an abstraction of the real thing. So in the team development, only need to unify the interface between developers, the rest of the development is equivalent to the application of the program to describe the physical reality. This method developed out of the program, relatively easy to test, not too many combinations. And the general logic of the error can be controlled in a class, and if the relationship between the class is wrong, but also from the class of the magnitude of the program as a whole to adjust.

However, because the object-oriented approach is basically a near-complete description of the implementation of the physical, so the overall program does not look neat, and the efficiency of the operation is not high-structured program. Each class must have its own properties and function functions, and in addition to the family class that has an inheritance relationship, the properties and methods are not shared between classes and classes. Even classes that have inheritance relationships are not really advocating the sharing of methods of attributes. This is an object-oriented approach to the packaging characteristics of the basic requirements for development and design. This can cause significant waste to storage space.

Third, the compatibility of the two

The two development methods are not completely antagonistic to each other, and they can be cross-used. For example, the implementation of object-oriented function is to deal with process-oriented thinking. and to the upper view, the order of the classes between the discard function, in fact, is a macro-meaning process design.

  

The application comparison of structured method and object-oriented method

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.