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

Source: Internet
Author: User

I. Structured approach

Structure of it originates from the structure programming, has the function-oriented, the structure is clear , supports the gradual refinement , The software is easy to maintain the characteristic. It consists of three parts: Structured analysis (SA), structured design (SD), and structured programming (SP) .

the basic principle of structural analysis method is the top-down, the whole after the local, first abstract after the concrete, gradually refinement. The abstraction at the highest level refers to a solution that uses terms described in the domain of the problem to be solved. The gradual refinement refers to the strategy of developing the program system by continuously refining the program details of the hierarchy. The basic idea of structured analysis method is to decompose a big problem into several small problems, and each small problem is decomposed into a few smaller problems. After each layer decomposition, the problem of each of the lowest layers is simple enough and easy to solve, thus solving complex problems. The structured analysis method needs to be oriented to application and decomposition, with the following steps: (1) to analyze the current situation and make a reflection of the current physical modelDFD; (2) The equivalent logical model is deduced.DFD; (3a new logical system is designed to generate a data dictionary and a primitive description;4The human-machine interface is established, and the physical model of the target system is proposed .DFD; (5) to determine the cost and risk levels of the various programmes, and to analyse the various programmes accordingly;6) Select a scenario;7) to establish a complete requirements specification.

The basic principle of structured design method is modularization, centralization and decentralization first, decomposition and re-integration, and refinement gradually. Its basic idea is based on the documents generated during the structured analysis phase (including data flow diagram, dictionary and software requirements), from top to bottom, and gradually refinement and modularization. Structured design can usually be divided into outline design and detailed design. The task of the outline design is to determine the structure of the software system, divide the module, and determine the function, interface and the call relationship between the modules. The detailed design task is to design the implementation details for each module. Structured design method to refine the analysis results, transition software structure, the steps are as follows: ( 1 2 3 4 5 6

The basic principle of structured program design is that it is from the outside, the whole after the local, first abstract after the concrete, gradually refinement. The basic idea is to design a module of the implementation algorithm, through the gradual refinement, and finally get a detailed implementation algorithm. Single-entry single-exit control structure, which makes the static structure of the program consistent with the dynamic execution process, has a good structure and enhances the readability of the program. The core technology of structured programming: three basic logic constructs to express the whole process of the program. are: Sequential: Provides the core processing steps in any algorithm rule description; Conditional: Allows you to select the processing mode according to the logical situation; repeat: provides support for loops.

Ii. Object-oriented approach

Object-oriented approach is a systematic approach to the application of object-oriented thinking in the process of software development, which is based on the concept of "object". It consists of object-oriented analysis (OOA), Object-oriented design (OOD), object-oriented implementation (OOI) .

The object-oriented analysis phase needs to address the following issues: The functions that the system should provide to fulfill the user's requirements, what objects the system should have, what properties and services each object should have, and how the objects should be connected. The activities that need to be carried out are individual feature analysis, static analysis (two kinds of relationship between object systems), dynamic analysis (analysis objects and their behaviors and their control relationships). In this stage, the application and characterization of the problem, the specific steps are:(1) Determine the problem domain, including the definition of the domain, the choice of the domain, according to the need to refine and increase the domain ; (2) distinguish between classes and objects, including defining objects, defining classes, naming ; (3) distinguish the whole object and component, determine the relationship and structure of the class ; (4) defining attributes, including determining properties, scheduling properties ; (5) define the service, including determining the state of the object, determining the required services, determining the message junction ; (6) determines the additional system constraints.

The object-oriented design phase needs to do the following: (1refinement to improve the original class and properties: The refinement of the required parts include attributes (some properties are only needed to understand, some properties are required to implement the algorithm), services (specifically implementedOOAService Interfaces), classes and structures (tuning inheritance, composing relationships, and which classes will raise which classes create objects), object behavior (explicit implementation algorithms for message passing between objects, determining the order of messages sent between objects based on the dynamic model, and designing the appropriate algorithm to coordinate the behavior of the object). (2complete the application control, human-Computer Interaction interface Design: Specifically, the design of the interface subsystem (i.e. the design of class and inter-class structures related to interfaces, and the design of algorithms), the design of interface between the interface subsystem and the application, and the design of the Application Control section (mainly to complete the driving work of the application). In this phase, we need to refine the analysis results and supplement the reality, the concrete steps are:(1)Using object-oriented analysis, the results of system analysis obtained by other methods are improved and perfected.(2)Design interaction processes and user interfaces; (3)Design task management, based on the previous step, determine whether multiple tasks are required, determine concurrency, determine how tasks are driven, design subsystems and coordination and communication between tasks, prioritize; (4)Design Global Resources, determine boundary conditions, determine hardware and software allocation of tasks or subsystems;(5)Object Design.

The object-oriented implementation phase is to encode the implementation of the software functions, including: the implementation of the internal functions of each object, the establishment of the object which some of the processing capacity should be described in which classes, determine and implement the interface of the system, the form of output and other control mechanisms, etc. In short, it is the task that should be done to achieve the various objects stipulated in the design phase. In the process of encoding implementation, it is relatively easy to implement object-oriented design using object-oriented language. If object-oriented design is implemented in non-object-oriented languages, special attention should be paid to the object-oriented structure of the reserved program.

Third, Comparison

Because the structure method is aimed at the function, according to the function divides the system into several modules, this causes when the function changes, often causes the local modification to affect the entire system to change greatly, its expansibility is poor, and because the structure method data and the operation has separated, Therefore, some reusable software structures can only be used in certain environments, so reusability is low. The object-oriented method can reuse code because of its inheritance, encapsulation, polymorphism and so on, so it has good extensibility and reusability. But at the same time, because its encapsulation will mask the execution details inside the object, when errors occur, the cost of locating the fault is relatively greater.

The structured method is refined gradually, and a big problem is decomposed into small problems, emphasizing function abstraction and modularization, block processing, reducing the difficulty of processing, but at the same time, the information description that needs to be processed will be more and more complicated before the nature of the problem is described. The object-oriented approach requires an attempt to abstract a more common class, which takes more effort to refine the functional responsibility of each object, and is more difficult to master than a structured approach.

In the process of writing, the structured approach is clear, methodical, tidy, streamlined, simplifies the programmer's work, facilitates reading comprehension, and in a user-focused approach, the object-oriented approach is consistent with the human habit of thinking, so users are easier to understand, operate, and have a clear interface, making software easy to use.

Iv. Reference Documents

[1] Baidu Encyclopedia

[2] A study on the Tanjialing of structured method and object-oriented binding

[3] A comparative study of structural methodology and object-oriented methodology in software development Shinghong

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.