Explain b/S and C/s exactly what

Source: Internet
Author: User
from the interview triggered thinking: b/S and C/s exactly what is a, the status of the description:
in this gold three silver four job search gold period, I was fortunate as the company's independent technical interviewer, has the final decision to employ the right, in much superior leadership of the full trust, I also assured the superior, must be for the company to find the right talent, in my confidence in the case of interview one after another job seekers, Found the majority of job seekers common problems, one is: above his business, that is, the working life is long, but by the work content and personal reasons, the basic knowledge is weak, a lot of technology use n years, but do not understand its principle, it can be said: only know how to use, but why to use, Whether there are other solutions have never been considered or summed up, the breadth of knowledge, not to mention, salary expectations are very high. Second is: b/s and C + +, think B/S is to do with the web-related things, can be involved in more technical points, such as: JS\CSS\HTML\C#\MVC, only want to engage in B/s direction work content, think its popular and popular, and think C/s is to do client desktop program, such as: WINFORM,WPF; think it is too simple or have no prospects for development, then what is the truth? This article is mainly to talk about B/S and C/s exactly why things, what similarities and differences between them.
Second, b/s
b/S is: Browser and server, Chinese meaning: browser-side and the servers-side architecture, this architecture is divided from the user level, browser browser, in fact, is a client, but this client does not need everyone to install what application program, Simply request server-side related resources (Web resources) on the browser via HTTP, and the client browser browser will be able to make additional deletions. Not dependent on the user's computer operating system environment, only related to the browser environment, of course, due to the complexity of the Web page, but also extend the front-end technology and back-end technology, the front-end technology refers to the browser programming technology, such as: JS,HTML,CSS, these front-end technology is running on the client browser browser, And not on the server side, if you do not believe, you can test, when your page contains JS script, if the browser properties of the disabled JS enabled, you will find the page of those relying on JS technology can not be used. Back-end technology refers to the technology that runs on the server (that is, the server side), such as: C#,java, which is the same as what we normally understand in C # programming, JAVA programming, except that you need to consider HTTP protocol-based programming. The schema diagram looks like this:

iii. c/S
c/S is: Client and server, Chinese meaning: Clients and servers, this architecture is also from the user level (also can be a physical plane) to partition, where the client generally refers to the client application EXE, the program needs to be installed before running on the user's computer, The user's computer operating system environment relies on a large, such as: If you want to run an EXE program based on WinForm development, you must first install the. NET framework components on your computer, otherwise it will not work correctly. Server side here is a non-essential part, if the client is a single-machine application, no database or other distributed technology, then the server can be omitted, if the client needs a database or other distributed technology, Then the server side of this is the server side of the database server side or other distributed technology (WEB Api,web service, etc.). The schema diagram looks like this:


Four, b/S and C/s similarities and differences
b/S and C/s common denominator from the English abbreviation can be seen, have s, this s refers to the server side (application backend), server is just a collectively, the specific subdivision, there are: Application Server side, database server side, cache server side, file server side, etc. Different points can also be seen from the English abbreviation, that is the difference between B and C, from the front respectively introduced with B/s and S/C to know, B refers to the browser side, C refers to the client, but if from a broad sense, B is also a client, the browser also needs to install, do not install the same b/ s structure also can not work, but the General browser is installed by default, from the level of architecture, B/S and C/S is the only difference between the presentation layer, B/s may need to understand the front page technology, C/s may need to understand WINFORM,WPF and other application front-end technology, the rest are the same, If you are simply engaged in C # or Java back-end development, then B/S and C/s are the same, are using a dynamic language such as C # or Java to provide resources for the presentation layer or related to the processing of resources. If a company has a clear division of labor, then C # or Java engineers should do is the back-end development, and the front-end, there is no need to stress B/S and C, of course, know the point front-end technology better, can for their own technology icing on the cake, But if you want to let the company for you know the front-end technology and pay (improve wages) "All-stack engineer excepted" that is probably a bit wishful thinking, in exchange for I am the boss, I certainly prefer to find professional front end and professional back end, this front and back are slightly understand, but are not professional, not as good as not. The uniform structure of B/S and C/S is as follows:


in order to allow beginners to understand the above B/s and C + + architecture diagram, I wrote a very simple demo to reflect the B/s and C + + similarities and differences, the code is as follows:
Server side:

namespace demo.server{public    static class Logic    {public        static int Add (int a, int b)        {            return a + B;        }    }}


The browser side (backend-belongs to the server side, but differs from the individual server tier above, where the server tier needs to be referenced):

namespace demo.browser{public    partial class WebForm1:System.Web.UI.Page    {        protected void Page_Load ( Object sender, EventArgs e)        {        }        protected void Button1_Click (object sender, EventArgs e)        {          Textbox3.text=demo.server.logic.add (int. Parse (TextBox1.Text), Int. Parse (TextBox2.Text)). ToString ();}}    }


Browser end (front end):

<%@ page language= "C #" autoeventwireup= "true" codebehind= "WebForm1.aspx.cs" inherits= "Demo.Browser.WebForm1"% ><! DOCTYPE html>


The results of the operation are as follows:


Client side: Create a WinForm form, add a three text box like the above and a submit button, and the last write click event (need to refer to the server layer)

namespace demo.client{public    partial class Form1:form    {public        Form1 ()        {            InitializeComponent () ;        }        private void Button1_Click (object sender, EventArgs e)        {            textbox3.text = Demo.Server.Logic.Add (int). Parse (TextBox1.Text), Int. Parse (TextBox2.Text)). ToString ();}}    }


The results of the operation are as follows:


Of course this demo is very simple, mainly to reflect in addition to the presentation Layer (Web page and WinForm form), the server side is the same, if you need to change the algorithm, only change the server side, then the browser and WinForm client computing results will change, Of course, I am writing here certainly not enough specification, only demonstration but, the complete architecture thought needs to consider many aspects, for example: Based on the interface programming, the dependency injection and so on.
v. Tips for novice Programmers
If you are interested in web front-end technology, it is recommended to engage directly in the front page development, the corresponding positions are: UI designers, web front-end engineers, and software developers generally refers to the development of the backend, namely: pure C # or Java and other such programming work, of course, do not exclude small companies or unclear division of labor companies, Require both front and back to do, so do not blindly or one-sided think, b/s is better than C/s, I can only say that each has its own advantages, the ideal architecture is: in the case of the back-end code, you can switch to any browser or client application. Finally, there is no best technology in the world, only the most appropriate technology, technology is like martial arts, basic skills is very important, as long as the basic skills, and then to learn architecture, design patterns, it will be easier, and these seemingly tall things, such as: AOP,SOA,DI,IOC,DDD,CQRS, etc. , as long as understand its principle, extrapolate can achieve "no recruit wins have recruit" the highest state.
In addition, this article does not tell the difference between b/S and C/s, if you want a more complete understanding of the difference between the two, you can see this article: C/S and b/l structure differences, can also be directly Baidu query, above all my personal views, if there is a wrong place, do not spray, but also please forgive me Thank you!
Additional notes:
See everyone's comments, although it is expected that everyone will spray, so at the end of the article also remind you not to spray, but did not think there are so many people spray, I think maybe we do not really understand the central meaning of this article, I this article is not to go into the difference between B/S and C/A, if so, Then I do not need to write this article, online a search a lot of, in fact, I want to illustrate the idea is: do not equate web design with b/s structure, do not think will use js,css,html think will b/s structure, I also said if you are only interested in the design of the front page, So it is recommended to engage in web front-end work, and not in the interview of C # software Development engineer, stressed I want to engage in B/s, want to engage in js,css,html, but also on the Web back-end programming is not interested. This article is to stand in the frame of view to analyze the similarities and differences between b/s and C + +, think b/S and C/s is only the difference between the display layer, I also listed a simple example, also never deny B/s inside a web design (including js,css,html), At the same time, the purpose of writing this article is to tell all the new people: to strengthen the basic programming skills, improve the programming knowledge, understand the nature of various frameworks and structures, so as to fully enhance their own, but also wish you leave or will leave the person can soon find a good job.
The following is a unified reply to the questions in the comments:
1. I am not in a dead end, you may not understand the central meaning expressed in this article, or I may not be clear enough to explain the actual purpose of the supplementary statement;
2. Some people think that I copy other people's articles, this I do not need to explain, you can see my publication time, not to mention that this article is not involved in any very advanced technology, it is necessary to copy it;
3. Some people think that is still studying B/S and C/s is very superficial, then I do not know if you understand B/S and C/s, anyway, I think some seemingly simple problems, if not to understand and dig, may write a lifetime code or stay in B/S is to do web design, Contrary to some real Daniel will not think so, from the perspective of the structure of B/S and C/S is the same, C/S has a stand-alone version, B/s can have a stand-alone version of Ah, what do not believe, then I tell you, static HTML page (contains js,html,css) can be directly opened to see the effect of running, You do not need to publish to IIS or to the server. At the same time, C/S has a service end, B/s also has a service end, C/s If the use of distributed architecture (such as Web Services, WCF, Web API and other technology packaging business logic), then C/S local application only interface display, and all the business logic in the service side of this and B/s service end there is a difference Understanding the structure nature of B/S and C/s will help you if you have the opportunity to engage in the architect, manager, then you can be very good to some of the technical and architectural direction have a good grasp;
4. I did not take the initiative to ask the job seekers also did not stress the applicant to explain the difference between B/s and C + +, only in the interview with some job seekers (novice) said B/s, but also want to go to B/s direction, I asked him B/s which aspect, he said the beginning of the article, and C # But not much research, so I suggested that the Web front-end development may be better, but also caused me to write the reasons for this article;

5. At the same time, thank those who can see the meaning of this article to understand the people, did not waste my painstaking, I write this article is not to anti-human or cause a war of words, but also hope that you read rationally and say your point of view, welcome to communicate.

This article explains in detail the B/S and C/s related knowledge, more relevant content please pay attention to the PHP Chinese web.

Related recommendations:

How to implement portrait menus with CSS3+HTML5

About HTML5 Local Storage

A tutorial on PHP Captcha Experience

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.