Layer-3 architecture and hierarchical development

Source: Internet
Author: User
"Laruence, let's continue to discuss it !" It's frustrating to say that.
"It's normal, young man, not to repair the radio. It's no big deal. You don't have to lose your face. As if a man is in love, he must learn to say "no '." The Big Bird comforted and said, "If your goal is to become an electrical repair expert, you will not be able to repair the radio. It is very depressing. But what is your current goal ?"
"I want to be a software architect and programming expert ." The dish is unambiguous.
"That is, your The goals of life are very clear. What is the relationship between the weaknesses in other aspects?." The Big Bird continued, "Now the guests in the TV program" postt "are all big entrepreneurs in China. Many of them have hundreds of millions of people and require them to have a boss show, do you really want to compare their talent with other artists? I think the bosses sing in their spare time, but they also feel their seriousness and interest. The billionaires also sing, dancing and fireworks. As for whether they are singing or not, no one cares about it. Do you understand ?"
"I understand !, I must work hard to become a programming expert .", The dish said, "let's get down to the truth. What else do you need to modify after my program uses reflection ?"
"Well, good !" Laruence cleared his throat and started class. "If your program is no longer modified, or you want to change the discount quota and Rebate quota, then your code is enough. However, demand is constantly generated. For example, this is a stand-alone program. What should I do if I need to use all the cash registers in the multi-storey building of the mall ?"
"The xml configuration file is not suitable. It would be better to use the database !"
"The boss heard about the disadvantages of the C/S architecture, such as the upgrade troubles and lack of security. He is not a fool. Every update needs to be deployed on every machine for half a day, he needs to pay the programmer for those working hours. So he proposed to change to the B/S architecture, and the client should be supported by a browser. What should you do ?"
"You need to change the interface to a web application ."
"Is it easy to change your current code ?"
"It seems that it is not easy to re-write. Although some code can be copied in the past, there are still a lot of things to re-write ."
"Well, have you found out that I have mentioned so many changes in demand, but some of the system has not changed? What is it ?"
"I know that there are several categories used in the policy model, that is, algorithms such as normal charges, discounts, and rebates are not changed ."
"Yes, it's not that the algorithm will not change, but that we have already considered it a lot. We have used the Strategy Mode and reflection technology to make it relatively stable. You also said that you need to copy and paste the application to the Web. But what is the relationship between the modified interface and these algorithms ?"
"It doesn't matter ."
"Also, changing the configuration file to database access is actually reading and writing data. What is the relationship with the algorithm ?"
"It doesn't matter either. I know. You mean, they can leave each other without affecting each other. Change either of them and don't affect the other two? Oh, is this the so-called three-tier architecture ?"
"Yes, it is a three-tier architecture. Three-tier architecture or hierarchical development is easy to say. There are still many misunderstandings for beginners in program development.. For example, some beginners think that dbserver-webserver-client is a three-tier architecture. In fact, this is a three-tier architecture of the physical meaning and has nothing to do with the three-tier architecture of the program. Some people think that the form on the winform interface or the aspx of webform is the top layer, and their corresponding code post (codebehind) file form. CS or Aspx. CS is the second layer, and then there is another code to access the database, such as ADO. CS or sqlhelper. CS is the bottom layer, which is actually a very wrong understanding. Furthermore, many people think that the MVC model (Model-View-controler) is a three-tier architecture, which is a classic misunderstanding. In short, although the three-tier architecture is not difficult, it is a pity that many books and materials cannot be explained, so we can all be confused and misunderstood by beginners ."
"Ah, I always thought that MVC was a three-tier architecture. It seems that I was wrong. So what is Layer 3 ?"
"Have I already told you? What are the main functions of winform and aspx ?"
"For display and processing on the interface, right, they can be seen as a layer. Interface Layer ?"
"The interface layer can be called either the UI Layer or the presentation layer ."
"Is accessing the configuration file or processing the database a data layer ?"
"Ha, isn't the three-tier architecture easy to understand! That's right, but the name should be called the data access layer or the Dal layer ."
"So the third layer is the algorithm class. What layer is this called ?"
"Who developed these algorithms? Who decides the change ?"
"Of course, it is the demand author, that is, the software system owner. If they want to change the algorithm, we have to change the development. These are all their business algorithms !"
"Ha, well, you said a word, business or business, which is actually the core of software. We develop software to provide services according to business rules, therefore, this layer is called the business logic layer ). But it should be the middle layer, between the other two ."
"Oh, Layer-3 development refers to the development of the presentation layer, business logic layer, and data access layer.. What is the relationship between them ?"
"You need to know, This is actually a layer in the general direction. Each layer may be subdivided into multiple layers and structures.. For example, petshop4 is displayed by Microsoft. NET Enterprise system development capability example. Although petshop is not enough for large-scale software system development, it can be understood as children's intellectual toys. However, toys are the best learning item for beginners ."

The figure below is from Bruce Zhang's blog

"If you want to refine the structure, the structure may become very complicated. For example, let's show you the structure of petshop4 ." Laruence continued. "Ah, I understand the figure above. The figure below is dizzy. How can there be such a complicated toy? The Big Bird is learning about it again. Can you explain it quickly ?" I am confused about the problem.
"The first time I saw it, I understood it completely. It would not be a genius. It will take time to learn. Now you should have a point on rewriting the mall cash register system. What should you do ?"
"The original solution should be divided into three projects, one UI project, currently a winform program, one BLL project, which is used to encapsulate algorithm classes and One Dal project, used to access the configuration file. Right ?"
"Well, it's almost the same. Let's change it. It's easy to say. In practice, there will be many details waiting for you to solve ."
"Okay, but today is not enough. A company I interviewed a few days ago offered me an offer. I will go to work on the first day tomorrow, and I will rewrite this program tomorrow night ." The dish said.
"Congratulations, did you mention the company that is working as a logistics software company? Thank you for choosing a job ."
"No problem, but wait for me to pay. That's the one. I think the company is still very large ."
"Let's take a rest. You have to perform well on the first day !" (To be continued)
At the request of some friends, I wrote a special article on Web architecture. This article is just a brief introduction. In fact, these are not new things. If you think you are a little dish, I suggest you download the code from the previous article to rewrite it based on the introduction in this article. programming is a very practical technology, understanding is not equal to applying.

From: 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.