The application comparison of structured method and object-oriented method

Source: Internet
Author: User
Tags dashed line

The development of software plays a vital role in the development of the whole software industry, and it is necessary to support various development tools, development methods and development processes in the development process. Whether it is development tools, development methods or development process, has been constantly evolving and updating. In the development of software development methods, there are many well-known development methods, such as structured method, prototype method, Jackson method for data structure, object-oriented method, etc. Among them, the structured method and the object-oriented method are two kinds of widely used software development methods, in the future software development process, there may be some better software development methods, such as the current service-oriented software development method, but for the time being, The structured approach and object-oriented approach are still the two most widely used development methods in the software development process. In this paper, the structure of the method and the object-oriented approach is described in detail, and then the two methods are compared to analyze the merits and demerits of the different problems.

1. Structured approach

Structured method is a traditional software development method, which is composed of three parts: structural analysis, structured design and structured coding. Its basic idea is to carry out the process of solving a complex problem in stages, and this decomposition is from top to bottom, decomposition by layer, so that the problem of each stage processing is a relatively independent and easy to analyze module. C language is a very typical structure of high-level language.

1.1 Structural Analysis (SA)

The structure analysis method gives a set of principles and techniques to help the system analyst to produce the function specification, which is a requirement analysis method. It generally uses the graphic to express the user's needs, the means of use mainly include Data flow chart, dictionary, decision table and decision tree.

1.1.1 Streaming Chart

Data flow diagram is a hierarchical method of establishing a logical model of a system, which depicts the transformation process from input to output in a graphical way from the point of view of transmitting and processing. It can be used to reflect the flow, processing and storage of information in the system by using a few kinds of symbols. The data flow diagram is abstract and generalized.

The streaming diagram is represented graphically, so each particular shape has its own specific meaning, so the flow chart contains specific elements:

→: Data flow. is composed of a set of data of a fixed composition, but cannot change its value, the direction of the arrow represents the flow of data, the origin and end point of the arrows represent the source and destination of the data stream, respectively. In addition to the flow of data to or from the data store does not have to be named, each data flow must have the appropriate name to reflect the meaning of the data flow.

-: External entity. Representing entities outside the system, which can be human, physical or other system software, he points to the origin of the data or the data that the system generates, i.e. the source of the data and the destination to which the data will eventually arrive.

0: Processing the data. Processing is a unit of data processing, which accepts certain data input, processes it, and produces output.

=: Data storage. Represents the static storage of information, which can represent a file, a part of a file, an element of a database, and so on.

The top-level streaming chart for an online bookstore management system

The production steps of the streaming diagram are:

The source and end point of the data stream are determined by the external entity;

From the input flow of external entities, according to the logic needs of the system, some column logical processing process is drawn, until the output stream of external entity is found and the data flow is closed.

The internal data processing of the system is regarded as the whole function, and the internal information processing, transmitting and storing.

Such a level of analysis, until all steps are very specific.

1.1.2 Data Dictionary

A data dictionary, which is a descriptive information created for the data, is designed to provide a detailed description of the elements in the data flow diagram, defining and describing data items, data structures, data flows, data storage, processing logic, external entities, and so on.

1.1.3 Decision Table

A decision table is a tool for analyzing and expressing situations that perform different operations under multiple logical conditions. It is a table, the leftmost column contains all the decision items and action names, the upper right side is the combination of all conditions, and the lower right represents the table entry that performs this action under the current condition.

1.1.4 Decision Tree

A decision tree, also known as a policy tree, is suitable for describing problems in dealing with multiple judgments, and each decision is related to several conditions. When using decision tree to describe, we should distinguish from the textual description of the question which are the judging conditions, which are the decision-making, according to the conjunctions in the descriptive material to find the subordinate relation, the side relation, the choice relation, and construct the decision tree according to them.

1.1.5 Analysis Steps

① analyzes the current situation and makes a DFD that reflects the current physical model;

② deduces the equivalent logical model of the DFD;

③ Design new logic system, generate data dictionary and primitive description;

④ establishes the human-machine interface and proposes a DFD for the physical model of the target system;

⑤ determine the cost and risk levels of the various programmes and analyze them accordingly;

⑥ Choose a scheme;

⑦ establish a complete requirements specification.

1.2 Structured design (SD)

Structured design, that is, according to the SA method of the flow chart to establish a good module structure diagram (such as SC diagram), the use of modular design principles to control the complexity of the system, that is, the design of the module is relatively independent, module structure diagram depth, the width is appropriate, single inlet single exit, A software structure diagram or a software hierarchy block diagram of a single-function modular structure. This method provides a tool to describe the software system, and puts forward a standard for evaluating the quality of the modular structure, that is, the more loosely the connection between the modules, the better the connection between the components in the module is more compact. The final task is to transform the flow diagram DFD from the requirements analysis into a system structure diagram (SC).

The following principles are followed for structured design:

Abstraction of ①

Process abstraction: Treat any one completed function as an entity

Data abstraction: Data can be described at different levels

② from top to bottom, gradually refine

In a top-down manner, the process details and data details of each level are refined by layer.

③ Modular

Divide the entire system into several simple, independent modules

1.2.1 Overview Design

Based on the result of demand analysis, a specific system design scheme is constructed, which determines the module structure of the system (including the partition of the decision module, the data transfer between the modules and the call relationship).

1.2.2 Detailed Design

Detailed design is the process design, on the basis of the overall design, determine the internal structure and algorithm of each module, resulting in the program flow chart of each module.

1.3. Structured encoding (SP)

As an important stage of software manufacturing Engineering, program coding is the continuation of programming. The quality of program code is directly related to the external design of software system and the quality of internal design, meanwhile, the characteristics of programming language and the coding level of programmers, the readability, maintainability, Reliability and testability of program code are all factors that directly affect program quality.

Structured coding using top-down, gradual refinement of the method, the first global, after the local, first overall, after the details, first abstract, after the specific, gradually refinement, the program has a clear logical hierarchy, easy to read, understand, modify and maintain, can improve software quality, improve software development success rate and productivity.

is the form of structured coding, and this form of coding is usually implemented in the form of a function

Down to continue subdivision

2. Object-oriented approach

When it comes to object-oriented methods, we have to mention object-oriented, so what is object-oriented? Object-oriented refers to a programming paradigm, and also a method of program development. An object refers to a collection of classes. It takes the object as the basic unit of the program, encapsulates the program and data to improve the reusability, flexibility and extensibility of the software. Object-oriented approach is based on object concept, Object-centric, class and inheritance as the construction mechanism, to recognize, understand, depict the objective world and design, build the corresponding software system method.

2.1 Object-oriented analysis (OOA)

The object-oriented analysis phase is determined by the behavior analysis method and the relationship between them. Object-oriented analytic models are typically modeled using UML's modeling approach.

2.1.1 Use case diagram

Use use case diagrams to describe system functions from a user's perspective and to indicate the operator of each function. A use case diagram is a sequence of behavior-related things that a user executes when using a system, which is done in a session with the system.

Use case diagrams include two elements for use cases and roles, connections between roles and use cases, use and extension relationships among use cases, and the ability to identify different use cases through role execution cases.

2.1.2 Class Diagram

The class diagram describes the classes in the system and their relationships with each other, which essentially reflects the types of objects in the system and the various static relationships between the objects.

2.1.3 Sequence diagram

A sequence diagram represents the order of interactions between objects. is to represent the interaction as a two-dimensional graph. The vertical is the timeline, and the time extends downward along the vertical bar. The horizontal axis represents the meta roles of individual objects in collaboration. The class meta role is represented by a lifeline. When an object is present, the character is represented by a dashed line, and the lifeline is a double-lane when the object's procedure is active.

2.1.4 Activity Chart

Describes the activities that are required to meet the functional requirements of a use case. Is the workflow that illustrates the implementation of the business use case. The business workflow illustrates the work that a business must accomplish to provide the value it needs to the business actors it serves. Business use cases consist of a series of activities that collectively generate certain artifacts for the business lead. Workflows typically include a basic workflow and one or more alternative workflows. The structure of the workflow is illustrated using the activity diagram.

2.1.5 Follow the principle

Abstraction: A property that focuses on an object for an analytical purpose and ignores other parts that are unrelated to this purpose. Abstraction is an important method for us to study and deal with complex problems scientifically. Abstract mechanisms are used in data analysis, called Data abstraction. Data abstraction is the core of OOA. The data abstraction consists of a set of data objects and the actions that act on them as a program entity. Makes the external only know how it is done and how it is expressed.

Encapsulation: The information is concealed. It means that in determining a part of the system, it should be taken into account that the information and connections of other parts are carried out within this part, and that the information links between the external parts should be as small as possible.

Inheritance: Refers to the ability to directly acquire existing properties and features without having to define them repeatedly. OOA can specify the public properties and methods of an object at once, and then to special and extend these properties and methods to a particular situation, which can greatly alleviate the duplication of work in the system implementation process. On the basis of common attributes, inheritors can also define their own unique attributes.

2.2 Object-oriented design (OOD)

Object-oriented design and object-oriented analysis adopt a consistent concept, principle and presentation method, there is no big difference between the analysis of the document to the design document conversion, the two do not emphasize the strict phase division. The relationship between the two is a new software life cycle model-fountain model (), in which the analysis and design of the two blisters indicate that OOA and ood do not have strict boundaries, they are continuous, seamless, allow a certain degree of intersection (some jobs can be seen as OOA, Can also be thought of as Ood).

Object-oriented design method is an intermediate transition link in Oo method. Its main role is to further standardize the results of OOA analysis so that it can be directly accepted by OOP. That is to determine the object structure, properties, methods and other content, the previous model optimization and so on.

2.3 Object-oriented encoding (OOP)

Object-oriented programming is a programming paradigm and a method of program development. An object refers to an instance of a class. It takes the object as the basic unit of the program, encapsulates the program and data to improve the reusability, flexibility and extensibility of the software.

3. Structured approach and object-oriented approach

As two kinds of classical software development methods, the structure method and the object-oriented method have advantages and disadvantages. The structured method is based on function decomposition and abstraction, and its model is simple, easy to read, good for customers and developers to communicate, 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. However, due to the constant changes in user demand, these modules are vulnerable, it is possible because of a small change in the user, the entire module needs to be rebuilt, which greatly reduces the maintainability and reusability of the software.

Object-oriented method is mainly object-based interaction, data-centric to describe the system, the data relative to the function, there is more stability, so the model can be directly mapped out the source code, easy system maintenance and system component reuse, greatly improve the software development efficiency, more easily adapt to change. But not all projects are suitable for the development of object-oriented methods, such as in large-scale information management system, if the lack of the overall system module design division, easy to cause the system of the structure of the various modules unreasonable, and modeling will be relatively complex, difficult to understand, the correctness is difficult to guarantee.

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.

The application comparison of structured method and 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.