The comparison between the structured method and the object-oriented method

Source: Internet
Author: User

                        The comparison between the structured method and the object-oriented method

There are many methods of software development, the most representative of which are structured methods and object-oriented methods. These two methods are widely used in software development. Because of the different thinking of solving the problem, the means of use are different, and there are advantages and disadvantages in different problem environment.

  I. Structured approach

The structured method (SD) is one of the traditional methods of software development, which takes the process of solving the problem in stages and decomposes it from top to bottom, so that the problems of each stage are controlled in a controllable range. The structured method is mainly composed of three parts: structural analysis, structural design and structured programming.

  1. Structural Analysis

Structured analysis is a method of system analysis for data flow. Generally for the top-down gradually to solve, with a series of principles and techniques have been considered to be correct support, the use of Data flow chart, database dictionary, decision tree, Judgment table and other means, so that the development method and system is reasonable.

Streaming chart

It is a function model to reflect the logic function that needs to be done in the system, which is usually produced in the requirement analysis stage. The flow chart can be divided into top-level streaming diagram, middle-layer streaming chart and underlying streaming diagram. The top level Data flow diagram uses a processing to represent the whole system, the output stream and the input data stream are the input and output data of the system, indicating the range of the system. The middle layer of the streaming chart is a process in the upper layer of a processing to further refine, and the level of the flow chart of some processing can be refined again, into another sub-flow chart. The underlying streaming diagram is generally no longer able to decompose the streaming diagram.

Data dictionary:

The data dictionary is used to define the data items, data structure, data flow, storage, processing, etc., in order to describe the elements of the data flow diagram in detail.

Decision Tree:

Also known as decision Tree, is a graphical tool for describing processing, which is suitable for describing multiple judgments in problem processing, and each judgment is related to some conditions. When using the decision tree Description, we need to subdivide the judging conditions and decisions, find the subordinate and side relation of the judging condition, and build the decision tree based on this.

  2. Structured design

  is a data flow-oriented design method used to determine the structure of the software. Its basic idea is to build a module structure diagram based on the structured analysis of the flow chart. The structural design has the following characteristics:

A. The module structure is relatively independent, the function is single. the structure design of the system is designed into a plurality of relatively independent, single-function modules composed of a structure. Each module can be individually understood, implemented, tested, modified, and its independence prevents the spread of errors between modules.

B. Modules follow internal contact large, small inter-block connection

C. Adopt the description mode of the module structure diagram.

  3. Structured programming

Structured programming is a subset of process programming, it has three basic structures: sequential structure, selection structure and cyclic structure. And any program can be constructed of these three basic control structures.

  Ii. Object-oriented approach

The object-oriented approach actually simulates the objective world from the internal structure. It advocates that the object is a description of the real-world objective entity, which consists of attributes and related operations, and is the basic structure of the composing system. Object-oriented construction software system, in the process of construction as far as possible to use the human way of thinking, with the real thing as the center of modeling, abstract the class as the basic unit of the system, in order to maintain the problem domain and the relationship between the original face. Object-oriented technology emphasizes the use of thinking methods and principles used by human in daily logic, such as abstraction, classification, inheritance, encapsulation and so on.

  Packaging

Encapsulation separates the design and use of objects, and the user does not have to know the implementation details of the object to access it. It is mainly used for the description of classes, which makes the class an independent module with its own properties and methods of operation, while the interaction between classes is minimized.

  Inherited

Inheritance is a mechanism for sharing data and methods between classes, and subclasses can inherit parent class methods and properties. The existence of the inheritance mechanism reduces redundant code and enhances the reusability of the system and class.

  Polymorphic

Polymorphism makes the same operation work on different objects, can have different interpretations, and produces different execution results. The problem of tight coupling in the project can be solved by using polymorphic mechanism to improve the expansibility of the program. The application no longer has to write functional calls for each derived class, only the abstract base class is processed, which improves the reusability of the program. The functionality of a derived class can be called by a method of the base class, which enables backward compatibility, which improves the maintainability of the program.

  Three, the comparison between the structured method and the object-oriented method

  A The angle of dealing with the problem

The object-oriented approach emphasizes mapping the problem domain directly to the interface between objects and objects, and simulates the objective world using patterns that conform to people's usual thinking. The structured approach is to emphasize process abstraction and modularity. is a process-centric approach to the problem of the objective world.

  B Data processing methods

The object-oriented approach encapsulates data and operations and wraps them into an object. Its design idea requires minimizing the interaction between classes, and the operation of the data is done by the object itself as far as possible. And the institutional approach is directly processed by the function of the data, there is no other requirement.

  C Control method

The object-oriented approach activates and controls the running program through event-driven, and structured methods can only be called and returned by design. There is a control and a controlled relationship between the various modules.

  D Noun terminology is different

In object-oriented, the use of terms such as class, inheritance, encapsulation, and structured methods generally use functions, procedures, data and other nouns.

  E. The basic unit of dealing with problems

Object-oriented objects are designed to simulate entities of the objective world with classes and objects, so the basic unit of dealing with the problem is class, so it is more suitable for human reading and understanding. The structured method is an abstraction of the processing process, and the basic unit of dealing with the problem becomes a function in the process.

  F. The principle of problem solving

The object-oriented method is consistent in the process of solving the problem because of its characteristic of simulating objective world entity, from analysis problem to design to implementation. The structural method emphasizes the problem of decomposition from top to bottom, and gradually solves it, from the analysis problem, the design, the realization gradually consummates, thus does not have the consistency.

Structured method is the modeling of the system function, based on the function to decompose the design system structure, from the internal function to simulate the objective world, its model is good readability, good at the complex system with a number of independent requirements to achieve the small module, effectively improve the software development quality. However, when the user's needs change, as the basic components of the parts are easily affected, and their changes will often cause a great change in the system, which undoubtedly increases the maintenance difficulty.

The object-oriented method is modeled from the behavior and simulates the objective world from the internal structure. Because of its data-centric description of the system, so it has a strong stability, on the basis of the model to map out the source code is also a simple thing. Therefore, it is easy to make system maintenance and reuse of components, which can improve the efficiency of software development and adapt to the situation where the requirements change frequently. In addition, the object-oriented approach is widely used in the development of graphical interface-centric programs.

Therefore, in the actual software development, both methods are indispensable. The choice between the two methods depends on the specific problem and the actual environment to be solved. Even if we can combine these two methods, for example, some systems need to deal with both real-time information and database support, and involve a lot of concurrency, we can use the object-oriented approach while using a structured approach to solve local problems.

Reference documents:

"1" Zhangli, Qiu. A comparative analysis of structured methods and object-oriented methods. Journal of Shaanxi Normal University (natural Science Edition)

"2" He Baojun, Wang June. Object-oriented methods and structured methods. Journal of Foshan Institute of Science and Technology (Natural Science Edition)

The comparison between the structured method and the 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.