"Code Encyclopedia" learning Abstract (v) Design of software construction (bottom)

Source: Internet
Author: User

This study is mainly in the design process of the inspiration method and design practice of some experience.

For detailed programming work, it is normal to expect deterministic behavior because software design is nondeterministic. Flexible and skillful use of a set of effective revelation methods (heuristics). becomes the core work of the reasonable software design.

1, in determining the design, the preferred and most popular method is the object-oriented approach , the main point of this method is to identify real-world objects and man-made objects. This process is divided into the following steps: Identify the object and its attributes, determine what can be done with each object, determine what each object can do to other objects, determine which parts of the object are visible to other objects, and define a public interface for each object.

2. abstraction is a capability that allows you to safely overlook some of the details at the same time as you focus on a concept .

People have been using abstraction, and when you call something a "house" rather than a combination of glass, wood, and nails, you are using abstraction. In terms of complexity, the main advantage of abstraction is that it allows you to ignore irrelevant details.

Excellent program apes are abstracted at the level of the subroutine interface, at the level of the class interface, and at the level of the packet interface. This allows for faster and more secure development.

3. The encapsulation fills the blank left by the abstraction . Abstraction is saying: "You can look at an object from the top of the details."

"And the encapsulation says:" Beyond that. You can't see the object at any other level of detail. "

4, when the inheritance can simplify the design of inheritance . The advantage of inheritance is that it can be very well assisted by abstract concepts. Inheritance is one of the most powerful tools in object-oriented programming. If used properly, it can bring great benefits, but assuming improper use, it also has great drawbacks.

5, information hiding is the first technical mission of the software is an especially important method of Revelation , because he emphasized the hidden complexity .

When designing a class, a key decision is to determine which features of the class should be visible externally. Which features should be hidden. The class is very much like an iceberg: seven-eighths is below the surface of the water, and you can only see one of the eight points on the water. The secret of information hiding is divided into two main categories: hidden complexity, hidden change source. The barriers to information hiding include: over-dispersion of information, cyclic dependence, the mistaken perception of global data in-class data, and perceived performance loss.

6 . Find the area where easy changes change. Adapt to these changes .

The process consists of identifying items that appear to be easy to change, separating the easy-to-change projects, and isolating the seemingly easy-to-change projects.

Common easy-to-change areas include business rules, hardware dependencies, input and output, non-standard language features, and so on.

7, keep loose coupling . The good coupling between the modules can be loosely enough to make a module very easy to use by other modules, so that the modules you create do not depend on or rely on other modules very little. The types of coupling include the parameter coupling of simple data, simple object coupling, object coupling (tighter), and semantic coupling (should be avoided as far as possible).

8. The design pattern refines Many ready-made solutions . Can be used to solve the most common problems in very many software development. Most of the problems are similar to the problems that have been encountered in the past. can be resolved using a similar workaround or pattern.

The advantage of design patterns is that design patterns reduce complexity by providing a ready-made abstraction, design patterns to reduce errors by institutionalizing the details of common solutions, and design patterns to provide enlightening value through the provision of multiple designs, and design patterns that simplify communication by elevating the design dialogue to a higher level.

Some good design practices:

1, design is an iterative process .

When you cycle through alternative designs and try a few different approaches. You will look at the problem at the same time from different perspectives at the top and bottom. This interaction between high and low levels is thought to be a benign motive force. The structure he creates is far more stable than a simple top-down or bottom-up structure. When you first try to come up with a design that looks good enough, please don't stop!

The second attempt almost certainly would be better than the first one.

2, divide and conquer, the program into different areas of concern , and then separate processing each region. If you have a dead end in an area, iterate.

3, the use of top-down and bottom -up design methods.

Top-Down is a general class that breaks them down into more detailed classes step-by-step. From the bottom up, start with what you know, find out the detailed objects and responsibilities, and find the universal objects. Step up. Both methods have advantages and disadvantages, but the two methods are not mutually exclusive-you will benefit from the synergy between the two.

4. building an experimental prototype can help infer whether a design approach works by writing code that is minimal and can be thrown away at any time for problem-specific design problems.

5, to learn to cooperate with the design , Three Stooges top of the last Zhuge Liang.

6, how much to do depends on the team's experience, the system's predetermined life expectancy, the reliability achieved, the size of the project.


"Code Encyclopedia" learning Abstract (v) Design of software construction (bottom)

Related Article

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.