Comparison between structured and object-oriented methods

Source: Internet
Author: User
Tags access properties

Computer software plays an important role in modern science and technology, and has become one of the key fields of high-tech competition in the information society. In this article, I aim at the two development methods of computer software: The structure method and the object-oriented method are combed and contrasted, analyzed the structure method and the object-oriented method of the two software development methods of the specific analysis and design process, discussed their application in different software development and limitations, And at last put forward a point of their own views.

1 Structured methods

The structured method (structured methodology) is a typical system development method in the field of programming. It uses the system science method of thinking, from the level of view, from top to bottom analysis and design system. Structured methods include structured analysis (structured analytical, abbreviated SA), structured design (structured designs, abbreviated as SD), and structured programming (structured program design, SP) in three parts. The SA and SD mainly belong to the abstract content of the program, and the SP mainly belongs to the program design.

1.1 The basic principles of structured methods follow:

(1) Abstract principles

(2) Decomposition principle

(3) Principle of modularization

1.2 Modeling of structured methods:

Modeling is usually started from the system requirements analysis, in the structured approach, is to use the SA method to build the system's environmental model, and then use the SD method to determine the system's behavior and functional model, and finally the SP method to design the system. The main task of SD is to establish the behavior and function model of the system based on the system environment model, and to complete the description of the internal behavior of the system. The main tools to implement the system behavior and function model are: Data dictionary, flow chart, state change diagram and entity one relation model, etc.

1.2.1 Streaming chart:

The Data Flow diagram (DFD) is the core technology of SA and SD, it is a graph of graphs, arcs represent the information, and the nodes represent the programs that the data flows through. The program can also be subdivided into finer data flow diagrams, continuous fine molecular procedures until the expression of the program function. For the abstract underlying code block or function, the General Program Specification (specification) in detail, the program specifications can also be a flowchart or pseudo-code in special cases.

DFD uses a process-oriented approach to visualize some important information about the system, including: the execution of the system, the execution of the system, the use of the system, the flow of information and the transformation of data from input to output. A DFD can be used to understand an approximate boundary of the system and demonstrate the system and external interfaces, the input and output of data, and the storage of data.

1.2.2 Data Dictionary

Data dictionaries are the core of structured analysis methods. A data dictionary is an organized list of all system-related data elements, and the definition of data elements must be precise, rigorous, and unambiguous, allowing users and system analysts to have a common understanding of input, output, storage, and intermediate results.

The function of a data dictionary is the exact interpretation of a named graphical element that appears in a dataflow diagram (DFD), usually an entity contains information such as: ① name, ② alias, ③ use, ④ content description, ⑤ comment information.

1.2.3 State transition Diagram

A state transition diagram (STD) indicates how the system will act as the result of an external event. STD is the foundation of behavioral modeling. Additional information about software control is included in the Control Protocol (CSPEC). It describes the state of the object in a timely manner, which focuses on the system's time-dependent behavior. The state transition diagram is derived from the modeling of real-time systems. The state transition diagram looks very much like a streaming chart, however, there is an essential difference between them. The data flow diagram focuses on the process of dataflow and data transformation, while the state transition graph focuses on the description of the state, such as the start state at the time of the excitation and the status of the result after the system executes the response. The condition of the state transition diagram corresponds to the input data stream of a process, and also to the outflow of the control flow.

1.2.4 Entity one contact model:

The entity-A-link model is used to simulate the interrelationship of the questions of system data components. The entity-A-link model is independent of the current system state and is not related to the specific computer programming language.

1.3 Structured Programming (SP):

(1) advocating the use of order, selection, circulation of three basic structures to nest together into a complex hierarchy of "structured programs", strictly control the use of goto statements. Programs that are programmed in this way have the following effects on the structure:

A. In the control structure, there is only one entrance and one exit, so it is possible to understand this part independently.

B. Ability to read program text sequentially from top to bottom in a controlled structure.

C. Because the static description of the program and the implementation of the control process is easy to correspond to, so it is convenient to correctly understand the action of the program.

(2) "from top to bottom, gradually refinement" of the design idea, its starting point is from the overall goal of the problem, abstract low-level details, first focus on the structure of high-rise, and then a layer of decomposition and refinement. This allows the designer to grasp the subject, strategically advantageous position, and avoid getting into the complex details from the beginning, making the complex design process simple and straightforward, and the result of the process easy to be correct and reliable.

(3) "Independent function, single-out, inlet" module structure, reduce the interaction between the module can be used as a plug-in or building blocks, reduce the complexity of the program, improve reliability. When the program is written, the function of all modules is implemented by the code of the corresponding subroutine (function or procedure). The main body of the program is the sub-program level library, which corresponds to the abstraction level of the function module, and the coding principle makes the program flow concise, clear, and enhance readability.

2. Object-oriented approach

The object-oriented approach is to simulate the objective world from the internal structure, whose basic idea is that the object is the description of the objective entity of the real world, which is composed of its attributes and related operations, and is the basic unit of the system description. The object-oriented approach emphasizes the use of methods and principles commonly used in everyday logic, such as abstraction, classification, Inheritance, aggregation, encapsulation, etc., which enables software developers to think more effectively and express themselves in a way that others can understand.

2.1 Object-oriented analysis (OOA)

2.1.1 OOA Overview:

1. Recognize the object and its properties.

2. Recognize the whole of the object and its components.

3. The formation of objects and the distinction between classes.

4. Understand the problem space and abstract it into a model.

The five phases of 2.1.2 OOA: identifying objects, identifying structures, identifying topics, defining properties, defining services, The object-oriented analysis model is set up in five levels. The advantage of object-oriented analysis is that the unified concept and method of function analysis and data analysis are used to overcome the inconsistency and uncoordinated of the two.

The main principles of 2.1.3 OOA:

(1) Abstraction: Discarding individual, non-essential features from many things, extracting common, essential features, called abstraction. Abstraction is the necessary means of forming a concept.

The abstract principle has two meanings: first, although things in the problem domain are complex, analysts do not need to understand and describe everything about them, only to analyze the things that are related to system goals and their essential characteristics.     Second, by abandoning individual things in the details of the differences, extracting their common characteristics and get a group of things abstract concept. Abstraction is the most widely used principle in object-oriented methods. Abstract principles include two aspects of process abstraction and data abstraction.

Process abstraction means that any sequence of operations that completes a deterministic function can be viewed by the user as a single entity, although it may actually be done by a series of lower-level operations.

Data abstraction defines data types based on actions applied to the data, and limits the value of the data to be modified and observed only by these operations. Data abstraction is the core principle of OOA. It emphasizes the combination of data (attributes) and operations (services) into an irreducible system unit (that is, an object), and the outside of the object simply needs to know what it does without knowing what it does.

(2) Encapsulation is the combination of the object's properties and services into an irreducible system unit, and as far as possible to conceal the internal details of the object.

(3) Inheritance: The object of a particular class possesses all the properties and services of its general class, called the inheritance of a special class to a generic class.

(4) Classification: is to classify objects with the same attributes and services into a class, using classes as an abstract description of these objects.     The classification principle is actually a form of representation when an abstract principle is applied to an object description. (5) Aggregation: Also known as Assembly, the principle is that a complex thing as a number of relatively simple assembly of things, thus simplifying the description of complex things.

(6) Association: It is the method of thinking that people often use when they think about a problem: associating it with something else. The reason that people can be associative is that there is a certain connection between things.

(7) Message communication: This principle requires that objects communicate with each other only through messages, and not directly outside the object to access properties inside the object. Communication through messages is caused by the encapsulation principle. In OOA, a message connection is required to represent a dynamic relationship between objects.

(8) Granular control: In general, people in the face of a complex problem domain, can not be at the same time to look at the overall situation, but also insight autumn hair. Therefore, it is necessary to control its own field of view: When considering the overall situation, pay attention to its large components, temporarily unknown to each part of the specific details, consider a part of the details of the rest of the temporary aside. This is the principle of granularity control.

(9) Behavioral analysis: The behavior of things in the real world is complex. The various behaviors in a problem domain consist of a large number of things that are often interdependent and intertwined with each other.

2.2 Object-oriented design

The main work of 2.2.1 Object-oriented design:

Object-oriented design is a kind of software design method, and it is an engineering norm. There is no doubt about it. The main tasks of object-oriented design include:

1. Determine the desired class.

2. Provide a complete set of operations for each class.

3. Explicit use of inheritance to demonstrate common ground.

2.2.2 The main principles of object-oriented design:

1. Modular

The object-oriented development method naturally supports the design principle of decomposing the system into modules: The object is the module. It is a module that combines the data structure and the methods of manipulating these data together.

2. Abstract

Object-oriented methods not only support process abstraction, but also support data abstraction.

3. Information hiding

In the object-oriented method, information hiding is realized by the encapsulation of the object.

4. Low coupling

In object-oriented methods, the object is the most basic module, so the coupling mainly refers to the degree of correlation between different objects. Low coupling is an important criterion for design because it helps to minimize the impact of changes in one part of the system on other parts.

5. High cohesion

It includes operation cohesion, intra-class cohesion, general-specific cohesion.

Solid principles are the specific implementation and requirements of the above principles, which are no longer detailed here:

SRP

The single Responsibility Principle

Single Responsibility Principle

Ocp

The Open Closed Principle

Open Closure principle

Lsp

The Liskov Substitution Principle

The principle of the Richter replacement

DIP

The Dependency inversion Principle

Dependency Inversion principle

Isp

The Interface segregation Principle

Interface Separation principle

The main tasks of the 2.2.3 object-oriented design are as follows:

1. Refinement of object definition specifications

For object-oriented analysis, classes, and pooled analysis documents, object-oriented design needs to be organized and refined according to the design requirements, so that it can meet the needs of object-oriented programming.

2. Data model and database design

The design of the data model needs to determine the class, the content of the object properties, how the message is connected, the system access, the method of the data model, and so on. Finally, the data for each object instance must be implemented into the object-oriented library structure model.

3. Optimization

The optimization design process of object-oriented design is to summarize the analysis result and processing business process from another angle, and optimize including the optimization, abstraction and integration of object and structure.

2.2.4 Object-oriented design paradigm-UML class diagram (with our group's soft design as an example)

3 Comparison and summary:

Structured method is a system function modeling, based on functional decomposition design system structure, from the internal function of the simulation of the objective world, its model is more intuitive, simple, readable, conducive to customer and developer communication, can be a complex system with a number of independent requirements to meet the small module to achieve, Can effectively improve the quality of software development. Object-oriented approach is modeled from the point of view of behavior, based on the behavior analysis method to identify the object and the relationship between them, from the internal structure of the simulation of the objective world, it adopted a new concept, a new method, a new representation, easy to code reuse, system reconstruction, facing the change of requirements can be more easily to respond. However, in practical applications, the development of large-scale software system is usually a hybrid system, that is, the need to process real-time information and database support, but also involves a large number of transactional operations requests, in this case, in the selection of object-oriented methods and local processing can be combined with a structured approach.

4. References

[1]. Zhangli, Qiu. Comparative analysis of structured methods and object-oriented methods [J]. Journal of Shaanxi Normal University (natural Science Edition), 2001, 29 (2): 29-32.

[2]. Wang Hanhao, Sega Sheng, Shang. Software development Method--the comparison between structured method and object-oriented method [J]. Science and technology information, 2011, 13:052.

[3]. Zhu Peidong Carambola Bar. Comparison of object-oriented methods and structured methods [J]. Computer and modernization, 1995, Phase I.

[4] Zhang Haipan. Introduction to Software Engineering [m].5 Edition. Tsinghua University Press, March 2008.

[5] Bi Zhongdong, Lau. Object-oriented software engineering and object-oriented modeling method [J]. Fujian Computer, 2007 (8).

Comparison between structured and object-oriented methods

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.