-
Notifications
You must be signed in to change notification settings - Fork 11
Update patterns.md #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
I wasn't sure if the names of the patterns (i.e. "strategy pattern") needed to be formatted in a certain way. I put most of them in "" when you refer to them by name.
A design pattern is nothing more than a strategy for writing your code when you have a particular problem. If you can start to identify which types of problems are solved by which strategies, you'll walk into situations and immediately know what to do. Learning these design patterns gives you: | ||
|
||
A) More tools in your developer toolkit when coding and | ||
B) A better understanding of core libraries like Symfony, which leverages design patterns frequently. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably float some text onto the screen that matches approximately (but not exactly) what I'm saying (we don't want it to feel like they're just watching someone read from a screen).
It's pretty cool to look at core code and say | ||
|
||
`Oh, I see what you're doing there. That's the | ||
decorator pattern.` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed this into a funny party reference - showing two simple cartoon people at a party chatting would be awesome :)
|
||
There are tons of design patterns and many of them will likely never be useful to you. They just won't ever apply to problems that you are facing in your real work. These design patterns fall into three basic groups. You don't need to memorize these, but it's a nice way to think about the three types of problems that design pattern solve. | ||
|
||
The first type is called "creation patterns", and these are all about helping *instantiate* objects. They include the factory pattern, builder pattern, singleton pattern, and others. The second is called "structural patterns". These help you organize things when you have a bunch of objects and you need to identify relationships between them. One example of a relationship would be a parent-child relationship, but there are *many* others. This one can be a little fuzzy, but we'll see *one* structural pattern in this tutorial - the "decorator pattern". The third and final type of patterns are called "behavioral patterns", which help solve problems with how objects communicate with each other, as well as assigning responsibilities between objects. That's a fancy way of saying that behavioral patterns help you design classes with one specific responsibility that can then work together, instead of putting all of that code into one *giant* class. We'll talk about *two* behavioral patterns - the "strategy pattern" and the "observer pattern". |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Float in text on the screen for each design pattern individually with some info about it. Again, it will approximately match what I'm saying, but should have different wording
|
||
Now that we've defined some of what we're looking at, it's time to get technical! We're going to use some of these patterns in a real Symfony project to do *real* stuff. We'll only cover a few of them in this tutorial, which are some of my favorites, but if you finish this tutorial and want to see more, let us know! | ||
|
||
All right, to get the most out of this tutorial, as always, you should definitely download the course code from this page and code along with me. After you unzip it, you'll find a start directory that has the same code that you see here. Pop open this `README.md` file for the set of details. This one's pretty easy. You just need run: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You'll see from other tutorials that we show a pre-done video of downloading the course code, then transition that into the real video in the PhpStorm editor app.
I wasn't sure if the names of the patterns (i.e. "strategy pattern") needed to be formatted in a certain way. I put most of them in "" when you refer to them by name.