In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/03 Report--
Whether it is useful or not depends on your degree, what problem you mainly solve, and what part you are responsible for.
If you haven't reached that level (you're still learning how to program), you're naturally confused.
It helps a lot if you are responsible for or involved in or related to the application framework (all or a small part of it).
Of course, if you are not good enough, you can also improve yourself by learning design patterns.
But you have to take it one step at a time, and there's no hurry.
Usually start with a pattern that you often encounter related to the problem you are dealing with, one at a time
Unless you find that you are fit to learn it all before using it, I am not, so I choose to learn one at a time.
What most people often talk about on the Internet are singles and factories. These guys.
I didn't learn from these, so I don't talk about them most often.
I was the first to learn that the most commonly used and most often asked subordinates to use in my work is the strategic model.
Because we often have to deal with the situation of "one problem, two implementations".
For example, a function is required to support both serial communication and TCP communication, but it is better for callers not to know the difference between them.
This is a typical strategy pattern scenario.
It's perfectly normal to encounter this kind of situation more than a dozen times a year.
Therefore, it is impossible not to learn, and it is impossible not to learn.
When faced with this kind of problem, I asked them to use the "strategic mode" to solve it.
I won't say too much, just these four words.
I asked them, I said these four words, they need to understand what it means and how to do it, I directly want the results.
At first, they were confused and miserable when they heard me say that.
I force them to learn, usually in one night (because the concept of strategic model is not difficult at all)
Of course, they actually eat through it several times, but as I said, they will always learn when they meet more than a dozen times a year.
The first mode of learning in life must be very difficult. It would be nice for them to get used to my instructions after a long time.
As soon as they got used to the first model, I began to increase the patterns they would use, usually asking them to learn when they actually used it.
Over the course of a year, they will have an average of three. (forget to mention that they have just been on the job for 1 to 2 years.)
In our company, they are generally the first to learn the strategy pattern, the observer pattern (also known as the event mechanism) and the adapter pattern.
When I told you about my job, I said:
This problem should be dealt with in the way of "events" in order to achieve. Effect.
Or, this class provides "events" for other classes to call
Despite the simplicity of the "incident", some newcomers have to toss about at least four or five times before they finally understand what to do.
The first time to learn, at least go home to think (side Baidu) 3-4 days to understand.
A new employee, I ask him to use the event mechanism to solve, the first 2-3 times will be a little patient guidance
For the fourth time, if he doesn't know it, I'll get angry, and then look at it, and he will. (yes, the anger is intentional, put pressure on him.)
This is the actual situation in which they learn the first few patterns and can apply them.
During this period, about a year.
So far, do you think the design pattern is useful?
Of course, everyone's situation is different, and this is not necessarily the case with the learning process.
The key point is that as long as you are in this business, you must generally use some of these patterns.
When you learn a few and use them, you will understand after a long time.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.