The/.net of Dynamic Web page principle

Source: Internet
Author: User
Tags end execution final functions net object model php and version
I. Preamble
I didn't know where to start, so I started with small talk.

First of all, very happy to get everyone's support, more happy to meet so many like-minded friends, we would like to learn together and progress together. Is the so-called learning without successively, to the teacher, in the process of explanation, if there are mistakes, please correct me.

Secondly, congratulations on your choice of Web application development, as a Web application developer, see "Workers", we are not qualified programmers, barely counted on an IT industrial workers.

Programmers also have grades, workers, artisans and masters. Workers are the most original code replicators on this line, tirelessly copying and composing code. Artisans have elevated a level, programming is an art, craftsmen can manipulate this art, they can make the program more concise, more beautiful. The master stands at the top, they are creators, they understand every detail and can create rules.

If programming learning is a mountain, the worker stands at the foot of the hill, the craftsman stands on the mountainside, the master stands on top. I think I've just arrived at the foot of the mountain. Let's work together to become a master.

Finally, give some advice, do not think that Web application development is very simple, even the development of the Web site is not simple. If only a simple contrast winfrom development (popular understanding is software development) and Web application development (Popular understanding is the Web site development), the former need special depth, regardless of ERP, or game development is good, all need to have a deep grasp of technology. The latter needs a special breadth, the web by a variety of technologies, if only a simple grasp of a programming language or methods, is certainly not, only a variety of technologies to provide users with a better user experience.

Gossip doesn't say much, we'll start now.

Ii. from the beginning of HTML
1. The origin of HTML
First from the printing press, since the invention of printing, some writers have made notes on manuscripts to guide the printing
The workers were typesetting, especially Balzac during the French Revolution, his manuscript is often covered with notes, so only a particular printer will understand his mark, and he must not pay more to the printing press than he deserves, lest he be hit by a strike (when buying a book, he was sent 104 copies of a celebrity biography of a child, Just remember, Khan. Such annotations are called Tokens, which is a special convention. SGML (Standard generalized Markup Language, Standard Markup language) is such a markup language.

Computer display is similar to the typography of the printing industry, which stores information, transmits information, and arranges it, so in March 1989, the European Particle Physics Institute, Cern,tim Berners-lee, proposed a program designed to make it easy for scientists to flip through their peers ' articles. The late goal of the program is to enable scientists to create new documents on the server. To support this program, Tim creates a new language to transfer and render hypertext documents. This language is Hypertext Markup Language HTML (Hyper text Markup Language).
HTML is a specific application of the SGML language, simpler than SGML, and it is a symmetric structured note that informs the meaning, thus forming the Web page we see, and the typesetting worker is the computer. So the main body of the Web page is made up of HTML tags and the content that he contains, and the executor and interpreter are the software program of the browser.

2. Client and server
The client we are talking about here refers to the browser, which can help you make a request, and send this request to another computer (server), the server has a program like the lookout Stone, it has been waiting there, when it found a client's request, he will accept the request, and verify the legality of the request, If it is legal, he is dealing with the data based on a program, then he will return the information in the program along with the specified HTML tag returned to the client, the client received the return information will be explained, arranged, displayed;

3. From HTML to XML
With the development of the network, HTML has been unable to meet the majority of needs, the HTML is constantly modified, from the 1.0 version to the present
Now the 4.0 version, however, because HTML will display format and data storage and transmission, it can not adapt to more needs, such as mobile phone because of various limitations can not explain the display format in HTML, but only need data, people traced to the new SGML based on the development of another markup language is XML.

XML does not describe how to display, its markup (annotation) is used to describe the data information, contains data that can be passed between devices and platforms because it is unformatted, and when a program receives an XML file, the program interprets it according to the display description file that was transmitted together, Or it may be interpreted as a description of the program, or simply as a data receiver. Can describe the technology that shows have maxl,xlst,css and so on.

XML content is much more than this, will further study;

4. From HTML to XHTML
Organizations that manage HTML XML standards (the consortium) think that HTML, because of its simplicity, makes it limited, and HTML is bound to
Excessive to XML, but as XML is a powerful alternative to HTML, it is too early to use XML directly in the face of thousands of existing sites. So there is an intermediate over-language, XHTML.

XHTML is the abbreviation for the extensible Hypertext Markup Language Extensible Identification language. It is recommended that the XML1.0 be recommended on January 26, 2000, based on the HTML4.0 and extended by XML rules.

Although XHTML looks a bit higher-level, it can be said to be an upgraded version of HTML4.0, that is, 4.01, and what we have in asp.net development is the XHTML1.1 profisnal standard, which is a better combination of CSS and more stringent definitions based on HTML.

5. Look at JavaScript
JavaScript is a scripting language that is exported to the browser like HTML and runs on the client without
Is running on the server side, it has a number of web site development to complement, you can run in the browser, both on the page browser's computer (in the browser) to perform some simple operations, such as checking the validation, control the display of a cell in the browser, and so on.

Microsoft in IE browser built-in a program module-xmlrequesthttp, it can be called by the Javascrit, and the background processing, without changing the browser display, so you can use it and JavaScript in conjunction with hidden processing and server-side communication, Instead of changing the page display, implementation data, form submission, and the overall page will not be submitted to the server, the page will not be refreshed, this is the recent heat of Ajax development technology.

Javascript is not difficult, the complexity is limited, for simple development mastered 4-10 statements can, so don't worry.

6. With regard to the above
The above 5 points we call client technology, that is, the browser to receive, interpret, execute, display. Although the client
There are many technologies, and these are the most critical and the techniques we need to use in our tutorials. These technologies are also called static technologies, and their elements are the elements that make up the Web page display, so all we receive are these static elements that can be read and interpreted by the browser. And we receive these static elements are passed by the server, the server through the implementation, interpretation of a program, and ultimately the results of the operation and the original dynamic page of HTML, together into a static format file passed to the client, the client received, explained and displayed.

Third, the database (do not combine to see above)
There are a number of fruits, all types have, want to store up, how to put it good?
If you want to find all the apples from inside, wouldn't it be a lot of power?
If the warehouse has a closet, there are many boxes on the box, the boxes are the only number, a box to store a fruit, so find the apple is convenient, as long as the corresponding number of the box to find the line.

Information is also the case, to the village of their categorized into each table in the database, it is efficient to find. A database can have multiple tables, a table can have more than one field, a field stores a piece of information so that rows and columns are formed in a datasheet, and a row represents a whole new piece of data, such as the size of an apple, the weight, the color in the line corresponding to the column (field), and the next line is another apple.

If you want to write down each Apple feature, just put the Apple feature in the corresponding field in a row, and the next line will see another Apple, which is the database write.

If you want to see all the characteristics of Apple, very simple, read it out of the program, and then write into the HTML file, this is the database read out, need a piece of read it? No, the program can be read by itself, read one, and he will automatically read the next one. Read until there is no (judge without the condition), then how does the loop show it, first of all, you have to put the HTML tag is a line of tags together into the loop structure, so that when the data output to the page, it automatically loops the line structure, is to tell the HTML, add a line, add and then add, until you can not add to add, then how the table of each field information read out, as if you were digging potatoes in the ground, you bought a shovel, a long row of potatoes, and each of the potatoes on each side was the shovel (sci-fi), from the left, then to the right, The next line is a loop. Oh

There is the database deleted, such as an Apple rotten, you want to delete this Apple information, fortunately you know the Apple number, just tell the program the Apple number, and then do what processing can be deleted.

The last is the database update, an apple suddenly become fat, you have to change the record of his weight, you put the Apple number to the program and then tell him how much weight change pounds on it.

Fortunately, we have database software, as long as open the database software, in which to build a database, and then build a table in the data, and then write a few lines of code in the Web site program can be established with the database software to communicate.

Here we use Mmsql server this software, regardless of which database software, he accepted the query language is the same, are TSQL97 database query language, not many, a few definitions, whether read out, write, or delete updates are good, As long as we transfer the corresponding statements to the database system in the website page, the database system will be executed automatically, and the results of the execution returned to our program so that we can control the display of these data to get the final result.

Later, the database will be explained, as well as a variety of methods to explain;

Four, the dynamic website principle
1. The general principle of the dynamic website
Dynamic Web sites are generally sent by the browser request to the server, the server received the request after processing, according to the request,
Finally, the processing results are returned to the client for display.
2. Client General General Request
Whether in ASP, PHP, ASP.net, JSP, there are the following request method:
A. Form submission
The form is HTML (I use the HTML class called XHTML, etc., the same below) a tag, does not display meaning, the equivalent of a container, when the form of a button, the Click event occurred, the browser first detected the event, It then looks for all the elements in the form where the button is to transmit data to the server, records the markup of the data, and then sends it to the server for the specified processing page, which is specified in the action attribute of the form
<fron asction= "xxxx.aspx" mothed= "POST" ></from>
For example, published articles in the Forum, after the text box input information Press submission, the browser will pass this text box information to the server
Mothed Representation Form Submission method
B. Address positioning
Address positioning is typically not passing parameters, or the parameter is passed as part of the address to the server side.
Like a product page http://www.xx.com/product.asp?&id=10
Tell the server to find the product.asp and receive the parameter id=10 so that the program processes the page and reads the data from the parameters into the HTML file and passes it to the client.

3. ASP processing Process
IIS Information Service Program a process will run at all times, and it will accept requests when it discovers a client request
To verify the legality of the request, give the accepted request parameter a memory area store value, then will read the page and pass to the ASP interpreter according to the specified processing page, the ASP interpreter looks for the ASP tag, finds the corresponding meaning then starts the C language interpreter program, C language Interpreter According to the ASP code processing requests, and ultimately through the database reading, numerical operations, such as processing or final processing results, and these processing results converted to static elements in the page file to generate the final HTML format file into the cache, and notify the IIS Information service.

PHP and ASP belong to the scripting language, their process is basically the same, rely on C Language Program interpretation script language definition, and perform physical operations, generate the final result returned to the client.

4. ASP. NET processing process
Asp. NET is different from the script language process, it is basically the same as the JSP processing process.
When a server-side listener detects a request, it verifies the request, And start the execution of the corresponding ASP.net source program, which is written in another language, IL language is a kind of intermediate language that is close to the machine language, that is, no matter what language you write the ASP.net program, it will eventually get the Il language program, IL language can directly manipulate physics, perform operations, and the final result into and output.

V. The donet of the four facets
What's 1.DONET?
Microsoft. NET is a Microsoft XML Web services platform. XML WEB Services allows applications to communicate and share data over the Internet, regardless of which operating system, device, or programming language is in use. The Microsoft. NET platform provides the necessary to create XML Web services and integrate them together. The benefits to individual users are seamless, engaging experiences.

From the above, we can see that donet is not a development language, nor is it a development environment, he is a platform, it consists of a variety of content, to provide users with cross-platform development and deployment Services.

First we look at Donet's core. NET Framework, the highest version of the. NET Framework, currently 3.0, integrated into the Vista operating system, providing core drivers for Vista and various applications. The current version we normally use is 2.0.

The core of the. NET Framework is the execution environment of its runtime, known as the Common Runtime (CLR), from its history of development, Microsoft first gave the COM + technology (Component object model, component objects module. A software technology developed by Microsoft, allowing objects to be used by other software, allowing components to be reused, easy to update and maintain, and simply saying that Microsoft has written a function of many computer functions independently for use by third party applications. Third-party applications can easily implement functionality by simply invoking Microsoft's COM component. Without having to write a lot of code for the underlying physical operations, such as a mail-sending program, we don't need to know how the message is sent, how it is delivered, we just call a component and pass it to him, and the component sends us.

It can be imagined that or as an example of mail sent, I and you are using the Windows operating system, all want to write a program to send mail, if there is no other way, we can only one by one program, from the underlying physical access to the use of the transport protocol, if I want to write a second mail to send the program, And the first one is different, having to write some of the same code over and over again, which leads to inefficiency, since some of the same content, why not separate them, and only do different things, COM + provides this reusable functionality, encapsulating some of the processing process into the operating system, Call these functions when you need them to implement the function.

COM has his advantages also have his disadvantages, because of his openness to lead to more and more components, the same type of component versions and other reasons for programmers to create DLL Hell, can imagine tens of thousands of components in the programmer at a loss, some wrong references will cause the crash of the program, then Microsoft began his. NET strategy, in order to realize cross-platform and multi-platform interoperability, he first will WIN32 API collation reduction, from the initial nearly 80,000 APIs to the final 3,000 + API, all stored in a system, namely the. NET FRAMEWORK, respectively, in 14 categories, The final size is only more than 10 m, which provides a prerequisite for cross-platform, and you do not need to install Windows operating systems, just install them in your smart device. NET Framework can have all the programming features in the Windows system,

Then Microsoft learns Java, and he compiles the functions of the. NET Framework into an intermediate language, IL, which is encoded in numbers rather than text, so that it is closer to the machine language and easier to understand by the machine. Net You can go around like Java with his API, this is not enough, the library alone is not enough to support the entire application, but also need a programming language to manipulate these functions, Microsoft has been very strategic vision, he considered more users of the programming habits, from Java (Microsoft's J + + is actually a Java variant, For this also and Sun made a court lawsuit), to C + +, and then to VB to Daphi, and then to JavaScript, for Daphi created a DAPHI2000, the transformation of VB into a vb.net from object-based programming language into a completely object-oriented, and innovative a programming language that C #, C # is a synthesis of the advantages of C/c++/java and then improve a programming language, so you can find C C + + Java in his shadow, C#/c++/java also known as the C-based programming language, so we in asp.net programming, we choose C #

But why do so many programming languages write the same type of program? the. NET Framework function library is written in Il Intermediate language, why C++,daphi can use these functions, in fact, Microsoft played tricks, statements or C + + statements, or DAPHI statements, But the end is not C + +, not daphi, he will be the final compilation of these languages or IL language, so you use C + + is only a format, a code habit, the essence has changed, this is Microsoft's clever place, as long as you will be any of those languages, you can write. NET program, but in the end it is. NET program.

So we know two basic things in. NET: Class library (function library, in fact, the function is different from the class, just for the sake of understanding it is so called) and programming languages, programming languages manipulate functions in class libraries to achieve functionality

Actually, whether it's a website or not, or software, they are manipulating functions to perform operations, and then give results, but give the results of different ways, the site is through the network, the software is through the localization interface, they are only in some ways a little different, so there is a class library, with a programming language, There is another way to implement a variety of applications.

So. NET can be WinDOS application development, can also be Web application, can also be mobile application, will not be limited by platform and aspect

In a WinDOS application, it gives a method of the form, and the program eventually compiled into an EXE, in the Web application is given the method of the Web, compiled generated by the page file, and the source file, combined with the IIS ISAPI extension features can be released, so no matter what kind of development methods are good, They all use the same programming language, they share many functions, and some functions are specific to an application, and they end up generating IL intermediate languages.

Microsoft has brought VB to the development of the way. NET, that is, simple development, you can drag a control from the toolbox and set properties for simplistic development.

Controls are the output and container patterns that Microsoft has set up, followed by programs that simplify development by encapsulating output and hosting, and processing methods.

So we're going to break down the technology that asp.net to use.
Control provides us with events and containers, programming language for us to deal with, class library to provide us with the implementation of functions;

Other temporarily do not introduce, later in said.

2. Discussion on several ways of web site development
A. Traditional development modalities
Traditional web site development methods as you know, it is browser-based, web-based standards, the application of HTML, xhtml,dhtml and other traditional page technology, following the HTTP protocol, the client on the server side does not have too much interaction.
B. Asynchronous development methods
Following the beginning of Ajax asynchronous technology, browser-based, web-based standards, the application of HTML, xhtml,dhtml traditional page technology, asynchronous interactive data.
C. Rich client Development approach RIA UI
For example, Flash's flex technology. NET's expression technology, this should be the future mainstream, this kind of technology is separates the interface and the business and the data logic layer, moves the page state massive forward to the client, the Web server side organizes the resources, forms the Web service collection.

The concrete explanation is this kind of development way is divorced from the traditional html,xhtml,dhtml and so on page technology, the client and the server side use XML as the communication way, the massive page UI information (maxl,mxml) loads to the client to carry saves, the server end realizes the true Web service collection;

The flex approach is to make a caching container in the browser, asynchronous load execution to achieve a richer functional experience, Microsoft announced a long time ago to IE6.0 as IE's final version (IE7.0 is because his plan is postponed, the network changes, not to change) may be based on this consideration
C. Fat Client
Rich client can only say is more functional experience, fat client is fat, fat client has completely out of the browser,
From the traditional page way, is b/S and C/s development of the synthesis, if the previous one can be called bc/s, the latter is cb/s,c in front.
The specific development way is to customize the client to allow users to download to achieve a richer function, to the web to communicate, if you can not understand, may wish to think of the network game, the full screen into a full-screen, the game interface into the current network interface, in fact, this is not enough to explain. Now do you understand Web application development ≠ web site development?

Now in a period of technological change, if you are not sure that you will be a career, you will continue to be a programmer, you have to put your putting betting you on the new generation (also can be said to be this generation) of web technology and system of understanding, from choose one, Do not chase the WEB2.0 such a concept, real innovation has begun.

3. Small discussion c/s development mode
There is a saying so, everything is to web,it achievement web,web devour it.
b/S more and more heat, but does not mean that C/s will tend to and insipid, in the basic domain C/s can not be replaced, or even C language for so many years still strong, once very disgusted with C, hate Tam Hao Qiang fraught, now back to C language is so handsome, free and transparent and C + +.
Why no matter VB,VB has no medicine to save, Microsoft Boss Word of a year in Vista often occupy 60%, who dares to touch VB, so many object-oriented programming language, why also choose Vb,vb. NET only retains the type. Upgrade OK, no problem? Pure dreaming.
Why no matter Java,java good, but Java people are engaged in enterprise-level development, and occasionally to point J2ME, embedded development big guy, from C/s too far.
Daphi,daphi in the embedding and automation control of the market occupies a strong AH (especially in Dalian, such a heavy industrial enterprises many places), do not know why.
Look. Net of various languages, C/s or so popularized the vista to say.

The basic field of C and C + + in the holding, the others are getting closer to B/s.
The boundary between B/S and C/s is the inevitable trend of the general application field, so do not say that the site has no future Ah, is not found the future.

4. The impact of the Little Vista
Vista was postponed for more than two years before it was released, and if the June 04 estimate is not the way it is, at least we are now in the 64-digit computing age, and a lot of programmers are going to lose their jobs first. Our online behavior is not exactly the way it is.
What's the impact of releasing Vista now, first of all, people who have recently bought 32-digit computers say, "Wait to die." Second, to the motherboard does not support 64 people say, you have no hope.
Then to VB programmers say, you have been abandoned by the times, the programmers who are still relying on COM + and MFC programmers say, okay, but try to turn. For ASP developers, the future is no longer bright. Say to the PHP developer, look for another year or two to see if there is any hope, maybe. To the Phython developers, congratulations, you have been with Microsoft boss mixed. To the Ruby developer, say congratulations ahead of time, you're going to hang out with Microsoft boss. to C and C + + developers say, kingly or! To the Java developer, I don't care.

Complete!
In addition to the Vista 6 version of the 5 version of 64-bit, the core of Vista is. NET framework3.0, and it used to be called WinFX, it looks like WIN32 ah, like the right. and WWF,WCF,WPF, but some new words.



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.