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

Since the software engineering has been put forward, it has been greatly developed, and the two methods--the structured method and the object-oriented method are also widely discussed in this paper, and the two methods are compared with each other.

First, Structured Approach

The Structured method (SD method) is a traditional software development method, which is composed of three parts: structural analysis, structured design and structured programming. Its basic idea: the solution process of a complex problem is carried out in stages, and this decomposition is top-down, decomposition by layer, so that each phase of the problem is controlled by people easy to understand and deal with the scope.

1 , Basic principles:

The basic idea of structured method is to treat the problem as a system to analyze and solve the problem by means of system science. The structured approach follows the following basic principles:

(1) Abstract principles

Abstract principle is the basic principle that all systems scientific methods must follow. It focuses on grasping the essential content of the system and ignoring the content which is irrelevant to the current goal of the system, which is a basic cognitive process and thinking mode.

(2) Decomposition principle

The principle of decomposition is the most basic principle in the structured method. It is a general post-local thought principle, which adopts top-down layered approach when constructing information system model.

(3) Principle of modularization

Modularization is the concrete application of the basic decomposition principle of the structured method, which mainly appears in the structural design stage, and its goal is to decompose the system into several modules with specific functions, thus accomplishing the functions specified by the system.

2 , Analytical methods

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.

3 , Modeling technology

Model problem is the core problem of structured method. Modeling the model for short is to better understand the reality that we want to simulate. The world modeling usually starts from the system demand analysis, in the structured method uses the SA method to construct the system environment model, then uses the SD method to determine the system behavior and the function model, finally uses the SP method to carry on the system design and the determination user's realistic model.

Structured analysis (structured analyses, or SA method) is a method of demand analysis oriented to data flow, which was put forward and developed by Yourdon,constaintine and DeMarco in the late 70, and it has been widely applied. It is suitable for analyzing large-scale data processing system, especially enterprise management system. Sa method is also a kind of modeling activity, mainly based on the data transfer, transformation relationship within the software, from top to bottom by layer decomposition, depicting the software model to meet the functional requirements.

Ii. Object-oriented approach

1 , Basic principles

The object-oriented model follows the following basic principles: Abstraction, encapsulation, modularity, and hierarchy principles.

(1) Abstract

Abstraction is the most basic way to deal with the complexity of the real world. In the OO approach, it emphasizes the intrinsic nature of the difference between an object and other objects. Determining a reasonable abstract set for a given domain is one of the key issues in object-oriented modeling

(2) package

Encapsulation is the division of abstract elements, and the process abstraction consists of the structure and behavior that encapsulates the original interface used to separate the abstraction and its execution.

Encapsulation is also known as information hiding information hiding it separates the external features of an object from the internal execution details and hides the latter from other objects.

(3) Modular

Modularity is a system feature that has been divided into a series of clustered and coupled modules. Determining the correct set of modules for a given problem is almost as difficult as determining the correct set of abstractions, and usually each module should be simple enough to be fully understood.

(4) Level

Abstract sets usually form a hierarchy, which is the collation and sorting of abstractions. There are two very important levels in the complex real world, one is the type hierarchy and the other is the structural level. Determining the level of abstraction is based on the inheritance of objects, which helps to discover the relationship between abstractions in the inheritance of objects and to understand the nature of the problem.

2 , Analytical methods

The object-oriented analysis steps are as follows

(1) Analyze and determine all the objects and their attributes that appear in the problem space and reconciliation space;

(2) Determining the operation to be applied to each object, i.e. the inherent processing power of the object;

(3) Analysis of the relationship between the objects, to determine the object of communication between the message;

(4) The message pattern of the design object, the message pattern and the processing ability together constitute the external characteristics of the object;

(5) Analyze the external characteristics of each object, classify objects with the same external characteristics into one class, and determine the required classes;

(6) To determine the inheritance relationship between the classes, the public nature of the objects in the upper class of the description, through inheritance to share the description of the public nature;

(7) Design the description of each class about the external characteristics of the object;

(8) Design the internal implementation of each class (data structure and method);

(9) Create the desired object (an instance of the class), and implement the appropriate connection between objects (send messages).

3 , Modeling technology

The object-oriented approach is the same as the structured method, the core problem is the model problem object-oriented model is mainly composed of OOA model Ood model, which OOA mainly belongs to the abstract morphology of the subject Ood mainly belongs to the discipline design form aspect content.

UML The use of a unified basic representation to organize data and its proprietary processing, to support OOA, ood all stages of the work characteristics, so that the traditional software development of the two gaps disappear. The emergence of UML is an important achievement of the development of object-oriented technology, UML becomes the industry standard of visual modeling language, and represents the development direction of the software development technology of object-oriented method.

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

1 , internal relations

(i) the consistency decomposition and abstraction of both in decomposition and abstraction are important principles of the complexity of control problems in software development. Decomposition of the whole score 0, the problem silking, layer digestion, abstraction is through decomposition, in the decomposition, the upper layer is the lower level of abstraction, the lower layers are the specific interpretation and embodiment of the upper layer, the use of abstraction can not consider too much detail, and gradually have a plan to learn more details. Object-oriented methods and structured methods are fully consistent in the application of decomposition and abstract principles.

(ii) consistent localization of localization and reuse design is an important principle in software development, that is, we do not want to involve too much or affect other parts of software. In the structured method, localization is mainly embodied in the separation of code and data, that is, the program parts in addition to the necessary information exchange, each other apart from each other, and the object-oriented approach is the data, code encapsulation, the data, code and operation methods are packaged into a similar "black box" of the whole object, It improves the reliability and security of the program, and enhances the maintainability of the system. This means that the object-oriented approach is more thorough than the structured approach.

2 , Difference

(i) different starting points when dealing with problems

Structured method is to emphasize process abstraction and modularization, to construct or deal with the problem of objective world by process, it is a process-oriented development method, and the object-oriented method emphasizes that the point of problem domain is directly mapped to the interface between object and object, and it is the problem of dealing with the objective world in accordance with people's usual way of thinking.

(ii) different basic unit and hierarchical logical relationship of the problem

The Structured method abstracts the problem of the objective world into the process that the computer can deal with, the basic unit of dealing with the problem is the module that can express the process clearly, and summarizes the relation and function between the module and the module with the hierarchical structure of the module. The object-oriented method uses computer logic to simulate the physical existence in the objective world. Taking the object's collection class as the basic unit to deal with the problem, the computer world should be brought closer to the objective world so as to make the problem more straightforward, and the object-oriented method is to use the class hierarchy to embody the inheritance and development between classes.

(iii) Different methods of data processing and control procedures

The structured method is to process the data directly through the program, and the processing results can be displayed after processing, in the way of control program is not free navigation according to the design call or return procedure, there is a control and controlled relationship between the modules; object-oriented methods encapsulate the data with the corresponding code as a whole, In principle, other objects cannot directly modify their data, that is, the object's modification can only be done by its own member function, the control method is "event-driven" to activate and run the program.

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.