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

Source: Internet
Author: User

The structured method and object-oriented method are two main development methods in software engineering. Software development method is a kind of software strategy, which requires us to develop the target software in high quality within the required requirements. In the field of computer software, many new methods and techniques originate from the programming language. Prior to the author's understanding of these two methods is mainly in the aspect of program design, such as C language is a process-oriented structured language, and C++,java is an object-oriented language. For these two methods, the development of what we need to do separately, in-depth understanding of them, as well as the differences between them, is the author in this blog post discussion of the issue.

1. What is structured Method 1.1 overview

A common process that we need to follow in software development is to analyze and redesign, so we have structured analysis (SA) and structured Design (SD) on a structured approach. The structured approach is to analyze and design the system from top to bottom from a hierarchical perspective. In the analysis, our basic idea is to break up a big problem into a few small problems, and each small problem is decomposed into smaller problems. That is, we solve complex problems by decomposing each layer, so that each of the bottom-level problems becomes simple enough.

The principles of structured methods are abstract principles, decomposition principles, and modular principles. Decomposition principle and modularization principle needless to say, we decompose the functions of the system into modules and then implement them more simply, and abstract principles are also important in the analysis and design phase. The abstract process allows us to mathematically and computerization the actual problem, thus designing the target product.

1.2 Structural analysis and design

Structured analysis has a series of processes, including data analysis, functional analysis and behavioral analysis. Data modeling We are used to data dictionaries and entity diagrams, and data dictionaries, like the dictionaries of life, generally record every item of data in detail, as a data dictionary:

Figure 1-1 a data dictionary instance

In addition, by constructing the system E-r diagram in the analysis, the relation between each data with attributes is established, what is the name of the contact, and what properties of the contact itself are clearly displayed for us.

Steering function Analysis, one of the ways that we typically use is to draw a streaming diagram (DFD). The idea of layering is also taken when plotting a DFD, first drawing a DFD diagram at the top, and then expanding the local function, with the ultimate goal of clearly showing each function.

Figure 1-2 An example of a dataflow diagram

Go to structured design, here we need to build up a number of modules on the basis of previous analysis, and realize the independence of the function. We are based on the previous data flow diagram and other information to achieve a specific function structure, this is the essence of the structure of the method.

In general, the structural method focuses on the decomposition problem as a few sub-problems, in the analysis of the design, we focus on the expression of this aspect. Through the legend we have a magnifying glass in the form of a large problem localization, continuous decomposition and refinement to solve. Unlike "Elephant", we are a developer, and for this "elephant" we have a sense of the whole and then we approach every part of it. That is, for the system, we are from top to bottom, from shallow and deep, step by step in depth.

2. What is the object-oriented approach 2.1 OO overview

The core of object-oriented approach is object-oriented--object oriented. In the course of object-oriented modeling in the last semester, we had a preliminary understanding of this idea and realized the development of an elevator system. Now we need to apply the object-oriented approach to the design of software engineering.

According to Youden's exposition, object-oriented is established according to three construction rules: 1. Differentiate objects and their attributes; 2. Distinguish the whole object and its components; 3. The class that forms and distinguishes different objects. In our analysis design, objects and classes are the most basic concepts, objects are dynamic concepts and classes are static concepts. The object-oriented approach emphasizes the use of ideas and principles that people often use in everyday logic, such as abstraction, classification, inheritance, aggregation, encapsulation and so on, which enable software developers to think more effectively.

2.2 Starting from OOA

The object-oriented approach involves the analysis (OOA) and Design (OOD) that have consistent concepts, principles, and presentation methods. In comparison to Ooa,ood, the problem is considered more deeply due to the actual design level. As well as identifying objects, OOA simply abstracts the objective world, while Ood takes into account whether these practices contribute to the realization of system functions and non-functional satisfaction. Ood the essence and improvement of some classes in Ooa, and completed the design of application control and human-computer interface.

Then back to Ooa, a series of foundation work is not to be ignored. At this stage, we analyze the functions provided by the system, the composition of the system objects, the connections between objects, and the properties and services owned by each object. When describing the system functions, we establish a simple case diagram between the roles and use cases, which shows a direct relationship.

Figure 2-1 System administrator's use case diagram

Next, we build the system's static model according to the requirement to construct the system structure, the static model includes class diagram, object graph and package diagram. Class diagram is a kind of uml language that we often use, the class diagram describes the class in the system and its relationship with each other, its essence reflects the types of objects in the system and the various static relationships between objects, such as association, dependency, aggregation and so on. An object graph is an instance of a class diagram that uses almost the same identity as the class diagram, where the object graph shows multiple object instances of the class rather than the actual class, and package diagrams consists of a package or class that represents the relationship between the package and Baozhi. is a classic example of a class pattern:

Figure 2-2 Class diagram example

In Ood, the objects and their interrelationships are resolved. Ood to OOA.

3. Difference and Contact 3.1 contact

We have a vertical understanding of the structured approach and the object-oriented approach, and now we have a horizontal understanding of the differences and linkages between them. In this regard, we cannot confine ourselves to the implementation details of the two, but we should generalize from the perspective of a development method. As a development method in software engineering, both of them need to abide by the basic principles of software Engineering-"formalization principle", the abstract conclusion of the problem world should be expressed in formal language (graphic language, pseudo-code language). Based on the various tools and techniques we have learned, structured methods can be used to describe the system logic model by using Data flow diagram, System structure diagram, database Dictionary and entity relation diagram, and the object-oriented method can use class diagram, dynamic model diagram, function model diagram and so on. Secondly, whether it is a structured or object-oriented approach, we need to follow a certain development process, first of all to analyze the redesign, whether it is SA to SD or OOA to Ood, which is essential.

In addition, the good program design principles required in software engineering, such as abstraction, encapsulation, modularity, layering, typing, and permanence, are all common to both structured and object-oriented approaches, rather than specific methods.

3.2 Differences

However, the two different methods of analyzing the problem from the beginning and the different ideas that follow it decide that there is a big difference between them.

3.2.1 From the specific Design view

The first concern of the structure method is the function, emphasizing the module as the center, adopting the modularization, the top-down, the gradual refinement design process, the system is realizes the module function function and the process collection, the structure is clear and the readability is good. Each module may maintain a high degree of independence. The method of object-oriented approach is to start with the data, to describe the system with data as the center, to solve the practical problem by establishing some classes and the relationship between them, which requires the whole analysis of the objects in the problem domain. The relationship between classes and classes is designed to be more demanding than just a bunch of classes. This approach will show the advantages of object-oriented: Improve the reusability of the target system, reduce the life cycle of the next stage of work. Compared to a structured design approach, such as a function of a later system that involves minor changes, the workload can be very large, because multiple module functions that may be connected to the function need to be modified.

In addition, due to the existence of the database in our system, the structured method leads to the design of the module is often independent of the database structure, there is no mapping between the function module and the database logic mode, and the program and data structure are difficult to encapsulate together. The object-oriented system structure can be mapped to the

3.2.2 Viewing from System view

The difference between object-oriented and structured design leads them to look at the whole system in a different way. For object-oriented, this is a view:

Figure 3-1 System View

That is, the structure of the design of the function is directly decomposed to complete the requirements of the user function, in a sense more direct, and easy to produce results. While the object-oriented approach is closer to the nature of things, there is a big gap between the designer's system view and the user's system view.

When you first use an object-oriented approach, it can take longer than a structured approach, because developers have to spend a lot of time analyzing what the object is, what each object should be responsible for, and how well all of these objects work together to accomplish their goals. Of course, it's because of these jobs that developers get a deeper understanding of each object within the system, and the data is presented in a lively way before the developer.

3.2.3 from a problem point of view

From the above, we have initially seen the various differences and differences between the structured approach and the object-oriented approach, and we can get a new understanding from the point of view of our problem-solving. In the case of structured methods, we do not take the problems of the problem as the basic unit, but break the boundary between the various things and analyze them in the way of data flow, which is the analysis of the global pattern. Problems can become more difficult when the system becomes complex. In contrast, object-oriented problems materialize to each data entity.

Of course, the object-oriented approach also has problems that are limited to itself. When the objective boundary of our problem is vague and difficult to determine, the object-oriented method can hardly guarantee the validity of the software. Since our abstract process is abstracted directly into objects, including some description of the problem, the problem with object consistency must be handled well. Different system descriptors describe the same problem in terms of observation and cannot express different perceptions of the problem phenomenon, and the structure can show this aspect through the construction of a series of modules. From this point of view, object-oriented must be handled with the help of the underlying structure to improve the problem.

4. Overview

In this blog post, I mainly introduce the structure method and object-oriented method, as two kinds of methods widely used in software engineering, we need to learn their characteristics and can recognize the difference, in the actual processing problems, can not copy the two technical methods of the theory. But should according to the actual question, the question each aspect comprehensive consideration, to determine how we choose the method to carry on the software engineering development design. We need more time to integrate these two methods, take their essence, and constantly develop and progress. In the future, in the discipline of software engineering, there will be more scientific and more efficient development tools and technologies.

Reference documents

[1]. Software development methodology--a comparison between structured methods and object-oriented methods Wang Hanhao, Sega, Shang College of Mathematics and Computer Science, Mianyang Normal University, 2011

[2]. The comparison between the structured method and the object-oriented method in software engineering Horondan Wujin College, Jiangsu Rtvu, 2007

[3]. Comparative analysis of structured methods and object-oriented methods Zhangli, Qiu. Shaanxi Normal University School of Computer Science, 2001

[4]. The research of structured development method and object-oriented development method Huang Xiwei, Hu Jianjue Department of Radio Engineering, Nanjing University of Posts and Telecommunications, 1996

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.