Monorail (.Net)

Monorail (.Net)

Infobox_Software
name = Castle Project:MonoRail


caption =
developer = [http://www.castleproject.org/ Castle Project]
latest_release_version = 1.0 Release Candidate 3
latest_release_date = September 20th, 2007
operating_system = Cross-platform
genre = Application framework
license = Apache 2.0
website = [http://www.castleproject.org/monorail/index.html castleproject.org]

MonoRail, 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 [http://ap.rubyonrails.org ] , MonoRail differs from standard ASP.NET WebForms development by enforcing separation of concerns using a model-view-controller (MVC) architecture.cite web | url = http://www.infoq.com/news/2007/09/castleproject | title = InfoQ: Catching up with the Castle Project | accessdate = 13 Sept 2007] The framework is commonly used in conjunction with Castle ActiveRecord, an ORM layer built on NHibernate.

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 [http://castleproject.org/monorail/documentation/trunk/viewengines/nvelocity/index.html 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:
* [http://castleproject.org/monorail/documentation/trunk/viewengines/brail/index.html 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'.
* [http://www.kenegozi.com/Blog/Tag/aspview.aspx 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'.
* [http://castleproject.org/monorail/documentation/trunk/viewengines/webforms/index.html WebForms ViewEngine] lets you use some of the power of WebForms 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 WebForms 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. [Parr, Terence. [http://www.cs.usfca.edu/~parrt/papers/mvc.templates.pdf Enforcing Strict Model-View Separation in Template Engines] ]

Other View Engines

Building other view engines is quite simple and straightforward. [http://castleproject.org/monorail/documentation/trunk/viewengines/brail/index.html Brail] , StringTemplate and [http://www.kenegozi.com/Blog/Tag/aspview.aspx AspView] were all created by independent developers to suit their own needs.

Resources

* [http://www.castleproject.org/monorail/documentation/trunk/index.html MonoRail Documentation]
* [http://api.castleproject.org/ Castle Project API Reference]
* [http://using.castleproject.org/display/MR/Home User Contributed Documentation and Resources]
* [http://www.kenegozi.com/Blog/Files/download.aspx?filename=MonoRail-AspView-Presentation.zip Presentation on MonoRail]
* [http://using.castleproject.org/display/Contrib/Castle+Visual+Studio+Integration Castle Visual Studio Integration]

Blogs on MonoRail

* [http://hammett.castleproject.org/ Hamilton Verissimo's Blog] , the founder of the Castle Project
* [http://www.ayende.com/blog/ Ayende Rahien's Blog (Oren Eini)] , the creator of the Brail view engine
* [http://blog.eleutian.com/ Eleutian's Blog]
* [http://benl.wordpress.com/tag/monorail/ .net and other musings]
* [http://www.kenegozi.com/blog/ Ken Egozi's Blog] , the creator of the AspView ViewEngine
* [http://adamesterline.com/tag/monorail/ Adam Esterline's Blog]

References


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

  • MonoRail (software) — Castle Project:MonoRail Developer(s) Castle Project Stable release 2.0 / January 17, 2010; 20 months ago (2010 01 17) Operating system …   Wikipedia

  • Monorail history — The term monorail or industrial monorail is used to describe any number of transport systems in which a chair or carrier is suspended from, or rides on, an overhead rail structure. Unlike the well known duo rail system, there are many rail guided …   Wikipedia

  • Monorail — Eine Einschienenbahn ist eine dem Passagier oder Gütertransport dienende Bahn, die auf oder unter einem einzelnen schmalen Fahrweg („Schiene“, „Fahrbalken“) fährt. Dieser kann unterschiedliche Formen annehmen und aus verschiedenen Materialien… …   Deutsch Wikipedia

  • Gyro monorail — The gyro monorail, gyroscopic monorail, gyro stabilized monorail, or gyrocar all denote a single rail land vehicle, road or rail, which uses the gyroscopic action of a spinning wheel, which is forced to precess, to overcome the inherent inverted… …   Wikipedia

  • KL Monorail — The KL Monorail is a monorail system (previously known as Peoplemover Rapid Transit PRT) in Kuala Lumpur, Malaysia, opened 31 August 2003, and serves 11 stations running 8.6 km with two parallel elevated tracks. It connects the Kuala Lumpur… …   Wikipedia

  • Walt Disney World Monorail System — Info Locale Walt Disney World Resort Transit type Monorail …   Wikipedia

  • Moscow Monorail — Info …   Wikipedia

  • Castle Monorail — ist ein auf ASP.net basierendes, quelloffenes Web Applikations Framework, welches dem Model View Controller Schema folgt. Castle Monorail ist von Ruby on Rails inspiriert und Teil des umfassenderen Applikations Frameworks Castle Project. Weblinks …   Deutsch Wikipedia

  • ASP.NET — Not to be confused with UNESCO ASPNet. ASP.NET Developer(s) Microsoft Initial release January 2002 Stable release 4.0.30319.1 (4.0) / 12 April 2010; 18 months ago (2010 04 12) …   Wikipedia

Share the article and excerpts

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