Structured methods and object-oriented

Source: Internet
Author: User

structured methods and object-oriented

Structured methods:

structured method is a common method of software development. The main point is that a complex problem of the solution process in stages, the decomposition is top-down, a complex large problem is divided into a number of less complex small problems, and then solve each. using three kinds of basic control structure construction program, any program can be ordered, select, loop three basic control structure construction.

The basic idea of structured method is mainly embodied in three aspects.

First, top down:

Divide a system and program into different levels. From the overall beginning of the problem, the abstraction of the underlying details, the first to build a high-level structure, and then a layer of decomposition refinement. This makes the complex design simple, avoiding the complexity of the details from the beginning, and the result of the process being easy and reliable.

Second, Modular:

The function of the system is divided into separate modules, the module and the module through the interface between the transmission of information, the module only a small number of mutual connection, the module can be used as a plug-in program, the function of all modules through the corresponding subroutine Code (a function or procedure) to implement. The main body of the program is the sub-program level library, which corresponds to the abstraction level of the function module, and the coding principle makes the program flow concise, clear, and enhance readability .

Third, the structure of the statement:

program flow follows a simple hierarchical model , which consists of sequential structure, branch structure and cyclic structure.

Object-oriented approach (object-oriented Method)

Object-oriented approach is a systematic approach to the application of object-oriented ideas in the process of software development, which guides the development activities, for short OO (object-oriented) method is a methodology based on the concept of "object". An object is a package of data and allowable operations that directly correspond to an objective entity, and an object class defines a set of objects with similar properties. Each inheritance is a way to share the properties and operations of classes that have hierarchical relationships. The so-called object-oriented is based on object concept, Object-centered, class and inheritance as the construction mechanism, to recognize, understand, depict the objective world and design, build the corresponding software system.

The basic idea of object-oriented approach is embodied in the following aspects:

The object in the objective world is a certain relationship between objects, and complex objects consist of simple objects.

Two, objects with the same properties and operations belong to a class, and an object is an instance of the class.

Third, inheritance, a class directly following the full description of other classes, can be modified and expanded.

Iv. encapsulation, the user can only see the external characteristics of the object, can accept the information, what processing power, and the object's internal characteristics are hidden. The user does not need to know the details of the behavior implementation, but only accesses the object with the information provided by the designer.

Five, polymorphism, the same message for different objects can produce a completely different action . The user can send a generic message, leaving all implementation details to the object receiving the message at its own discretion .

Six, emphasize the full use of the people in the daily logic of thinking and principles often used. For example: Abstraction, classification, inheritance, aggregation, encapsulation, association, etc.

comparison of main features

Features of the structured approach:

(1) logical design and physical design separate;

(2) emphasizing the stage evaluation in the development work;

(3) The development process to form a set of standardized documents, facilitate the late modification and maintenance ;

(4) The system thought of hierarchical decomposition was adopted;

(5) The system development of each stage of the results to control, can not adapt to changes in the requirements of things ;

(6) long development cycle of the system ;

Features of the object-oriented approach:

(1) The concept of object and transitive message expressing the relation between things and things respectively

(2) The method is to allow various operations on the class object

(3) separating the definition of the object and the implementation of the object by encapsulation

(4) the relationship between class and class is embodied by inheritance

comparison of advantages and disadvantages

advantages and disadvantages of the structured approach

Advantages of a structured approach:

1) from the system as a whole, emphasizing the "top-down" analysis and design under the condition of overall optimization, to ensure the integrity of the system and the consistency of the target;

2) structured approach emphasizes functional abstraction and modularity. Because it takes the method of chunking problem, it can decompose a more complicated problem into several easy-to-solve parts, which reduces the difficulty of problem processing.

3) emphasis on the integrity and sequencing of the development process, emphasizing the strict distinction between the development phase, rigorous system analysis and design, timely summary, timely problem feedback and correction, so as to avoid the chaotic state of the development process.

4) document standardization, according to engineering standards to establish standardized documentation, easy to maintain the software in the future. And because the structured method is clear, clear, and effective decomposition of the complex problems, making the program is clearly clear, but also greatly simplifies the programmer's complicated work.

The lack of a structured approach:

1) Poor reusability: Structural analysis and design clearly define the interface of the system, when the system changes to the external interface, it may cause large changes in the system structure, it is difficult to expand the new function interface;

2) Poor software maintainability: Due to the poor software modification, resulting in maintenance difficulties, resulting in maintenance costs and high costs, maintainability of the poor;

3) It requires the system developers in the early investigation to fully grasp the user needs, management status and anticipate the changes that can occur, which is not in line with the gradual understanding of the objective regularity of the affairs.

advantages and disadvantages of object-oriented methods

the advantages of the object-oriented approach:

1) object-oriented closer to reality, can be from the reality of things, the appropriate abstraction. , all objects are endowed with properties and methods, and the result is more humane in programming.

2) The object-oriented approach can be reused to reduce the external impact on the interior. Encapsulating the data and behavior of the object as a whole to deal with, so that other parts of the object can not freely access the object's internal properties, so as to effectively avoid the impact of external errors on it, greatly reducing the difficulty of troubleshooting and troubleshooting.

3) Easy to expand, high code reuse rate. Easy to expand, in the case of a large frame is easy to develop suitable for their own functions, easy to achieve, can effectively reduce the maintenance of the program, software development efficiency is high.

The disadvantage of the object-oriented approach.

1) low performance. Because of the higher level of logic abstraction, it is very expensive to compute the time and space storage size when the object-oriented is implemented and the sacrifice of performance is made.

2) If you blindly emphasize encapsulation, when you modify the object inside, any property of the object will not allow external direct access, you want to add a lot of no other meaning, only responsible for read or write behavior. This adds to the burden of programming, increases operational overhead, and makes the program look bloated.

Summary

Both the structural method and the object-oriented approach have advantages and disadvantages.

The structured approach is clear, targeted, and suitable for well-defined software development, such as compilers, operating systems, can get the required programs in a clear development process, and have good performance, but the changes are easy to reaching, not conducive to maintenance and modification.

The object-oriented approach is more flexible, the development cycle is shorter, the user and maintainer are more likely to understand the program, the maintainability and reusability of the software are better, the cooperation between different teams is facilitated, and the software changes quickly according to the change.

In the specific application, the appropriate method should be chosen according to the characteristics of the project.

Structured methods and object-oriented

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.