Software Engineering: Structured approach VS object-oriented approach

Source: Internet
Author: User

I. Basic concepts 1, structured methods

Structured method is a traditional software development method , which is composed of three parts: Structural Analysis , structured design and structured programming .

Basic idea: The solution process of a complex problem is staged in stages, and this decomposition is top-down, layered decomposition, so that each stage of processing problems are controlled by people easy to understand and deal with the scope.

2. Object-oriented approach

Object-oriented approach is a kind of method which is based on the concept of "object", which is applied in the process of software development and the system method of guiding development activities. 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.

Basic idea: Simulate the way of thinking of human habit as much as possible, make the method and process of developing software as close as possible to human understanding of the world, solve the problem method and process, that is, the problem space of describing problem and the solution space of realizing solution are as consistent as possible in structure.

Ii. comparison of the two 1, the basic unit is different

The basic unit of a structured approach is a module.

The basic unit of an object-oriented approach is an object.

2. Different analysis methods

  Structured analysis method is a data flow oriented analysis method based on function decomposition, which mainly uses the data flow chart, data dictionary and other tools to describe the relationship between the boundary and the data processing process, and seeks to find the description between function and function.

Object-oriented analysis is the understanding of the problem domain and the system, which is correctly abstracted into normative objects (including classes, inheritance hierarchies) and message-passing connections, and finally establishes a concise, accurate and understandable object-oriented model of the problem domain, which provides guidance for the subsequent object-oriented design and object-oriented programming. Object-oriented analysis usually establishes three kinds of models: Object model, dynamic model and function model. The object model describes the static structure of the system, determines the name of the class and the relationship between the classes, the dynamic model represents the instantaneous, the behavior of the system "control" nature, the object model of the object of the legal change sequence; the function model shows the dependence of the data in the system and the processing function of the data.

3. Respective limitations
(1) structured approach

I.Cannot directly reflect the problem domain: The structured Analysis approach focuses on data flow, emphasizing the flow of data and each process, not based on the things in the problem domain, breaking the boundaries of the various things, the analysis results can not directly reflect the problem domain, it is easy to conceal some of the problem domain understanding deviation.
II. Data and code lack of protection mechanism: a specific whole process data can be accessed either by manipulating the data, or by other processes, which creates a destabilizing factor for the program design, an unhealthy data modification, or a process call that can disrupt normal program execution processes or results.
Iii. Analysis and Design system: The result of structural analysis is Data flow chart, the result of structured design is module structure diagram. The representation of the two systems is inconsistent, the analysis document is difficult to correspond with the design document, so from the analysis to the design of the "transformation" process easily due to the misunderstanding of the design document and the user's original requirements are very far.
Iv.. The development process is complex: because of the structured approach separating processes and data into separate entities, programmers must always consider the format of the data to be processed when programming. For different data formats to do the same processing or for the same data format to do different processing needs to write different programs, and often can not effectively control the security of the data. If the program is expanded or upgraded, you also need to modify the functions a lot, so the reusability of the structure program is not good. Keeping data compatible with programs has become a heavy burden for programmers.

(2) Object-oriented approach

I. Development process management requirements High: In the object-oriented analysis process, the need for multiple iterations, the development process through the "modification-evaluation-re-modification" repeated.

Ii. system reusability is low: Object-oriented method, through information hiding and encapsulation, to block the execution details of the object, control the spread of errors, but when errors occur, the cost of locating faults is very high, it is difficult to obtain a highly reusable object-oriented software system design for the system with frequent demand changes.

Iii. developers are apt to replace the prototype with canonical system analysis: the lack of standardized documentation is not easy to maintain later.

Third, personal experience

When I write in C, I need to think about what I'm going to do, what I need to do, and naturally, to use different modules to do different things, and when I'm learning Java I need to think about a few objects, what attributes this object needs, what needs to be done, and what's the connection to other objects.

So in the design of C language structure, I was such a layer, gradually refine the design, the function is to use data flow to contact. In the real implementation, if it is found that the function is not perfect or can be more detailed, it is necessary to modify the sub-module from bottom to top, the workload is relatively large.

In the Java language design, I basically use the UML diagram design, there is no hierarchical relationship, each class is an object, the class contains the object's properties and objects can do things, between the classes by sending requests to communicate. I feel that the implementation is more convenient than the C language, its inheritance mechanism to improve the reusability of the Code, and in the function expansion, only need to design new objects, or on the basis of the original object extension.

  

Structured and object-oriented is the most essential method of program design in software engineering. The basic idea of structured programming is to divide the large program into several relatively independent and simple program modules, which take the process as the center, emphasizing the process, emphasizing the function and modularization, and accomplishing the corresponding tasks through the invocation and processing of a series of processes. Object-oriented programming is centered on objects, manipulating a series of related objects, sending messages to objects, performing appropriate operations on objects and returning results, emphasizing objects. In theory, the object-oriented program design method will produce better module cohesion and coupling characteristics, making the software easier to reuse and maintain. In terms of execution efficiency, the structured approach is more straightforward and efficient than the code generated by the object-oriented approach. From the scope of application, the structured method is suitable for the problem of less data and more operation. Time proves that the structured method is more adaptable to the function-oriented system like the operating system. Object-oriented approach is the opposite, for the database, information management, such as data-based and less operating systems, using object-oriented approach to describe better than a structured approach. In practice, the programming method focuses on all aspects of the software life cycle, from requirements analysis, overall design to coding, testing and maintenance, while the design method needs tools and environment support at all stages, so it is necessary to consider these factors when choosing the programming method.

Iv. Reference Documents
    1. Http://baike.baidu.com/view/551681.htm, Baidu Encyclopedia, structured approach
    2. Http://baike.baidu.com/subview/7867/11370681.htm, Baidu Encyclopedia, object-oriented approach
    3. Http://www.docin.com/p-725901488.html, a comparison between structured methods and object-oriented methods
    4. Comparison of process methods and object-oriented methods in program design, Fu Yujiang, 2008

Software Engineering: Structured approach VS object-oriented approach

Related Article

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.