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

Source: Internet
Author: User

First, Introduction

With the rapid development of computer hardware and software, the concept and method of computer field are changing rapidly. In the 70 's, it was thought that the structural method was the best method of system development, however, with the development of computer application technology, the structure method could not adapt to the construction of information system which is becoming more and more complicated and rapid development. Since the 80 's, the object-oriented approach (objecorientedmethodology) has aroused more and more attention and attention, and a new wave of object-oriented programming has been set up in the working. So what is the difference between the two approaches, and what are the pros and cons?

Ii. structured approach

1. Definition

The structural method, also called SD method, is a traditional software development method. This means that the solution of a more complex problem is divided into a number of stages, the process of the stage is a top-down, from the abstract to concrete, the problem by layer decomposition process, the final implementation is the bottom-up, the first local after the whole process.

2. Process

The development process consists of the following five phases:

System Planning Phase: The scope of this phase is the entire business system, the purpose is to determine the priority of the system from the perspective of the entire business.

System Analysis Stage: mainly includes feasibility analysis and requirement analysis. The scope is a single information system development project included in the development plan. The goal is to analyze business problems and define business requirements.

System Design phase: The purpose of the system design is to design a computer-based technology solution to meet the needs of the user's business. The main task of the overall design is to construct the overall structure of the software, including human-machine interface design, database design and program design.

System implementation phase: The purpose of the system implementation is to assemble the information system technology components, and finally make the information system to run. The work content is program design, program debugging, user training, switch between old and new system, etc.

System operation and Maintenance phase: The aim is to maintain the system so that it can operate normally.

3. Content

The content of structured method includes three parts: structural analysis, structured design and structured programming.

3.1 Structural Analysis

Structured analysis involves converting a system concept to a data and control representation, which translates to a data flow chart. Structure diagram refers to the call relationship of the module as a clue, with a top-down line to represent the call relationship and note the direction and content of the parameter transfer, from the macro to reflect the software hierarchy structure of the graph, Data flow chart (diagram,dfd/data flow chart), is a tool for describing the system data flow, which abstracts the data independently and graphically describes the context and actual flow of the information. The basic components include four components of the system's external entities, process, data storage, and data flow in the system.

An external entity is a person or thing that is related to a system other than a system and can describe the source and place of the data.

Processing is the logical processing of data that can be used to change data values.

Data flow refers to the input and output of the processing process, which belongs to intermediate data.

Data storage refers to where data is saved.

3.2 Structural Design

Structured design, also known as SD (structured design), is a data-flow-oriented approach designed to determine the structure of the software. The structure diagram (sc:structure chart), which reflects the system's functional implementation and the connection and communication between modules and modules, reflects the overall structure of the system. Note: Data flow DFD is one of the structural analysis methods in the definition phase of the software life cycle, in addition to the data Dictionary (DD), decision tree, and decision table, and SC is the method used in the development phase of the summary design.

3.3 Structured programming

When programming, should first consider the whole, after considering the details. The complexity of the problem is gradually refined, modular.

Iii. Object-oriented approach

1. Definition

The object-oriented approach (Object-oriented method) is a methodology based on the concept of "object", which applies the object-oriented idea to the software development process and directs the development activities of the system method, or the OO (object-oriented) method. It is object-oriented to directly face the objective things in the problem domain to develop the software. An object is a package of data and allowable operations that directly correspond to an objective entity, and an object class defines a set of objects with similar properties. Each inheritance is a way to share the properties and operations of classes that have hierarchical relationships. The so-called object-oriented is based on object concept, Object-centered, class and inheritance as the construction mechanism, to recognize, understand, depict the objective world and design, build the corresponding software system.

2. Basic steps

(1) Analysis of all the objects and their properties of space and reconciliation of problems

(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) Determine the inheritance between the classes, the public nature of the objects placed in the higher 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. Ooa method

That is, object-oriented analysis method, refers to the development process of the system after the business investigation, according to the object-oriented thinking to analyze the problem. When the investigation results are analyzed and processed by the Ooa method, it is generally based on abstraction (focusing on the nature of the object for a certain analytical purpose), encapsulation (information masking), inheritance (obtaining the existing nature without redefinition), correlation (linking the errors that occur at a certain moment or in the same environment), Message communication (information is transmitted between objects).

4. Ood method

Object-oriented design method. The main role is to further standardize the results of OOA analysis. Mainly includes the specification refinement process, the model and the database.

The refinement process of the specification consists of two aspects: first, it is necessary to organize and analyze the object structure, attributes, methods and so on according to the object-oriented concept model, correct the wrong contents, delete unnecessary and repetitive contents, etc. The second is to classify, so that the next step of database design and program processing module design needs.

The comparison of characteristics between structured method and object-oriented method

1. Common Ground

Let's first analyze the similarities between the two.

First, both methods involve decomposition and abstraction. Decomposition, is the problem by Dahua small, from difficult to easy. The content of each layer is designed only by considering the relationships between the elements of the layer, without considering the specific implementation of each element. To solve the problem by layers is a necessary way to solve larger and more complicated problems, after all, no one can solve a difficult problem directly in the mind without a step-by-step thinking. At this point, the object-oriented approach is exactly the same as the traditional structured approach.

As far as I am concerned, I wrote the first large-scale process program is the compilation of technical lessons, using recursive descent subroutine method. This method is typical.

Secondly, in the localization and reusability of these two points, the two methods are also consistent. Localization means that you do not want a part of your software code to affect the entire program too much. In structured methods, localization is mainly embodied in the separation of code and data. That is, each part of the program in addition to the necessary data information exchange, isolation from each other. The object-oriented method adopts the encapsulation of data and code, which improves the reliability and security of the program.

Then again, the difference between the two.

The first is that the two have different starting points when dealing with problems. The structural method emphasizes modularization and process, and is a process-oriented development method. The object-oriented approach emphasizes that the point of the problem domain is directly implemented on the interface between the object and the object.

Secondly, the basic unit of the structured method is the module, and the object-oriented method is the class, which focuses on the design of the class content and the inheritance and development between the classes.

Again, the structured method of designing the program theoretically any code can access any data that can be accessed. While object-oriented programs emphasize encapsulation, non-public data and methods have access restrictions.

Five, personal experience

The above content is I study through the information, reading the literature method. I have not formally expressed my personal experience of what I have learned.

As far as I am concerned, I wrote the first large-scale process program is the compilation of technical lessons, using recursive descent subroutine method. This method is a typical structured method designed by the program. The language grammar itself can be seen as a pointer to the compiler's small Dahua. Top down to each of the grammatical components of a subroutine is a recursive descent subroutine core idea, design each subroutine process, is also the problem decomposition, by Dahua small process. In the end, it was a great convenience for me to do my homework.

As for the object-oriented approach, I don't want to say more. We wrote a series of small-scale object-oriented programs in the sophomore semester. Take the elevator procedure as an example, we first put the problem to elevator, dispatcher, passenger three more specific classes, and then clear the relationship between the three: the passenger generated the request, the scheduler for three elevators dispatch request, elevator execution request, the three is essentially about the request data constantly interacting, forming an executable system. After learning the object-oriented software development method again, looking back at the past and becoming an experience, I have deepened my understanding of the object-oriented approach.

As to which of the two methods is better, I think it's hard to say. Different problems, suitable to be solved in different ways. For example, the elevator system, to think of it as several different parts of the operation, interaction is obviously easier for programmers to grasp the nature of the problem. It is not possible to think of it as a flowchart, but the flowchart can be very complex, and it is easy to draw mistakes or omissions. For the compiler, it is obviously more appropriate to analyze the process structure according to the grammar. If you really want to say that according to object-oriented thinking to write compiler, is nothing more than a parser, symbol table and other classes and their interaction problems. While the grammatical analysis occupies the majority of the problem, when they are considered by the object, but feel better according to a module, the process to consider, this is my thinking.

Vi. Reference Documents

Comparison of traditional software engineering methods and object-oriented software engineering methods--Hongxia Liu, Liugongyan

The comparison of structured programming method and object-oriented programming Method--Chamme

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.