Design patterns, a staple of job interviews, are a perennial issue. To be honest, there are very few examples of how classic design patterns work in a real framework. Maybe some of them are, but we don’t know which design pattern they’re using.
I’ve asked people around me, programmers who have worked for years, even leaders, and some of them think, I don’t need it at all. It’s a voice. Others think it’s important, but have too many tasks to learn. There are some more half-finished, said two minutes can not go on to say, of course, Daniel is also a lot of, all kinds of answers have, anyway, in order to better programming to improve the programmer’s personal literacy, in order to catch up with the big guy’s footsteps, xiaobian from 0 to start learning with everyone, progress together.
The concept of design patterns in software development was first mentioned in 1994 by Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides. Here are Four authors, collectively known as GOF (Gang of Four).
1. Open and close principle
Open for extensions, closed for modifications.
2. Richter’s substitution principle
Subclasses can do this in place of base classes.
3. Rely on the inversion principle
Programming for interfaces relies on abstraction rather than concreteness.
4. Interface isolation principle
Using multiple isolated interfaces is better than using a single interface. (Reduce coupling between classes)
5. Demeter’s Rule (Least Know Rule)
One entity should interact with other entities as little as possible.
6. Single responsibility
A class should have only one reason to change, one responsibility.
The article continues to be updated at ⛽️. Additional blogger arranges + original 150 thousand literal test questions, including 17 special topics. Follow “Java Junior talent show” reply to “Interview” to obtain the Java junior talent show interview notes. PDF
This article is formatted using MDNICE