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.