Two principles of design pattern-notes in C # design patterns (1)

Source: Internet
Author: User

Borrowed from the school library 《C # design patterns: a tutorialThis book takes some time to read and write some reading notes here by the way. Although some people say that the book is not very good (I read a part of it, it is true that there are a lot of errors in the book, and it is obvious that there is a Java color, it seems that the characteristics of C # language have not been brought into play. I wonder if the author is not interested in the second version? Haha), but I have never systematically studied the design model. I just borrowed the Language C # I am interested in and this book to explore the reusable programming ideas here.

The design mode is from the book introducing the classic 23 Design Patterns 《Design Patterns: Elements of reusable object-oriented softwareIt seems that the author is four masters, including Erich Gamma. This book is also known as the gof (Gang of Four) book. The design pattern is a solution to the repeated problems in the object-oriented design. It is applied to our project using the pattern summarized by our predecessors over time, so that we do not need to repeat unnecessary work.

Both the book and the gof book refer to the two basic principles of design patterns: 1. Programming for interfaces instead of implementing them (program to an interface and not to an implementation ); 2. Use a combination of classes instead of class inheritance (favor object composition over inheritance ). These two points are exactly a lot of OOProgramViews that need to be changed.

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.