Dahua design Mode (Eleven-Three-tier architecture, layered development) _ Big design pattern

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

"Big Bird, let's go on talking." "It's very depressing," said the vegetable.
"Young man, it is normal to not repair the radio, no big deal, no need to lose a face." As if lovelorn, men should learn to say ' no ' better. "If your goal is to become an expert in repairing electrical appliances, then you won't even be able to fix the radio, which is very depressing," the Big Bird said, comforting. But what you're aiming at right now. ”
"I want to be a software architect, a programming expert. "The little Dish said unequivocally.
"That is, your goal in life is very clear, other aspects of the weak what is the relationship." "The Big Bird continued," Now the TV program "Boston" invited guests, all of China's big entrepreneurs, many people with billions of dollars, the program has asked them to have a boss show, it is really to their talent to go to and other artists than it, I see the bosses are very amateur singing, But they also feel that their share of seriousness and interest-the original billionaire is also can sing, dance, will eat human fireworks. As for whether they're singing in tune, no one cares, you know. ”
"I understand. , I must make a good effort to become a programming expert. , "said the vegetable," we get to the back of the program, you say I have to use the reflection, what needs to be modified. ”
"Well, well. "The bird cleared his throat and began to take classes," If your program doesn't change, or you change the discount amount and rebate, then your code is enough. But demand is constantly being generated. For example, now this program is a stand-alone version of the program, if you need to store a multiple floors of all registers have to use, then how to do. ”
"The XML configuration file is not appropriate, it should be better to use the database." ”
"Then the boss heard of the disadvantages of C/S architecture, update the trouble, not enough security, etc., he is not a fool, each update needs to be deployed for each machine, once on a half-day, those working hours he needs to pay the programmer." So he proposed to change to B/s architecture, the client browser support, how do you do. ”
"That needs to change the interface, change the application to a Web program." ”
"As far as your current code is, is it easy to change it?" ”
"It doesn't seem easy, it needs to be written again, although you can copy some of the code, but there's still a lot to write back." ”
"Well, then did you find that I said so many changes in demand, but there is something in the system that has not changed. ”
"I know that the strategies used in the model of the several categories, that is, normal fees, discounted consumption, rebate consumption and other algorithms are unchanged." ”
"Yes, actually not the algorithm will not change, but before we have considered it a lot of, using the strategy model, using the reflection technology to make it change relatively stable." You also said that to change the application to the Web is to copy and paste, but in fact, the modification of the interface and these algorithms have any relationship. ”
"It doesn't matter. ”
"Also, change the configuration file to database access, this is actually read write data operation, and the algorithm has any relation." ”
"It doesn't matter, I know, you mean, they can all be separated from each other, change one, do not affect the other two." Oh, is this the so-called three-tier architecture. ”
"Yes, well said, is the three-tier architecture." Three-tier architecture or tiered development is easy to say, and there are a lot of misconceptions in the beginner's program development. For example, some beginners think, Dbserver-webserver-client is a three-tier architecture, in fact, this is the physical meaning of the three-tier architecture, and the program's three-tier architecture does not matter. It is also thought that the WinForm interface form or WebForm aspx is the top level, Their corresponding code-behind (codebehind) file Form.cs or aspx.cs is the second layer, and then there is a code to access the database, such as Ado.cs or SqlHelper.cs is the next layer, which is also a very wrong understanding. Again, many people think that the MVC pattern (Model-view-controler) is a three-tier architecture, which is a more classic misconception. In short, although the three-tier architecture is not difficult, but because now a lot of books on the interpretation of the material is not transparent, so let us beginners are vague concepts, understanding wrong, very regrettable. ”
"Ah, I always thought that MVC is a three-tier architecture, it seems really wrong." So what exactly is the three-storey? ”
"I have not told you already." You see, whether it's an application WinForm, or a Web page program aspx, they're mostly for doing. ”
"For the interface to display and process, yes, they can be seen as a layer." called the interface layer. ”
"The interface layer can be called either the UI layer or the presentation layer." ”
"Accessing the configuration file or processing the database is not the data tier." ”
"Ha, three-tier architecture is not difficult to understand AH." That's right, but the name should be called the data Access Layer (Layer) or the DAL layer. ”
"Then the third layer is the algorithm class, which is called what layer." ”
"Who made these algorithms. Who will decide the change. ”
"Of course the demand-makers, the software system owners, they want to change the algorithm, we have to change the development." It's all their business algorithms. ”
"Ha, well, you speak of a word, business (Business) or business, which is actually the core of software, we are based on business rules to develop software services, so this layer is called the Business Logic layer (Business Logic Layer)." But it should be the middle layer, somewhere between the other two. ”
"Oh, the so-called three-tier development, is about the performance layer, the business logic layer and the data access layer development." So what about the relationship between them. ”
"You need to know that this is just a general direction of layering, each layer is likely to be subdivided into multiple levels and structures." For example PETSHOP4, this is Microsoft to use it to show. NET Enterprise system development capacity, petshop although as a large software development of the sample is not enough, but can be understood as children's intellectual toys. But for beginners to program the side dishes you, toys is the best learning props. ”

The image below comes from the Bruce Zhang blog


"If you want to refine it, the structure can become very complex." Let's show you the PETSHOP4 structure. The Big Bird continued.

"Ah, the above figure I understand, the following picture is dizzy, which has such a complicated toy, Big Bird again in mysterious, quickly explain." "The vegetable is puzzled to say.
"The first time you see it, you see it completely, it's not a genius." It takes a while to learn it. You should now have to rewrite the store cashier system a little bit, what should be done. ”
"The original solution should be divided into three projects, a UI project, currently a WinForm program, a BLL project to encapsulate the algorithm classes, and a DAL project to access the configuration file." Is that right. ”
"Well, almost, quickly change it, Mouth said easy, in practice there will be a lot of details of the problem waiting for you to solve." ”
"OK, but not today, I interviewed a few days ago a company gave me an offer, I have to go to work tomorrow, I will go to rewrite the program." "said the vegetable.
"Congratulations, is that you mentioned the company that does the logistics software?" It's your treat to find a job. ”
"No problem, but wait till I get paid." That's the one home. Feel the company is still very big. ”
"Then you go to rest, the first day to be good performance oh." ”
adjourned
Should some reply a friend's request, specially wrote about the Web architecture aspect article, this article is also just brief introduction. In fact, these are not new things, if you think you are really a vegetable, I suggest you to download the previous code to rewrite according to the introduction of this article, programming is a highly practical technology, understanding is not equal to the application. Source: http://www.cnblogs.com/cj723/archive/2007/03/26/688048.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.