The development of small dishes programming (12 No acquaintance difficult thing?) --Talk about design pattern Dimitri Law) _ Big design pattern

Source: Internet
Author: User
(Continuation of the article)

The next evening, the vegetable knocked open the door of the Big Bird house.
"Come back now." What do you think. Feel more at work on your first day. The Big Bird asks with care.
"Feel really much oh ... "It's a piece of cake.
"What's up," he said. Have you been wronged? Tell me what's going on. ”
"The grievance is not, feel the company atmosphere is not very good." I went to their company early in the morning, just as my supervisor went out of the company. Personnel Department of Xiao Yang let me fill out the form, took me to the IT department to pick up the computer, she introduced me to a ' Xiao Zhang ' colleagues know, said I and his office to pick up the computer procedures on it. Xiao Zhang is quite polite, is going to install the computer when, came to a telephone, told him to go to a client to deal with PC failure, he said to me and so on, back to help me get. I sat all morning and didn't see him come back, but I found that there are two people in the IT department, they are in front of the computer, a busy QQ, one seems to be watching the news. I asked the personnel of Xiao Yang, can I ask someone else to help me get the formalities, she said she is busy now, let me go to find the IT department of Xiao Li, he may be free. I went back to the IT office and asked Xiao Li for help, small Li Xian is busy back to two QQ after I pick up the computer list, see above write ' Zhang xx ' is responsible for computer to pick up the job, so said this is small Zhang responsible, he no matter, call me or wait for small Zhang back to do it. I was like the ball was kicked to the table to continue to wait, fortunately I took a copy of the "refactoring" in the look, or really want to be depressed to death. Xiao Zhang came back from work soon, began to help me install the system, add a domain, set the password, and so on, in fact, Gohost restore again set up, almost half an hour to be done. "This is the most important first time of my life," said the vegetable sigh. ”
"Haha, employment, marriage, children, life three major events, your first major event is enough depressing." "The Big Bird compassion Way," but the real society is such, they do not know you, does not give you face, is also very normal. Just like now Cao Qitai presided over the television "work This Thing" program, which can chat can learn a lot of things, not to go to school, complex. Well, if you're unlucky, your supervisor in the company, things will be much better. ”
"But the reason this company makes you feel bad is that there are some problems with management." The Big Bird goes on, "It reminds me of a principle of our design pattern, and your experience can fully embody this principle." ”
"Oh, what a principle. "The side dish mood is mobilized," you how everything can and the software design pattern Amorites. ”
"I obviously didn't blow it out ..." The Big Bird said triumphantly.
"Gee, it's okay, Big Bird you're strong ... It's not blowing, it's born. , hurry up and say, what principle. "The small dish is quite dissatisfied with the bird-blowing accent, and hopes to get to the point soon."
"You go to the company, through the Ministry of Personnel Xiao Yang, know the IT department Xiao Zhang, at this time, you have known two people." But because no one introduced you do not know the IT department Xiao Li. And since Xiao Zhang Xiao Li belong to IT department, should be able to give you a system with the account number, but because of the small Zhang something, and you do not know Xiao Li, and cause your life for the first time great loss, you said I analyzed the right. ”
"You are all nonsense, it is what I told you, what analysis." "The vegetable is disappointed," he said.
"If you know Xiao Zhang and Xiao Li at the same time, then any one of you will be free to help you fix it," you say. ”
"or a nonsense. ”
"This means that if you do a good job, the so-called ' no acquaintances difficult to do ', you in the IT department ' someone ', do not worry about everything." The Big Bird smiles with a bad face.
"Big Bird, what exactly do you want to say." If I have a relationship, I am familiar with all the company, and I can use you to say it. ”
"Vegetable, look you are anxious, in fact what I want to say is, if the IT department has a supervisor, is responsible for assigning the task, regardless of any need IT department to cooperate the work to let the supervisor arrange, no question." The Big Bird started to get serious.
"You mean, if Xiao Yang finds out it's the head of it, then even if Xiao Zhang is not available, you can arrange for Xiao Li to do it through the supervisor," he said. ”
"Rival (pronunciation in Sichuan dialect)." The Big Bird smiles to encourage the way.
"I see, the key is that the company may not have IT managers, they are to find who, please who to work, if they are familiar with, something can be coordinated, if not familiar with, then will appear I encountered the situation, someone busy dead, someone empty, and I am waiting. ”
"Without management, single human coordination is difficult to accomplish." If the company's IT department is a small Zhang, then there is no problem, but less efficient. Then a little Li, the job is called who to do it. Outsiders do not know the two of them who are busy and who is free, so complaining, prevarication, criticism on the wind. It's even more troublesome if three people don't have a manager in the IT department. What is called a monk carrying water to eat, two monks to eat, three monks have no water to eat. ”
"It seems that even two people should have the management to be good." I know what you mean, but it's a matter of management, and is it related to design patterns? ”
"What's the hurry, not finished yet?" he said. Even with an IT executive, what if the supervisor is not in the office? The company dozens of people with computers, every moment there may be a fault, the phone came to find the director, people are not, it is not solve the problem. ”
"This, it seems to need rules and regulations, regardless of the supervisor in the absence, who has the time to deal with, after the report to the supervisor, and then work coordination." "The vegetable is also learned to analyze.
"Yes, it's like someone was hit by a car on the road, sent to the hospital, do you have to ask if there is money to give treatment, ' life is greater than the day ', the same, in software companies, ' The computer is lucky in the days ', the developer's wages averaged down by hundreds of per day, delayed a day, it is the company's big loss AH- So you thought about what you should do. ”
"I think if I don't know anyone in the IT department, I just need to call or find it in person, and they should try to help me out." ”
"Well, that's right, what do you say when you call?" "Is the manager there?" he said. ...... Is Xiao Zhang here? ... ', or ' IT department Yes, I am a vegetable, the computer is bad, do not repair, software rest vegetables. ’”
"Of course the software is better to rest." You guys, just take me happy. ”
"In this case, the company no matter who, find IT department on it, no matter know people do not know, anyway, they will find ways to find someone to solve." ”
"Oh, I see, I really understand." You mean that the IT department represents an abstract class or interface, Xiao Zhang Xiao Li is a specific class, before you can repair the computer will not repair the radio on the principle of dependency inversion, that is, interface-oriented programming, not for implementation programming is this meaning. "The vegetable, the excitement is abnormal.
"Of course, this principle is also satisfied, but what I want to say today is another principle: ' Dimitri Law (LoD) ' is also called the minimum knowledge principle, which is simply that if two classes do not have to communicate directly with each other, then these two classes should not have direct interaction. If one of the classes needs to invoke a method of another class, the call can be forwarded by a third party. The truth is that the example you came across today, your first day to the company, how can you know IT department of people, if the company has a good management, then it should be the personnel of Xiao Yang to call it department, tell the director to arrange for people to the small dishes you install the computer, even if the beginning is Zhang is responsible for, he temporarily has urgent, The supervisor can also arrange Xiao Li to handle, if Xiao Li was not busy at that time. In fact, the Dimitri Law is still talking about how to reduce the coupling problem, the weaker the coupling between classes, the more beneficial to reuse, a weakly coupled class is modified, does not affect the related classes. In other words, the concealment of information facilitates the reuse of software. ”
"Understand, because it is abstract, even if the people who have left the new, my computer problems can still find it to solve, and do not need to know the colleagues, purely by the relationship to help." Even if you need to know, I will only know the head of IT department, and he will arrange the work. ”
"Is the vegetable motive impure?" You don't want Xiao Li to get fired soon. Ha. The Big Bird looks at the side of the cake and laughs.
"Go ...." Am I that kind of person? Well, you said yesterday, I want to change the store cashier code for the three-tier structure, some trouble. I have to think about it. ”

adjourned
Note: There is a reply to the "Vegetable programming growth" series to tell the problem is not through, in fact, this is normal, after all, this is not class, but in the writing dialogue, chat just, suggestions to read the article if there is the idea of learning to search related topics, do not think that see the side dishes series can learn to understand design patterns. Wu fan more hope is in your work study hard this more, see "Side Dishes" series, adjust a smile just. Another: This article Dimitri rule knowledge from "Java and model", a native people write a rare good book, give "buy" rating.

Source: http://www.cnblogs.com/cj723/archive/2007/03/27/689581.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.