Comparison between structured method and object-oriented method

Source: Internet
Author: User

1. Structured approach

The structured approach, which was proposed by DeMarco and others in the late 70, was designed to reduce errors in analysis activities and to establish a system logic model to meet user needs. The structured method is a software development method that emphasizes the rationality of the development method and the structure of the developed software, also known as the new life cycle method, which is the inheritance and development of the life cycle law and the combination of the life cycle method and the structured programming thought. The basic idea is to use systems engineering ideas and engineering methods, according to the principle of user first, from the beginning to the end according to the structure, modularization, from top to bottom to the system analysis and design.

1.1 Fundamentals of structured methods
    • Abstraction:

Common abstractions include process abstraction, data abstraction, and control abstraction.

Process abstraction: Any operation that completes a definite function can be viewed by the user as a unit entity, although the timing of the operation may be accomplished by a series of lower-level operations.

Data abstraction: As with process abstraction, allows designers to describe the details of data objects at different levels.

As with process abstraction and data abstraction, the control abstraction can contain a procedural control mechanism without having to specify its internal details.

    • From top to bottom, gradually refine:

The architecture of the software is structured in a top-down manner, and the process details and data details of each level are refined by layer, until the statement in the programming language can be realized, and finally the whole architecture is established.

    • Modular:

Decomposition of a software to be developed into a number of small simple parts-modules, each module can be independently developed, tested, and finally assembled into a complete program. This is a complex problem of "divide and conquer" principle. The purpose of modularization is to make the program structure clear, easy to read, easy to understand, easy to test and easy to modify.

    • Control Level:

Indicates the organization of the Program component (module). Control hierarchies are often represented by a hierarchy of programs (tree or mesh).

Depth: The number of levels of the program structure can reflect the size and complexity of the program organization.

Width: The maximum number of modules for the same layer module

Fan-out of a module: number of other modules called (or controlled) by a module

Fan-in of the module: Call (or control) the number of modules in a given module

Information masking: The composition of each program is concealed or encapsulated in a single design module, the definition of each module as little as possible to expose its internal processing, can improve the software's modifiable, testability and portability.

    • Module Independent:

Each module completes a relatively specific, independent sub-function, and the connection to the other modules is simple. There are two measures of measurement: coupling between modules and cohesion of modules. The module independence must be high cohesion and low coupling.

Coupling: The degree of connection between modules, the higher the coupling degree, the less independence of the module. The order of coupling degree from low to High is: non-direct coupling, data coupling, tag coupling, control coupling, external coupling, public coupling, and content coupling.

Cohesion is the tightness of the internal elements, the lower the degree of cohesion, the less the independence of the module. The degree of cohesion from low to high is: accidental cohesion, logic cohesion, instantaneous cohesion, process cohesion, communication cohesion, sequential cohesion, functional cohesion.

1.2 Methods of structured analysis

Steps for structured Analysis:

    1. Analyze the current situation and make a DFD that reflects the current physical model
    2. A DFD for the equivalent logical model is deduced
    3. Design a new logical system to generate data dictionaries and primitive descriptions
    4. Establishing the human-machine interface and proposing a DFD for the physical model of the target system to be selected
    5. Determine cost and risk levels for various scenarios and analyze them accordingly
    6. Choose a Scenario
    7. Establish a complete requirements specification.

Common Tools for structured analysis:

    • System diagram

    • Data dictionary

    • Data Flow chart

    • Structure diagram

2. Object-oriented 2.1 object-oriented features

Object-oriented has three main features: encapsulation, inheritance, polymorphism

    • Packaging

The so-called encapsulation, that is, to encapsulate objective things into abstract classes, and classes can be their own data and methods only let the trusted class or object operation, to the untrusted information hiding. Encapsulation is one of the object-oriented features and is the main feature of object and class concepts. Simply put, a class is a logical entity that encapsulates the data and the code that operates the data. Within an object, some code or some data can be private and cannot be accessed by the outside world. In this way, objects provide different levels of protection to internal data to prevent unintended changes to unrelated parts of the program or to use the private parts of the object incorrectly.

    • Inherited

Inheritance refers to a method that allows an object of one type to obtain the properties of another type of object. It supports the concept of classification by class. Inheritance refers to the ability to use all the functionality of an existing class and to extend these capabilities without rewriting the original class. A new class created through inheritance is called a subclass or derived class, and the inherited class is called the base class, parent class, or superclass. The process of inheritance is from the general to the special process. To implement inheritance, it can be implemented through inheritance (inheritance) and combination (composition). The concept of inheritance is implemented in two categories: implementation inheritance and interface inheritance. Implementation inheritance refers to the ability to directly use the properties and methods of the base class without additional coding; Interface inheritance is the ability to use only the names of properties and methods, but subclasses must provide the implementation;

    • Polymorphic

The so-called polymorphic means that the same method of a class instance has different manifestations in different situations. Polymorphic mechanisms enable objects with different internal structures to share the same external interface. This means that although specific actions are different for different objects, they can be called in the same way through a common class.

3. Pros and cons 3.1 advantages and disadvantages of a structured approach:

Because the modules are independent of each other, so when one of the modules is designed, it is not affected by the other modules, so it can simplify the original complicated problem into a series of simple module design. The module's independence also brings a lot of convenience to the expansion of existing systems and the establishment of new systems, as we can make full use of the available modules for building block-style expansion.

According to the view of structured programming, any algorithm function can be realized by the combination of three basic program structures consisting of program modules: sequential structure, selection structure and cyclic structure.

The basic idea of structured programming is to adopt the program design method of "top-down, gradual refinement" and the control structure of "single entry single exit". The program design method of top-down and gradual refinement begins with the problem itself, and after being gradually refined, the steps of solving the problem are decomposed into a structured program block composed of the basic program structure module. The idea of "single entry single exit" considers a complex procedure if it is only by the order, selection and circulation of three basic program structures through the combination, Nesting, the newly constructed program must be a single-entry, single-Exit program. Therefore, it is easy to write a well-structured and easy-to-debug program.

    • The whole idea is clear and the goal is clear.
    • The stage of design work is very strong, which is beneficial to the overall management and control of system development.
    • The problems and structural defects in the original system can be diagnosed in the system analysis.
Disadvantages:
    • User requirements are difficult to define accurately during the system analysis phase, resulting in many problems with the system being delivered.
    • The system development of each stage of the results to control, can not adapt to the requirements of the change of things.
    • The system has a long development cycle.
3.2 Advantages and disadvantages of the object-oriented approach:
    • Increased development efficiency
    • Easy to maintain
    • Easy to expand
    • Reduce labor costs
    • Facilitates deployment of development tasks. Because object-oriented thinking has decided that a project can be assembled by many subcomponents.
Disadvantages:
    • Loss of performance, including Time and space
    • The whole design is easy to appear cumbersome. The OOA requirements are quite high, if the lack of overall planning, it is easy to cause unreasonable structure, the relationship between the parts of the imbalance.
    • Limited to specific business, unable to extract analysis from the higher level of science.
4. References
    • Http://www.worldbestlearningcenter.com/aboutit/structured-analysis-design.htm
    • Http://baike.baidu.com/link?url=bUtTOm7fXVk-ZI25mwT1-tSeh-0Hxujxy6DYFEkYEtGDM7GhAAZM3BDR4uK4ZaLD87HSEuIN4_EWLrOwLEtyA_
    • Http://baike.baidu.com/item/%E7%BB%93%E6%9E%84%E5%8C%96%E7%A8%8B%E5%BA%8F%E8%AE%BE%E8%AE%A1
    • Https://www.tutorialspoint.com/object_oriented_analysis_design/ooad_object_oriented_analysis.htm
    • http://www.javalearningacademy.com/object-oriented-programming-concepts-as-a-story/
    • Https://en.wikipedia.org/wiki/Structured_programming
    • Https://en.wikipedia.org/wiki/Structured_analysis

Comparison between 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.