MonoRail (software)

MonoRail (software)
Castle Project:MonoRail
Developer(s) Castle Project
Stable release 2.0 / January 17, 2010; 20 months ago (2010-01-17)
Operating system Cross-platform
Type Application framework
License Apache 2.0
Website castleproject.org

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[1], MonoRail differs from standard ASP.NET Web Forms development by enforcing separation of concerns using a model-view-controller (MVC) architecture.[2] The framework is commonly used in conjunction with Castle ActiveRecord, an ORM layer built on NHibernate. On January 2010, version 2.0 of MonoRail was released, however, many projects use the trunk version of the source to leverage new features without waiting for official releases.

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

Contents

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:

  • Brail, based on the Boo language. Being a .NET language, the Brail view engine has stronger capabilities, as the view programmer can use the Base Class Library methods. However, power comes with its price, as it opens the possibility to do too much in the view, leaving some responsibility for Separation of concerns in the hands of the programmer. The view templates are text files with the extension '.brail'.
  • AspView, a view engine that uses C# as its scripting language, and uses a pre-compiled approach, where all the views are pre-compiled to a .NET Assembly prior to deployment. The view templates are text files with the extension '.aspx'.
  • WebForms ViewEngine lets you use some of the power of Web Forms in your MonoRail applications. The use of the WebForms view engine is quite sparse, and is only recommended for a migration phase from an existing Web Forms application to a MonoRail application. The view templates are text files with the extension '.aspx'.
  • StringTemplate is the most strict view engine in terms of MVC.[3]
  • Spark View Engine new view engine popular among ASP.NET MVC developers, supports MonoRail as well.

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.

References

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

Further reading

  • James Avery, Jim Holmes, Windows developer power tools, O'Reilly Media, 2006, ISBN 0596527543, pp. 963–972 (18.6 Simplifying Web Development with Castle MonoRail)
  • Steven Sanderson, Pro ASP.NET MVC Framework, Apress, 2009, ISBN 1430210079, p. 12 (Comparisons with MonoRail)

External links

Resources

Blogs on MonoRail


Wikimedia Foundation. 2010.

Игры ⚽ Поможем решить контрольную работу

Look at other dictionaries:

  • Monorail (disambiguation) — Monorail and similar can mean: Monorail, for its use in transportation Overhead crane, for its use in mechanical handling Monorail camera, for its use in photography MonoRail (software) (formerly called Castle on Rails), for computer programming …   Wikipedia

  • Mambo (software) — Mambo Developer(s) Mambo Foundation Inc. Discontinued 4.6.5 [1] / June 26, 2008; 3 years ago (2008 06 26) Written in …   Wikipedia

  • Midgard (software) — For other uses, see Midgard (disambiguation). Midgard AJAX inline editing of content in Midgard …   Wikipedia

  • Catalyst (software) — For the ATI graphic driver software, see AMD Catalyst. Original author(s) Sebastian Riedel Stable release 5.90001 / August 15, 2011; 2 months ago (2011 08 15) …   Wikipedia

  • Horde (software) — Horde Application Framework Developer(s) The Horde Core Team Stable release 4.0 / April 5 …   Wikipedia

  • Dancer (software) — For actual Dancing, see Dancer. Original author(s) Alexis Sukrieh Stable release 1.3072 / August 23, 2011; 2 months ago (2011 08 23) Written in Perl …   Wikipedia

  • Chennai Metro — Not to be confused with Chennai Metropolitan Area. For the first generation metro system in Chennai, see Mass Rapid Transit System (Chennai). Chennai Metro சென்னை மெட்ரோ Info Own …   Wikipedia

  • Moscow — This article is about the capital of Russia. For other uses, see Moscow (disambiguation). Moscow Москва (Russian)   Federal city   …   Wikipedia

  • Namma Metro — ನಮ್ಮ ಮೆಟ್ರೊ Info Locale Bangalore, India Transit type Rapid transit …   Wikipedia

  • Sprint Nextel — Corporation Type Public company Traded as NYSE: S NASDAQ:  …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”