In software engineering, a software design pattern is a general, reusable solution to a commonly occurring problem within a given context in software design. It is not a finished design that can be transformed directly into source or machine code. Rather, it is a description or template for how to solve a problem that can be used in many different situations. Design patterns are formalized best practices that the programmer can use to solve common problems when designing an application or system. - Wikipedia Software Design patterns
This weeks edition of Learning Computations gives you resources to learn design patterns
University courses on design patterns primarily focus on UML, understanding, and applying the patterns.
What really matters with these patterns? Understanding why and when a specific design pattern should be applied is what counts. Sounds easy right? Often times it proves to be quite challenging in the real world. Having experience with patterns is what helps you understand when to apply them. How do you get experience? You get experience from applying them in real applications. Reading about them in a book helps, but isn't going to be enough to know when you should apply them.
Design Patterns: Elements of Reusable Object-Oriented Software Is commonly referred to as the GoF (Gang of Four) it's considered a huge influence in object oriented design. Typically when people think of design patterns they're actually thinking of the patterns presented in this book. The book motivates the need for patterns, and presents 23 of them. Most resources today borrow ideas from this book or re-hash the patterns in it. New patterns have obviously emerged as time has gone by, but if you want the ideas of modern day design patterns right from the source this is where you'll want to go.
Refactoring.guru Is a comprehensive resource on the typical 23 GoF design patterns. On top of it's analysis it also provides important context other resources fail to mention like history, criticisms, and when not to use patterns. Each pattern is presented with a problem motivating it, a solution to the problem, UML diagrams, code, and more. Refactoring.guru contains all the information and more in it to learn about design patterns.
Do Factory Is a simple resource on design patterns. I'd describe it as a reference with only essential information. They cover all of the GoF patterns, provide UML diagrams & code examples in C# for each one. It doesn't attempt to do anything past this. If you don't understand UML the class diagrams won't make that much sense, but you can pick up most of it just from the code they present.
Design Patterns For Humans Attempts to describe design patterns in simple terms. The great part of this is no UML diagrams. It's just code and words. It doesn't try to be overly sophisticated. It just tries to get the points across. It covers all of the essential design patterns, motivates each pattern with a real world example, and tells you when you should use it.
Wikipedia's Software design patterns is another comprehensive resource for learning patterns. I've found that wikipedia isn't always a great resource for learning, but in this case it is. Wikipedia provides great context around patterns to help frame your learning. It does so more than most other resources here. It has pages on all the typical design patterns and others as well. Most pages on specific patterns include UML diagrams, code, and a pros and cons section.
It helps to know UML for some of the resources so I'm going to link to where you can learn about UML.
Wikipeida Class Diagrams - This covers everything you'd need to know about UML for the above resources.
Mosh Design Patterns - This is part of a video course on design patterns that didn't make the cut for me, but there is an excellent section on UML about 36 minutes in. It explains most of what you need to know about UML for design patterns.
You now have a handful of resources you could use to learn design patterns. Where do you start? To answer that question you should know where you want to end up. I provide two learning paths below. One is for functional use i.e. being able to understand and to identify where you can use patterns. The other is going past functional use i.e. becoming advanced. Be warned design patterns don't always lead to the best design, and can even lead to over engineering your application if you use them improperly.
In order to be functional with design patterns you have to understand them on a fundamental level. What does this mean exactly? It's knowing what each design pattern is good for and where it can be used. To do this you really need to understand how to use patterns. Often reading about patterns isn't enough. Just reading about the pattern makes it make sense in the moment, but when you encounter them in the wild you'll be baffled. You need to go the extra step and implement them. Once you actually implement the patterns and use them, you'll become much more familiar with them and their use cases. To sum it up
In order to get to a more advanced level you'll need real engineering experience with patterns. Obviously to do this you need to apply them in real applications. Only through reaping the benefits and suffering through the mistakes in an application can you get this experience. Realistically this means try to use design patterns as much as possible where applicable. That's not an easy thing to do depending on what kind of application you might be working on. Frameworks already have their own patterns they try to get you to conform to, but there is no reason that an application can't be composed of multiple design patterns. Having this experience will allow you to understand future scenarios, and how patterns can help or hinder you application.
That's all I got for design patterns! Hopefully you learn something from these resources!