MonoRail (software)

Last updated
Castle Project:MonoRail
Developer(s) Castle Project
Stable release
2.1 RC [1] / March 17, 2011 (2011-03-17)
Operating system Cross-platform
Type Application framework
License Apache 2.0
Website www.castleproject.org/projects/monorail

MonoRail (formerly called Castle on Rails), a component of the Castle Project, is an open source web application framework built on top of the ASP.NET platform. Inspired by Ruby on Rails Action Pack, [2] MonoRail differs from standard ASP.NET Web Forms development by enforcing separation of concerns using a model–view–controller (MVC) architecture. [3] The framework is commonly used in conjunction with Castle ActiveRecord, an ORM layer built on NHibernate. In January 2010, version 2.0 of MonoRail was released, however, many projects use the trunk version of the source to take advantage of new features without waiting for official releases.

Contents

Although the project's name is MonoRail, it does not have any affiliation with the Mono project.

How it works

The framework maps web requests to an "action", which is a regular .NET method on the controller. The controller is responsible for invoking business services and controlling the application's flow. When it is time to send the web response to the client, the controller sets a view template to be rendered, putting data in a special dictionary object known as the "Property Bag", and delegates the template rendering to a view engine.

The view engine renders the template into the response stream utilizing the data in the property bag given by the controller. At this stage the view cannot access any other layer of the application, isolating the view from the application logic.

View engines

The mainstream view engine used in MonoRail is NVelocity, based on the Apache Velocity library. NVelocity is supplied with simple control blocks such as if statements and foreach loops. The NVelocity view templates are text files with the extension '.vm'.

Other view engines in use:

Other view engines

Building other view engines is quite simple and straightforward. Brail, StringTemplate and AspView were all created by independent developers to suit their own needs.

Other view engine are:

  1. ASPX
  2. Spark
  3. NHaml
  4. NDjango
  5. Hasic
  6. Brail
  7. Bellevue
  8. SharpTiles
  9. String Template
  10. Wing Beats
  11. SharpDOM
  12. Razor
  13. Azure

Related Research Articles

ASP.NET is an open-source, server-side web-application framework designed for web development to produce dynamic web pages. It was developed by Microsoft to allow programmers to build dynamic web sites, applications and services.

JSP model 2 architecture

JSP Model 2 is a complex design pattern used in the design of Java Web applications which separates the display of content from the logic used to obtain and manipulate the content. Since Model 2 drives a separation between logic and display, it is usually associated with the model–view–controller (MVC) paradigm. While the exact form of the MVC "Model" was never specified by the Model 2 design, a number of publications recommend a formalized layer to contain MVC Model code. The Java BluePrints, for example, originally recommended using EJBs to encapsulate the MVC Model.

Ruby on Rails Server-side open source web application framework

Ruby on Rails, or Rails, is a server-side web application framework written in Ruby under the MIT License. Rails is a model–view–controller (MVC) framework, providing default structures for a database, a web service, and web pages. It encourages and facilitates the use of web standards such as JSON or XML for data transfer and HTML, CSS and JavaScript for user interfacing. In addition to MVC, Rails emphasizes the use of other well-known software engineering patterns and paradigms, including convention over configuration (CoC), don't repeat yourself (DRY), and the active record pattern.

A web framework (WF) or web application framework (WAF) is a software framework that is designed to support the development of web applications including web services, web resources, and web APIs. Web frameworks provide a standard way to build and deploy web applications on the World Wide Web. Web frameworks aim to automate the overhead associated with common activities performed in web development. For example, many web frameworks provide libraries for database access, templating frameworks, and session management, and they often promote code reuse. Although they often target development of dynamic web sites, they are also applicable to static websites.

Laminas Project is an open source, object-oriented web application framework implemented in PHP 7 and licensed under the New BSD License. The framework is basically a collection of professional PHP-based packages. The framework uses various packages by the use of Composer as part of its package dependency managers; some of them are PHPUnit for testing all packages, Travis CI for continuous Integration Services. Laminas provides to users a support of the model–view–controller (MVC) in combination with Front Controller solution. MVC implementation in Laminas has five main areas. The router and dispatcher functions to decide which controller to run based on data from URL, and controller functions in combination with the model and view to develop and create the final web page.

The Spring Framework is an application framework and inversion of control container for the Java platform. The framework's core features can be used by any Java application, but there are extensions for building web applications on top of the Java EE platform. Although the framework does not impose any specific programming model, it has become popular in the Java community as an addition to the Enterprise JavaBeans (EJB) model. The Spring Framework is open source.

Grails is an open source web application framework that uses the Apache Groovy programming language. It is intended to be a high-productivity framework by following the "coding by convention" paradigm, providing a stand-alone development environment and hiding much of the configuration detail from the developer.

Web template system System in web publishing that lets web designers and developers work with web templates to automatically generate custom web pages

A web template system in web publishing lets web designers and developers work with web templates to automatically generate custom web pages, such as the results from a search. This reuses static web page elements while defining dynamic elements based on web request parameters. Web templates support static content, providing basic structure and appearance. Developers can implement templates from content management systems, web application frameworks, and HTML editors.

Scaffolding, as used in computing, refers to one of two techniques: The first is a code generation technique related to database access in some model–view–controller frameworks; the second is a project generation technique supported by various tools.

Template processor Software designed to combine templates with a data model to produce result documents

A template processor is software designed to combine templates with a data model to produce result documents. The language that the templates are written in is known as a template language or templating language. For purposes of this article, a result document is any kind of formatted output, including documents, web pages, or source code, either in whole or in fragments. A template engine is ordinarily included as a part of a web template system or application framework, and may be used also as a preprocessor or filter.

Stripes is an open source web application framework based on the model–view–controller (MVC) pattern. It aims to be a lighter weight framework than Struts by using Java technologies such as annotations and generics that were introduced in Java 1.5, to achieve "convention over configuration". This emphasizes the idea that a set of simple conventions used throughout the framework reduce configuration overhead. In practice, this means that Stripe applications barely need any configuration files, thus reducing development and maintenance work. It has been dormant since 2016.

Castle Project is an open-source application framework for CLI platform implementations.

Haml is a templating system that is designed to avoid writing inline code in a web document and make the HTML cleaner. Haml gives the flexibility to have some dynamic content in HTML. Similar to other web languages like PHP, ASP, JSP and template systems like eRuby, Haml also embeds some code that gets executed during runtime and generates HTML code in order to provide some dynamic content. In order to run Haml code, files need to have a .haml extension. These files are similar to .erb or eRuby files which also help to embed Ruby code while developing a web application.

ASP.NET MVC is a web application framework developed by Microsoft that implements the model–view–controller (MVC) pattern. It is no longer in active development. It is open-source software, apart from the ASP.NET Web Forms component, which is proprietary.

Web2py is an open-source web application framework written in the Python programming language. Web2py allows web developers to program dynamic web content using Python. Web2py is designed to help reduce tedious web development tasks, such as developing web forms from scratch, although a web developer may build a form from scratch if required.

Text Template Transformation Toolkit is a free and open-source template-based text generation framework. T4 source files are usually denoted by the file extension ".tt".

Java view technologies and frameworks are web-based software libraries that provide the user interface, or "view-layer", of Java web applications. Such application frameworks are used for defining web pages and handling the HTTP requests (clicks) generated by those web pages. As a sub-category of web frameworks, view-layer frameworks often overlap to varying degrees with web frameworks that provide other functionality for Java web applications.

Jspx-bay

jspx-bay, commonly referred to as jspx, is a free open source pure Java web RAD framework. Jspx should not be confused with other technologies using the same name like Oracle Application Framework and XML JSP.

Play Framework Open-source web framework written in Scala

Play Framework is an open-source web application framework which follows the model–view–controller (MVC) architectural pattern. It is written in Scala and usable from other programming languages that are compiled to JVM bytecode, e.g. Java. It aims to optimize developer productivity by using convention over configuration, hot code reloading and display of errors in the browser.

ASP.NET Web Forms is a web application framework and one of several programming models supported by the Microsoft ASP.NET technology. Web Forms applications can be written in any programming language which supports the Common Language Runtime, such as C# or Visual Basic. The main building blocks of Web Forms pages are server controls, which are reusable components responsible for rendering HTML markup and responding to events. A technique called view state is used to persist the state of server controls between normally stateless HTTP requests.

References

  1. http://www.castleproject.org/download/
  2. Ruby on Rails Action Pack
  3. "InfoQ: Catching up with the Castle Project" . Retrieved 13 September 2007.
  4. Parr, Terence. Enforcing Strict Model-View Separation in Template Engines

Further reading

Resources

Blogs on MonoRail