Structured approach and object-oriented approach

Source: Internet
Author: User

    1. Structured approach

Structured method is a traditional method of software development, which emphasizes the idea and key points of top-down, step-by-point, modular design and structured coding. Structured software development method can be said to be the earliest software development methods, but also to the present development and application of the more common, more mature software development methods, the structure of the introduction of engineering and structured ideas for software design, development and writing have a great impact.

The idea of top-down in the structured method is to layer the design of the program, decompose the function of the program, and turn the program into a gradual downward, from the general situation to the detailed process. The modular design of the structured method will decompose the functions required by the program, dividing a system into several modules, each of which realizes its own specific function, and the modules are independent from each other, and the call operations in the upper and lower layers are carried out by the top-down hierarchical relationship.

This is a structured approach to layering, sub-module example diagram.

Structured methods are divided into software lifecycles, structured analysis (SA), structured Design (SD), and structured implementation (SP).

The steps for structured analysis are as follows:

① analyzes the current situation and makes a DFD that reflects the current physical model;

② deduces the equivalent logical model of the DFD;

③ Design new logic system, generate data dictionary and primitive description;

④ establishes the human-machine interface and proposes a DFD for the physical model of the target system;

⑤ determine the cost and risk levels of the various programmes and analyze them accordingly;

⑥ Choose a scheme;

⑦ establish a complete requirements specification.

The structured design method gives a set of principles and techniques to help designers differentiate design quality at the module level. It is usually used in conjunction with the structured analysis method, and the module structure of the software is obtained based on the data flow graph. The SD method is especially suitable for the target system of transformed structure and transactional structure. In the design process, it is based on the structure of the whole program, using the module structure diagram to express the relationship between the program modules. The steps for structured design are as follows:

① review and refine the streaming chart;

② determine the type of the streaming diagram;

③ maps the flow chart to the software module structure, and designs the upper layer of the module structure;

④ based on the flow diagram to decompose the high-level module, design the lower module;

⑤ optimizes the structure of the module and obtains a more reasonable software structure.

⑥ describes the module interface.

The DFD described in the above steps refers to the data flow diagram, which is a library management system model, which can express the logical function of the system, the logical flow of data and the logical transformation process from the point of view of transmission and processing.

In a word, the basic principle of structural method is decomposition principle and modularization principle, the principle of decomposition is the most basic principle in the structure method, it is a kind of thought principle of the whole post-local, in the structure information system model, it adopts the method of top-down and layered solution, makes the program idea from the generalization to the concrete, Gradually became clear and transparent. The modular principle divides the program into modules and enables each module to execute only one function, with each module invoking other modules, such as procedure statements or function methods.

2. Object-oriented approach

Compared with the structured method, the object-oriented method is not to decompose the program according to the different functions, but to decompose it according to different objects.

In object-oriented thinking, things in the objective world are objects, there are certain relationships between objects, and complex objects consist of simple objects, while objects with the same attributes and operations belong to a class, and an object is an instance of the class. In addition, there can be hierarchies between classes and classes, that is, classes can have subclasses, where subclasses inherit all the properties and operations of the parent class, and subclasses have their own properties and operations. For example, animals are a big class, birds are a kind of animals, the birds into a class, then birds are the children of animals, and in birds there are sparrows, parrots, these are birds this general class of some examples, they are birds in this class object. In fact, from the above examples can be seen in the object-oriented thinking, the emphasis on the full use of people in the daily logic of thinking and principles often used, so the object-oriented approach and people's daily thinking method is very similar, which allows users and programmers, Testers are able to easily understand the architecture and operation of the entire program.

The object-oriented approach is divided into object-oriented analysis methods (OOA) and object-oriented design (OOD).

When using OOA to specifically analyze a thing, the following five basic steps are generally followed:

① determine the problem domain;

② District classification and objects;

③ distinguish the whole object and component, determine the relationship and structure of the class;

④ defining attributes and services;

⑤ determine the additional system services.

The object-oriented analysis method is based on the application, which is used to describe the problem, and the overall design structure of the program is obtained.

The Ood method is used to refine the analysis results and complement the implementation, which generally follows the following five basic steps:

① improve and perfect the results of system analysis;

② design interaction process and user interface;

③ Design task management, and coordination between subsystems and tasks;

④ Design Global resources to determine the resource allocation of tasks or subsystems;

⑤ Object Design.

Encapsulation and polymorphism are also present in the object-oriented principle. Encapsulation is the abstraction of the process of dividing an abstract element, consisting of structure and behavior, which encapsulates the original interface of abstraction and its execution. Encapsulation makes the data and the method of processing the data encapsulated as a whole, in order to achieve a very independent module, so that users can only see the external characteristics of the object, and the object's internal characteristics of the user is hidden. The purpose of encapsulation is to separate the use of the object's designer from the object, and the user does not have to know the details of the implementation of the behavior, but only accesses the object with the information provided by the designer. Polymorphism refers to the action that an object makes based on the messages it receives. When the same message is accepted for different objects, it can produce completely different actions, known as polymorphism.

3. Comparison of advantages and disadvantages

Because of its top-down characteristics, the structured method determines that the program is Youbiaojili, from large to small, from generalization to concrete procedure. In this way, the process of dealing with the problem becomes easy to be difficult, the problem is solved by layers, the thinking of programming is clearer, which reduces the difficulty of dealing with the problem. However, in the use of structured methods to solve the problem, before getting the description of the nature of the problem, the continuous decomposition of the conclusions and the need to deal with more and more information, more and more complex. Because of this thought, it needs to have a more thorough understanding of the problem, requires the designer to have bigger picture, can grasp the essence of the problem through the appearance of the problem. Therefore, when the software project is small and the system designer is high enough, the structured method can quickly find the most concise and efficient logic model. However, for complex problems, the help of structured methods is limited, but it helps to validate the initial high-order model of the system using a system analyst oriented analysis method.

The object-oriented approach is consistent with the human habit thinking method, which makes the user and maintenance personnel easy to understand, maintainability in software maintenance is also high, and easy to test and debug, object-oriented approach directly from the problem, to carry out the system modeling. The stability of the object-oriented software is good, the local modification of the software will not cause the whole change, and the local modification is easy to implement; In addition, the object-oriented software reusability is good, and because it is to divide the big problem into separate small problem processing, reduce the technical difficulty of the development. However, because object-oriented methods always try to abstract more common classes, it is very difficult for the system analyst to abstract things and grasp the direction of the initial analysis, it is often difficult to control the abstract objects, which is more difficulty than the structured analysis method. It is very difficult to get a highly reusable object-oriented software system design for a system with frequent requirements change.

Structured methods and object-oriented methods are not antagonistic, no matter what kind of design method, have their own advantages, of course, there will be their own weaknesses, for each problem, the designer needs to understand, in order to correctly find the right approach to the current problem.

Structured approach and object-oriented approach

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.