A comparison between structured methods and object-oriented methods
Software engineering is inseparable from the development method, software development method refers to the project investment scale and time limit, design, achieve the user needs of high-quality software, according to the characteristics of software development, put forward a variety of software development strategy. Since the 1960s, due to the development of the syndrome "software crisis", software development methods continue to develop rapidly, resulting in a number of well-known development methods, such as structured methods, prototype model-based VDM (Vienna Development) method, object-oriented approach. Among them, the structure method and the object-oriented method are the most representative, in the field of software development is widely used, the following we will explain and compare the two methods.
Let's take a look at what a structured approach is and what an object-oriented approach is. As the name implies, the structural method pays more attention to the function of the structure in software development, and it analyzes and designs the system from the point of view of the hierarchy and from top to bottom. Structured methods include structured analysis (SA), structured Design (SD), and structured programming (SP). In general, it is the decomposition of the functions of the system, the formation of different modules, and then according to the specific modules of the structural design and programming, so that a large and complex system can be divided into a relatively simple part, to achieve easier. The structured method is a method of demand analysis oriented to data flow, and the main tools used in this paper are dataflow diagram DFD. The approximate step has two steps, first constructs the concrete system design scheme, determines the system the module structure. The second step is the detailed design, based on the overall structure to determine the structure and algorithm of each module.
Figure 1 Streaming diagram
Object-oriented (OO) approach refers to the method assembly of software development centered on object-oriented thought, and the object-oriented idea originates from Simula computer simulation language. The object-oriented approach is software development based on object-oriented languages such as Simula language, Smalltalk language, and now widely used Java and C + + languages. In object-oriented methods, objects and classes are the most basic concepts, objects are the things that the system should study, it has certain state, and realizes the combination of data and operation. A class is an abstract description of an object that has the same properties and operations. The object-oriented approach also includes three parts: object-oriented Analysis (OOA), Object-oriented design (OOD), and object-oriented programming (OOP). Now the more widely used object-oriented approach is based on the Unified Modeling language UML,UML mainly includes: basic building blocks, rules and public mechanisms. There are four kinds of common relationships in UML, namely dependency, correlation, generalization and implementation.
Diagram two UML class diagram example
After a certain understanding of the structured approach and the object-oriented approach, we discuss the differences and linkages between these two approaches in terms of ideas, principles, and software development to deal with problems.
Thought: The idea of structured method has three aspects, the first aspect is top-down, this is a kind of layered thought, from top to bottom the whole system is divided into different levels; The second aspect is the modular idea, which divides the whole system into different modules according to the function, the software development according to the module, the module is connected by the interface. The third aspect is the structure of the statement, no longer use goto statement, so that the programming language to form a certain normative structure, such as circular structure, sequential structure. The main idea of object-oriented method is the object-oriented one, which is composed of simple objects, and the problems to be dealt with in the system are regarded as objects. Objects with the same properties and operations belong to a class, with classes that resemble a structured hierarchy, can have subclasses, and can inherit all of the properties of the parent class and have their own properties and actions. Classes are encapsulated, and internal properties and operations are hidden. Object-oriented thinking emphasizes abstraction, inheritance, and encapsulation.
In principle: both structured and object-oriented methods follow abstract principles, but their specific content is different. The abstract principle of structured method refers to ignoring the system-independent content and focusing on the system essence. Object-oriented abstraction is the abstraction of objects in object-oriented, which distinguishes them from other objects. Both structured and object-oriented are guided by modular principles, and a complex system is divided into simpler modules by function. The structured approach also follows the decomposition principle, which is layered and resolved from top to bottom. The object-oriented approach also follows the encapsulation and hierarchy principles. Encapsulation is the separation of the object's external and internal operations, and the public part sees only the outer characteristics of the object. Hierarchies are formed from abstract sets, including type hierarchies and structural hierarchies, which help to discover abstract relationships and understand the nature of the problem.
The way to deal with the problem: the structured approach is process-centric in software development, is a process-oriented development approach, and object-oriented emphasizes the relationship between object and object, which is more in line with people's thinking of dealing with the problem when facing the objective world. The Structured method abstracts the problem of the objective world into the process that can be handled by the computer, solves the problem by the method of systematic science, and the object-oriented method simulates the objects in the objective world by computer, which is more intuitive. The structured method processes the data through the program, the control relationship between the modules, the object-oriented data and code is encapsulated, the other object can not modify its data, can only be done by its own functions. Both of these methods are composed of more complex systems, which are more easily implemented.
After discussing the difference and relation between the structured method and the object-oriented method from these three aspects, we summarize the advantages and disadvantages of each of the following. The advantage of the structured method is that it is more reasonable to consider the problem, first determine the main system functions, then go through the layers, from simple to difficult, gradually a general structure to materialize, and finally realize its function. Structured modularity makes the problem less difficult, the development of software ideas clearer, and the program is more concise, more readable. The advantage of object-oriented method is that the thinking of developing software is consistent with human thinking method, and the user is easier to understand. Because of the object-oriented encapsulation, the local changes will not affect the overall system function, make the manager debugging and maintenance is also very convenient, reliability is higher. The object-oriented method also uses the idea of modularization to decompose complex problems into small independent problems, which reduces the difficulty and cost.
Because of the constant decomposition of a whole problem, the conditions and information to be processed will be more and more, sometimes it will cause trouble to the developers, which requires them to have the ability to look at the problem from the whole, which also makes the complex problem that the structure method can deal with has some limitations. And as the software to continue to develop, the user's needs are constantly improving, the system's functional modules need to be modified, the structure of the system will be modified due to local changes, that is, the need to redesign the modification, the development cycle is too long, not conducive to maintenance. Object-oriented is very convenient for users, but it is very demanding for developers to abstract objects. For the establishment of objects not only to be accurate, but also comprehensive, and meet the requirements of the module, if the overall module division is unreasonable, the function will have a great impact. Object-oriented encapsulation also poses some difficulties in locating errors, and it is necessary to find out if each module is faulted. In addition, because the object-oriented model is very complex, UML diagram needs a certain degree of expertise to understand, making it difficult to communicate with customers or users.
The development of software system needs to choose the suitable method, object-oriented is the mainstream method of software development nowadays, and the characteristic of data flow requirement analysis of structured method has some application in the field of information management. In the development of software has never been said, we have to do is to improve the quality of software, reduce development costs, and fully meet the needs of users. Therefore, we can not blindly pursue new thinking, new methods, as long as it is in line with our actual development requirements, can be used, or a combination of various methods, such as the need to deal with real-time information and database support While there are a large number of operational requests system, the object-oriented approach to the body of the system embedded in a partial structure. In the actual software development process, we should choose the development method to use according to the specific situation, make the appropriate choice, apply to the development.
Reference documents:
[1] Zhangli, Qiu. Comparative analysis of structured methods and object-oriented methods [J]. Journal of Shaanxi Normal University (natural Science Edition) 2010 29.
[2] Lin Ling. Application and comparison of structured method and object-oriented method in modeling [J]. Electromechanical technology 2010:26-30.
[3] Zhou Min, Wang. Discussion on the combination of structured method and object-oriented method [J]. Science and Technology Innovation Herald 2012.
A comparison between structured methods and object-oriented methods