Use EF to develop Web applications (15): EF servlet, or efsp?

Source: Internet
Author: User

Question:There is no precedent for developing Web applications with "easy language. Flying" (EF. However, because the EF Local Development Kit (efndk) has been released, it is not difficult to use C/C ++ to develop an EF class library to support EF in developing web applications. Of course, we can imagine that there are many difficulties to solve. This series of articles is a record of my exploration process and may not be of much value to outsiders. If some netizens are optimistic about it, please wait rationally. Author: liigo. For more information, see http://blog.csdn.net/liigo /. Online messages.

Use EF to develop Web applications (15): EF servlet, or efsp?

 

After a series of previous theories and practices, developing common network programs with efcgi should be said to be fully competent. This is without a doubt. Even if some work is not done for the moment (such as file upload and Verification Code Generation), it is also a matter of detail, and it is not affected by the entire framework.

CGI/FastCGI/efcgi is good, but virtual host providers are not happy.

You think, a common network application usually consists of n cgi programs. Each CGI program must start N processes (FastCGI ), the virtual host provider must provide services for N sites at the same time. It can be inferred that it is easy to run more than three processes simultaneously on the server, this is a huge burden on servers. If the VM provider cannot control or restrict cgi/FastCGI/efcgi applications, they would rather not provide the service. It turns out that there are not many such VM services.

Virtual Host providers are not happy, so we can leave developers alone. After all, there are a few who have their own servers.

It is necessary to make improvements (or compromise ?).

PHP has a PHP-CGI program, which serves as the general agent and is used to process all (from PhP) cgi/FastCGI requests on the server. In this way, other cgi/FastCGI programs are no longer needed for the entire network application, and only a limited number of PHP-CGI processes can be started on the server, effectively reducing the server load.

So we can do the same thing.Ef-CGIProgram, as the general agent, specially handles all CGI/FastCGI requests on the server. This program is very easy to use "easy language. flying "implementation, it is itself a common cgi/FastCGI/efcgi program, just get the user's actual request through the Environment Variable script_name, and do some additional forwarding processing. (Of course, optimization, caching, and security must be considered in practical applications .) Currently, mainstream Web servers support this mode. You only need to make some simple configuration.

With ef-CGI, the general agent and all other cgi/FastCGI/efcgi programs canceled, why do they really handle requests? Java has JSP (Java Server Pages), Microsoft has ASP (Active Server Pages), we can also haveEfsp(EF server pages. Of course this is feasible. Of course, this is not feasible at present, because: 1. It has become a script for interpreting execution, which has lost the advantages of EF efficient execution and is not obviously competitive with JSP/asp/PHP/perl/Ruby and other advanced products; 2. At present, EF must be compiled and executed (although Wu Tao planned to develop EF scripts very early, he does not know when to start it ).

The general agent ef-CGI should be retained, and the script should not be used. For details, refer to Java Servlet. By the way, let's do it.EF Servlet. The initial idea is that a "easy language. Flying" Class Library (*. EFL) corresponds to a servlet, and a class corresponds to a page. "Easy language. flying class library (*. EFL) has been compiled as a local machine code, so the execution efficiency is efficient and the loading process is negligible. In the future, it will be used with the dynamic loading and uninstallation of class libraries, we also hope to achieve the "hot upgrade" effect. This scheme should be feasible for the moment, and I (liigo) has conducted preliminary verification.

 

The above content is the result of a joint discussion with bywayboy. The idea is not very mature. Please criticize and correct it.

 

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.