Summary of design patterns-the programmer's secret of Martial Arts (I)

Source: Internet
Author: User

More than a thousand years ago, humans used physical power to expand their territory and obtain food. Later, people learned how to use tools and started to use stones and sticks. Later, with civilization, the quality of the body was not the only condition for determining strength and weakness. Later, some smart people joined the philosophical thinking based on their fighting habits, and invented martial arts based on the principles of attacking, advancing, and moving, and rigid and flexible practices. Even if some people with poor physical fitness, learn the appropriate martial arts according to your own situation and become a martial arts master. Thanks to those who have invented the secret of martial arts, and to the development of society for the demand of martial arts talents. Up to now, humans have invented a fire gun, and even a disabled person can beat a man to death. This was unimaginable in the past.


A few decades ago, computers were just invented and people used them to solve some simple problems. Programmers compiled some short code to implement some short functions. Their writing process is as casual as they are. As the society's demand for computers and their functions increases dramatically, the problems left to programmers are getting bigger and bigger. At this time, not every programmer can compile qualified software, and people are in a software crisis, only a few days can use their own wisdom to solve the problem. They reached an agreement to find a solution to the problem for future generations to learn. So that we can achieve a certain level by studying Programming Technology for several years. With the emergence of these "martial arts secrets", the requirements for programmers are getting lower and lower. People can use good tools and write code by understanding principles and patterns. I believe that, over the past few decades, programmers will be able to write code by making a sentence in their mouths.


With the study of "Design Patterns", I think this discipline is the secret of the martial arts of programmers. It is the crystallization of the wisdom of our predecessors and tells us the various problems we may encounter and solutions. From machine language to advanced language, from process-based development to object-oriented development, this is a manifestation of the complexity of software development and the embodiment of technological advances.


One of the complexities of software development is the variability of requirements. Process-oriented functions are implemented by dividing functional modules and calling functions. When requirements change, you need to change the functions. The changed functions may be called in multiple places and associated with multiple types of data, it makes code maintenance and debugging difficult at the airport. The emergence of object-oriented programming methods solves the problems brought about by changes. Object-oriented objects focus on objects. They can define what they are responsible for and do what they want them to do. Developers understand requirements as one object, and then create these objects so that they can call each other until they meet business needs. At this time, if the demand changes again, We can encapsulate these change areas to isolate the code from the impact of the change.


With object-oriented technology, developers can use code design to minimize the impact of demand changes, but this also increases the difficulty of design and development. The complexity of object-oriented design puts the overall development into another dilemma. The emergence of the Design Pattern gives us a solution that enables us to stand on the shoulders of giants to solve complicated problems.

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.