Cloud Foundry: Design and Architecture
Derek Collison discusses the goals, the design premises and patterns employed in creating the architecture of Cloud Foundry, VMware’s open source PaaS, unveiling internal architectural details.
The content has been bookmarked!
There was an error bookmarking this content! Please retry.
Posted by Jonathan Allen on Jul 05, 2010
With last week’s introduction of Razor, there are now four major view engine for ASP.NET MVC. The others are Spark, NHaml, and the traditional ASPX file templates. This article introduces the four engines with a special focus on the new Razor engine.
The ASPX style view engine dates back to classic ASP. Place holders using the <%= %> or newer <%: %> syntax predominate this style. Over time ASPC controls were added and then master pages, but this also brought with it an expensive page life-cycle.
Spark, which is also usable in Castle Project’s MonoRail, takes a slightly different approach. While it does support placeholders, it also freely mixes HTML and code using special attributes and tags. While it can be somewhat verbose, it does have the advantage of being fully XML compliant.
NHaml is a .NET implementation of the Haml markup language. This language doesn’t use XML-like syntax at all. Using a sort of short-hand, it dispenses with a lot of the former’s syntactical noise such as end-tags.
The newest view engine if Microsoft’s Razor. Though all templating systems share some characteristics, this one is distinct from three view engines we have discussed so far. Unlike NHaml it still uses XML for markup, but unlike Spark it doesn’t go so far as to use XML for code. It isn’t exactly like ASPX either as it replaces the somewhat clumsy place holders with just the @ symbol followed by an expression or normal control block. No special end-marker is required, so the resulting code is quite terse.
By default all text from an @ expression is HTML-encoded. Text inside an @ block can contain “content blocks”. Identified by any XML tags, these switch you back to HTML mode much in the same way classic ASP developers used the %> html <%= trick. If you don’t actually want a tag to be emitted you can use <text> as a placeholder.
Since it uses existing VB or C# syntax, Microsoft expects Razor to be easy to learn. And while any text editor can be used, Visual Studio 2010 will be updated to offer full Intellisense for Razor files.
Another important feature for Razor is it’s compatibility with unit testing frameworks. Razor templates will not require a controller or web-server to host, so views written with it should be fully testable. While in theory anything can be tested, ASPX makes it rather difficult and the other two engines don’t really talk about testability in their respective web sites.
All four view engines support the concept of master pages, so there isn’t much to be said on this topic. Precompiling views into assembles is supported partially by ASPX and fully by Razor and Spark. NHaml currently has this on list of feature requests. What’s particularly interesting about Razor and Spark is that their precompiled views and be used for non-hosted scenarios like mail-merge engines.
Visual Studio vNext: ALM features for Agile Planning, Team Collaboration
Automating Error Reporting for .NET Applications
Troubleshoot Java/.NET performance while getting full visibility in production
Have you seen the NDjango view engine ? It is a port of Django templates to .NET written in F#. It also comes with Visual Studio extension including full blown Intellisense support. I would love to hear what you have to say about it.
Full disclosure - I am the owner of the project
ASP.NET MVC view engine comparison wiki on stackoverflow.com (currently lists 12 view engines for ASP.NET MVC)
Derek Collison discusses the goals, the design premises and patterns employed in creating the architecture of Cloud Foundry, VMware’s open source PaaS, unveiling internal architectural details.
Andrew Watson talks about the work of the OMG, where CORBA is alive and well (hint: in your car), UML and UML Profiles vs. custom Modeling languages, DDS and other middleware, and much more.
Sohil Shah discusses creating iPhone and Android enterprise mobile applications based on cloud services using the open source platform OpenMobster.
Paul Sanford presents the transformations supported by data throughout its life cycle, and how that can be better done with Splunk, an engine for monitoring and analyzing machine-generated data.
A common “best practice” for unit tests is to only write a one assertion in each test. I intend to question this advice by showing that multiple assertions per test are both necessary and beneficial.
John Rauser presents the architectural and technological evolution of Amazon retail websites starting with 1994 and ending with adopting Amazon Web Services.
Michael Stal discusses system architecture quality, how to avoid architectural erosion, how to deal with refactoring, and design principles for architecture evolution.
Every developer has had to integrate with another system, API or component. Tis article provides strategies to handle the change and for he separating system boundaries.
3 comments
Watch Thread Reply