Home About Us Solutions Process Partners Clients Contact Us Blog
Out of the box, into the VAULT
Here you'll find posts on trends we see in the financial services industry, the evolving landscape of Internet web design and ecommerce, things affecting Toronto & the community we live in, the environment, life and death. 

Blog Roll:

Web Application Projects versus Web Site Projects

 Permanent link   All Posts

When creating a web project in the Microsoft .NET Framework there are two basic project types: Web Application Project and Web Site Project. Though they sound similar there are a number of differences between them and the main difference between a web application project and a web site project boils down to when compilation happens.

 

First, a bit of background 

 

Occular Accessory Often Worn By Developers Who Write Blog Articles About Compilers 

Occular Accessory Often Worn By Developers Who Write Blog Articles About Compilers

Compilation is the process by which code, written by developers, is converted into a machine readable format. So while a developer may write a program in C# or Java, a computer cannot understand these languages directly. The program must first be converted from C# or Java into a machine readable format. This process is called compilation, taking something human-readable and making it machine-readable. Of course, a consequence of this is that if the code is changed the program needs to be recompiled.

 

With Web Site Projects compilation happens at run-time. So when a user hits a particular page the code for that page is compiled behind the scenes and then executed. With Web Application Projects compilation happens for all pages ahead of time, before the site is deployed to the production environment. When a user hits a page the code for that page is immediately executed. The extra step of compilation isn’t required because the code is already compiled.

 

Why should you care? 

 

Seems like a no brainer. Just go with the pre-runtime compilation offered by a Web Application Project and save the lag time induced by the runtime compilation of a Web Site Project. And as an added bonus since the compiler performs a number of consistency checks before compilation, pre-compiling the code helps the developer identify potential issues with the code before it’s deployed to a production environment.

 

However it’s not as simple as that. The choice of when to do compilation has some side-effects.

 

Pre-compiling the code base means that when changes to any part of the code are made the code for the entire site must be recompiled. This can cause some discomfort for site administrators responsible for production deployments. Since the entire code base is being deployed to the production environment for even the smallest code change, a number of questions arise. How can the administrator be sure other changes weren’t accidentally introduced to the code running on production? Does the entire site now need to be retested? What effect do these changes to the code have on the rest of the site?

 

With run-time compilation, only the code that has changed will need to be recompiled and only when needed.

 

Which is best? 

 

Which methodology should you follow on your next project? Do the performance benefits and extra layer of checks with a Web Application Project outweigh the comfort afforded by only deploying the files directly affected by the change (and not the entire code base)?

 

On this there is some debate but it is generally agreed that for larger, enterprise-level deployments the Web Application Project is the way to go. For smaller sites, Web Site Projects make sense. VAULT usually goes with a Web Application Project.

 

Additional Reading 

 

There are additional benefits and drawbacks to both project types that stem from the main differentiator: pre-compiled/runtime compiled. Microsoft has provided a handy page that summarizes them here.


Leave a comment
Name *
Email *
Homepage
Comment

Recent Posts:

Blog Archive:

Privacy Policy   |   Legal   |   Contact Us   |   Site Map