CS, BS and three-layer structure

zhaozj2021-02-16  111

C / S, B / S and the three-layer structure (upper) (2004-7-9 16:23:00) Source: CCW OF: Xie Pan

Editor Press: In order to closer to software developers, provide them with a platform for technical exchange, starting from this issue, and the practical technology column is renamed the application of salon, set software development tools and technology, database, network management and knowledge window four sub-columns. . Although the settings and names of the column change, the constant is our reader positioning, it is to pay attention to the growth of programmers, for the purpose of the software engineer service, providing a mobile phone staff for my country's software staff, so I hope Your attention and support is also as always. This year, under the new column arrangement, we will especially strengthen communication and interaction with readers, discuss the latest short-length technology of some mainstream software development tools, and research on database technology and network management. Programmer's professional planning exchanges, I hope that in every success of your software technology, there are around every success in your life experience. In addition to the routine knowledge window, I will offer you four articles: "C / S, B / S and Three-layer structure" (on) This article is a speech when the author is trained for the company's software developers. Although the author is not an expert, the views on some problems may not be accurate, and their content is not the current topic, but it is the first-line software engineer's personal experience, the author's practical experience summary, words are cut So I chose it; "Long J2EE Learning Road" is a netizen's post, and readers recommend it to me. He told me that in the Java Forum, the computer world network and 9CBS, many well-known websites of well-known websites There are reproduced, so I also recommend this article to Java enthusiasts. This article gave the Java enthusiasts pointed out a way of learning, and believe that Java enthusiasts will not be disappointed; "Henry VB.NET Tour "It is a try to do this column. This time, I changed the traditional technical lecture form. I use a story to tell VB.NET's knowledge points. We hope that readers can master VB.NET during a relaxed and humorous study; "XML and Database" reveals the relationship between the current hotspot XML and the database, and pay attention to the XML technology may wish to read. For a software developer, the computer language is only means, and the development platform is a tool, and the technology is a real implementation. So any friend who struggled in the software development should strive to grasp the mainstream technology and knowledge of the current software development, in which it can be unbeaten in this field. Multi-level mode (N tier) is a person who has been developed under Windows, which is very clear how C / S is implemented. In this case, it is not to abandon two layers of mode, just hope to help everyone through the author's description and Understand the space of the three-layer structure brings us. Misunderstanding 1: C / S Exit the historical stage, I thought that C / S did not have such a miserable point, any project or any solution, to analyze what it implemented, and it will face What is the nature of the end user. For example, develop a program running under Windows, or develop a program in the LAN and only for a small number of users, or a manager, the background running program, may not necessarily want to use multi-level mode, because it does not give you what? Instead, you will increase your workload and maintenance. We should not purely pure the advancement of technology, and pursue practical technology. When you want to implement a program, you have to analyze the nature of the project and end users, then find the most practical means that can solve your problem.

Because users don't care how advanced technology you use, users care about, fast (Rapid), convenient (Convenient). Misunderstanding 2: Multi-level mode is only available for large projects. This is a common misunderstanding, including the author's own ideas before entering the N tier field. However, with the continuous in-depth of N Tier, this understanding is found to be wrong. The specific choice should be determined based on the characteristics of the project and the nature of the end user group. If your project is running in WAN, you must consider the security of data and bandwidth, or when you face ordinary users, they can't complete complex program settings, installations, etc., or simply talk, if you want to implement A constant user maintenance of zero-censorship or minimal cost, you must consider developing the system using N tier's B / S mode. We are used to call N tier mode as a three-layer structure system because N tier is actually a variant of the three-layer structure. Correct understanding of the three-layer structure is very important for programmers, because this contains a lot of theoretical and technical background, which combines how many genius characters, has a mature N tier development basis today. The technical implementation of the three-layer structure should develop a three-layer structure, which is essential: middleware, communication protocol, and transaction mode. The middleware middleware is indispensable to construct the application server. There are currently several of the three-layer structural intermediates that are generally used under the WINDOW platform: Midas, CORBA, COM / DCOM / COM , and ASTA. Midas is Borland starts to achieve the application level from Delphi 3, which is powerful, and Borland's flagized product, which can be applied under Windows and Linux; CORBA is the product launched by OMG (Object Management Organization), has a powerful cross-platform Ability; COM / COM is a Microsoft's fist product, and every time Microsoft is one of the concepts, it is currently integrated into the operating system. Its structure is very large, if Midas is metaphor, the COM is like a lion. The lion looks much larger than the wild horse, but it is not easy to tame it. The last is ASTA middleware, which may be less familiar, actually starting ASTA from 1997 to develop this product. It embeds the socket connection, has a powerful "message" development mechanism. Communication protocols (or connection methods) Universal middleware connection mode have TCP / IP (such as socket), DCOM, CORBA, etc. Programmers often confuse DCOM and COM, actually different, COM is just a service provider, while DCOM can make COM really play its charm, DCOM adds the distribution concept on the basis of COM. At present, Microsoft has newly launched .NET, develop and improve DCOM. MIDAS can use DCOM connections, or use Socket connections, Borland's core transformation of Midas in Delphi 5, so you have to use MIDAS, you must see Delphi 5 or later books. COM / COM can only use the DCOM connection, CORBA uses its own connection protocol. Here, the author also wants to mention the DCOM. Although the DCOM connection is much better, it is too complicated, so Microsoft also recognizes its defect.

Microsoft will first push the SOAP connection protocol in the .NET platform, SOAP is the protocol established in the HTTP, mainly in adapting to the development of XML, and has been supported by many major companies (such as IBM, Oracle, etc.). The most famous of the trading model is MTS. Its English is a lot of features of Microsoft Transaction Server. For example, multi-segment submission mode, which Pooling technology, which is buffer pool technology, making data safer and fast. It's hard to imagine, if there is no trading mode, what is going to do with the three-story structure: You have to write a lot of code to achieve a transaction mechanism, if it is not well solved, it also reduces the programs' reliability and speed. The MTS is built in the system layer, which can help you solve many things that should be solved in the program. There is also a little to remember that on the market on the Windows development platform, only Delphi and VC can truly play the function of MTS. In the previous period, the author introduces a view of the C / S structure, two-layer mode, three-layer mode in this paper, and technical means for realizing three-story mode. The author will discuss B / S structure and three-layer mode. Implementation method.

Three-layer structure programming points

I don't want to talk about too many theories. I only give you a classic quotem. This sentence should be firmly remembered: All Business Logic in the Middle Tier (all business logic is on the middle layer). If so, the three-layer structural program you develop is not professional, or only the Turn version of the C / S mode. Although this sentence is very simple, it takes a lot of experience accumulation to achieve this realm.

Another esteem is: Be sure to minimize the amount of data transfer of the application server and the front program and the Round TRIP. Because if your three-story structure has frequent Round Trip, then your application server efficiency must be very low. When entering 10 connections, you will find that the application server is close to the paralysis.

When developing a three-layer structure, a good habit should be developed, which is to describe how to solve business logic in terms of system analysis or design reports, how to effectively reduce data transfer, and only the necessary Round TRIP. Only in this way, others can discuss whether your solution is reasonable, whether there is more effective implementation. At the same time, it has been summarized, and its systematic analysis capabilities are improved.

When developing a large number of user-connected application servers, multi-threading technology is necessary, otherwise the other user can only wait, if this kind of waiting time is too long, the user will Software lost confidence. There is also a distributed concept that you can separate, develop and publish multiple application servers to solve different business logic according to business logic; or you can distribute multiple processes running the application server in different servers, and The user is automatically guided into a reasonable application server based on the access process.

It is because the three-layer structure is complicated than C / S, so you have to become a three-tier structure, you must go through a long time and a large number of projects. However, the three-layer structure reflects the professional quality of developers and system personnel, because it involves too many things: selection of technical tools, modularization, and components, segmentation of the front and back function. In the true sense, only three-story projects can completely reflect each process of the software project.

B / S mode and development

The mainstream software architecture B / S has some shortcomings, so many B-N tier systems now have a multilayer structure development model based on a web browser, which absorbs the advantages of both.

We know that simple B / S is very exciting, and end users have almost zero, but it has many shortcomings, its function is weak, and you cannot achieve your concept very easily. For example, if you want to implement a business model, you will find that the web approach is unsafe, unreliable, for example, users can return all the hope by page or before changing all the results of all the desired results, etc. Why is web that will cause logic implementation? Because it is based on stateless. For example, Stateless is such a situation: you have a wall in the middle of your users, you don't know what users have as long as the other side of the wall, or even men are women, then you are on the wall. A small window handed him a gift, as for the final flow of the gift, you also know, this is STATELESS. All http-based things are Stateless. The charm of Socket is that it is stateful.

The author thought that the ASP, JSP, Java technology developed now is to make up for the state of stateless defects in the HTTP protocol, but even if they have these tools, they will still feel that the web programming cannot be asked, because these technologies are advanced, and they cannot solve HTTP. The agreement based on Stateless facts.

Maybe some people will ask how these dynamic web development technologies avoid the shortcomings of STATELESS to a certain extent? In terms of IIS-based ASP technology, it uses session variables to implement State. But no matter what technology, it is finally on cookies, which is to keep the client status using cookies.

Here you still have to mention Socket. Socket is currently available, ICQ, QQ and other instant messaging software, there are many network tools, mostly based on Socket, because the Socket protocol is stateful, so this can be done. It can be said that Socket makes online life more exciting!

At present, the underlying technology used in web-based multi-layer structures mainly include SOAP State Protocol or HTTP State Protocol. Here is a good news from Delphi program, starting from Delphi 6 (a web provider product), which is called one of the greatest engineers in Borland's history by Borland. It also supports HTTP and SOAP protocols, and also uses a mode similar to the SESSION variable to implement state. It can be said that it is one of the most powerful platform-based Browse / Server development tools on the market. It is not enough to be a complete RAD tool, and the threshold is high. Why isn't it ASP or ASP.NET? The author believes that ASP is not a platform based on a scripting language, its operational efficiency is not high, and its debugging is difficult. In Delphi 7, an intRawb control package is also introduced. The author thinks it is a true web-rad development tool that can be more like Tiger with WebSnap.

Web provider, logical components, multi-threaded processing, transaction mechanism, message flow transfer, etc. are the highest realm developed by N tier, and the author thinks the first choice for large commercial software architectures. The author rarely mentioned the message mechanism, mainly, I am afraid that everyone is confused, and the message mechanism does not necessarily exist in all multi-layer structures, and if you want to implement a message mechanism, you must find a means of implementation (such as using socket). Otherwise, if you enforce a large amount of message flow in the program (such as using timer monitoring and message data sheet), whether it is efficient or complexity, it is to consider.

Software developers' choice The author is willing to see software design as music art, it has many genres, but also have mainstream, but does not mean that other thoughts are completely abandoned. For example, a single layer structure or a C / S method, many people are still in use, and very good at. The author does not encourage readers to abandon these traditional things, the author's meaning is to expand its eyes, open ideas. Multi-level reflects an integrated ideology that integrates the system with safety, efficiency, graphical way, with assembly ideas to architecture the business logic of the entire company and reduce the cost of end users. The core idea is concentrated, all intermediate layers are concentrated, can run different commercial logic components (such as .Net) on different servers, but this logical component must be used to all front-end programs. Many companies are now walking the road in the system, and the focus can bring unlimited benefits, but there is no support for the software platform, and it is very superficial. It is not simply a machine's concentration, and the centralized centrality of the machine will bring the pressure of network bandwidth. Only the application is concentrated, and it can eventually reach the purpose of reasonable configuration resources. Why do we need to use a multi-layer system, to use distributed Thoughts to build real reasons for enterprise applications.

The author thought that today, today, as a professional, if it is always in a single layer or the C / S architecture, it will never form a system idea. Only the multi-layer system can truly understand the concept of software life cycle, from demand analysis Business logic to system design, database structure design, component chemical programming, testing, promotion, a good N tier system must do a good job in all phases. This is not like the changes in the program language or the development environment simple transformation, because it is a complete change in development ideas and development models, so it must also be a process, it is impossible to ask yourself to truly understand it within one or two months. And began to control N tier mode, but the business model has changed, and development thinking will change. You must only make yourself to adapt to new ideas, in order to become a more professional developer. Once you have entered the temple of N Tier and master this development model, you will find that you have gradually formed the system idea of ​​software development, and in this field, you will get more and more passionate. .

Editor: Poor programmers

"Really tired!" Often heard that software developers said. Software development is a high-intensive job. This is a consensus. Whether it is a test for physical strength or mental power, many programmers often larute themselves to "eat youth". I have also been a few years since I have been developing, I also understand the hard work. I know that for software developers, many people who have taken time, catching progress, closed development, long-time overtime plus points have become often, but this pain is impossible, software technology The updated day of the new month. If you are enough to stay at this line, you must track the technology development, or you will fall, and you will fall. The C / S mode has just mastered, and the B / S architecture is popular, and the high-defensive J2EE, CORBA is still a known half, .NET followed again. Master the VB too foundation and master Delphi has just joined the programmer. If you want to be treated, you have to master VC or BC. If you have a lot of job opportunities. Recently popular Web Services must also understand, but to truly understand the web service, master XML is premise. One day, I talked about UML, but I have to make up ... "The poor programmer, when is the end!"

转载请注明原文地址:https://www.9cbs.com/read-10224.html

New Post(0)