A comparison of structured methods and object-oriented methods

Source: Internet
Author: User

A comparison of structured methods and object-oriented methods

As we all know, the structured method and the object-oriented method are the two major design methods in the current programming, and when we write the program, we choose the appropriate method to develop according to the program we write, to get the maximum efficiency. In this paper, the characteristics and process of the structured method and the object-oriented method are analyzed and compared, and the merits and demerits of the two methods are analysed.

I. Structured approach

The structured method is composed of three parts: structural Analysis (SA), structured Design (AD), and structured programming (SP) according to the life cycle. The system is decomposed into several sub-function modules according to functional requirements, and the sub-modules continue to decompose, so that the module function becomes very specific, and the synthesis becomes single. This decomposition from top to bottom, decomposition by layer, so that the process of processing each stage is the user can understand and processing.

1. Structured Analytics (structured analysis)

Structured analysis has been widely used since the 80, and this analytical approach transforms abstract system concepts into data and control representations, namely, the transformation of a dataflow diagram (DFD), using a DFD to describe the relationship between the boundary and the data processing process.

The structured analysis steps are as follows:

① analyzes the current situation and makes a DFD of the current physical model.

② deduces a DFD with an equivalent logical model.

③ designs A new logical system that generates data dictionaries and primitive descriptions.

④ establishes a human-machine interface to determine a DFD for the physical model of the target system.

1.1 DFD

A data flow diagram is a tool for describing a system's process, which abstracts data independently and graphically describes the flow of information.

The data flow diagram has 4 main elements: traffic, data sources, processing of data and data storage. In the sealed-layer DFD, the middle and underlying streaming diagrams are numbered starting at 0, in addition to the top-level streaming diagram. The structure of a layered DFD is as follows:

1.2 DD

A data dictionary is a directory of record databases and application metadata that users can access. is an important tool in the analysis phase, providing an explanation of data that people do not understand. In structured analysis, the data dictionary defines and describes each component on the flow chart. An entity typically includes the following:

Name, alias, purpose, content description, comment information.

  2. structured Designs (structured design)

In the structured design, according to the data flow chart obtained from the structural analysis, the program structure, structure, details and interface details are refined to get the design description of the program structure, which is presented in the form of system structure diagram (SC). In the design process, the module structure diagram is used to express the relationship between the modules. For building a module structure diagram, the principle is that the closer the internal connection of the module is, the better the separation between the modules.

Main steps into the following:

① review and refine the streaming chart.

② determine the type of the streaming diagram.

③ maps the flow diagram to the software architecture module and designs the superstructure.

④ based on the flow diagram to decompose the high-level module, design the middle.

⑤ optimizes the structure of the module and obtains a more reasonable software structure.

⑥ describes the module interface.

Ii. Object-oriented approach

The basic idea of an object-oriented approach is to use an object as a basic unit to define its properties and operations. It can be said that the object-oriented approach is to consider the problem from the perspective of human thinking, making the software development process become more specific and easier to understand. The object-oriented approach has three main features: encapsulation, inheritance, and polymorphism.

In object-oriented, each class is equivalent to a template, with this template produced by the object is one of the objects, of course, in the production process to make appropriate modifications are also possible, of course, the final physical possession of the basic properties and uses are basically similar. This kind of development is more conducive to understanding, such as we can be a physical property and function abstraction, to generate a class of properties and methods, on the external exposed interface, when an external instantiation of an object and call the interface, you can say what the realization of what function, in line with ordinary people's way of thinking.

1. Object-oriented Analysis (OOA)

Using the use case diagram, the system functions and the operators of each system function are described from the user's perspective, and then the static model of the system is constructed to construct the system structure. Finally, the system's behavior is described according to the timing state or the interaction relationship, and the dynamic model of the system is constructed. The specific process is as follows:

① Determining the problem domain

② Area Classification and objects

③ distinguish the whole object and the components determine the relationship and structure of the class

④ Defining properties and services

⑤ to determine additional system constraints

  1.1 Use case diagram (UseCase diagram)

  A use case diagram is a view of the system's functionality that is established by the actors and use cases and their relationships, and is primarily used to model the functional behavior of systems, subsystems, or classes.

  1.2 Timing Diagram

  A time series diagram describes a dynamic process that shows dynamic collaboration between multiple objects by describing the chronological order in which messages are sent between objects. Each message in a sequence diagram corresponds to a class operation or a departure event that causes a state change.

  1.3 Class Diagram

  The class diagram shows the classes, interfaces, and the static structure and relationships between them, which are used to describe the structured design of the system. Its most basic element is the class or interface.

2. Object-oriented design (OOD)

The ultimate goal of object-oriented design is to establish the connection between each module within the system, which is usually implemented through an interface. Each module through the interface to build up a dependency, can greatly improve the reusability of the module, if you want to use the function of a module, to implement the interface. The process is as follows:

① improving and perfecting the structure of system analysis

② design interaction process and user interface

③ Design task management and how subsystems and tasks are coordinated

④ Design Global resources to determine resource allocation for tasks or subsystems

⑤ Object Design

Three. Comparison of two different methods

As the structural design is process-oriented, the overall thinking in the design process will be more clear, the goal is clear. In the design process, the system function is decomposed into many sub-modules, the stage is very strong, so it is more convenient to develop and maintain, improve the quality of software. Inverse object-oriented approach, in the development of the system is more complex cases, the interaction between the various types may be more difficult to analyze. In the aspect of module reusability, the structured design is process-oriented, so it is basically not reusable, when the demand changes or new requirements, often need to modify a lot of related code, which may cause structural changes, and the object-oriented approach, benefiting from the three characteristics, facing the new requirements only need to modify the relevant classes can be, There is no big change in the structure of the system. In collaborative development, structured development often does not facilitate communication between developers, because the logic between each part is very strong, but more abstract, and the class is very specific, so the communication between developers can be more fluent.

  

A comparison of structured methods and object-oriented methods

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.