ArticleslgStudy

computer science

MonoRail (software)

MonoRail (software) is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand MonoRail (software) rather than just read about it. In short: 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, MonoRail differs from standard ASP.NET Web Forms development by enforcing separation of concerns using a model–view–controller (MVC) architecture.

Key takeaways

  • MonoRail (software) belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect MonoRail (software) to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of MonoRail (software) from memory before moving on to harder problems.

Reference excerpt

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, MonoRail differs from standard ASP.NET Web Forms development by enforcing separation of concerns using a model–view–controller (MVC) architecture. 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. 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:

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. Spark View Engine is a new view engine popular among ASP.NET MVC developers, supports MonoRail as well.

Other view engines Building other view engines is straightforward. Brail, StringTemplate and AspView were all created by independent developers to suit their own needs. Other view engine are:

References

Further reading James Avery, Jim Holmes, Windows developer power tools, O'Reilly Media, 2006, ISBN 0-596-52754-3, pp. 963–972 (18.6 Simplifying Web Development with Castle MonoRail) Steven Sanderson, Pro ASP.NET MVC Framework, Apress, 2009, ISBN 1-4302-1007-9, p. 12 (Comparisons with MonoRail)

External links

Resources MonoRail Documentation Presentation on MonoRail

Blogs on MonoRail Hamilton Verissimo's Blog Archived 2007-09-11 at the Wayback Machine, the founder of the Castle Project Ayende Rahien's Blog (Oren Eini), the creator of the Brail view engine Eleutian's Blog .net and other musings Ken Egozi's Blog, the creator of the AspView ViewEngine Adam Esterline's Blog

Worked examples

Example 1 — a first encounter with MonoRail (software)

Start with the simplest possible case. Write down what MonoRail (software) claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to MonoRail (software) before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about MonoRail (software) ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of MonoRail (software)

In research
MonoRail (software) appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses MonoRail (software) in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
MonoRail (software) is common in secondary-school and first-year university syllabi. It links to neighbouring topics C Sharp libraries, Free computer libraries, so understanding it makes those chapters shorter.
In everyday life
Look for MonoRail (software) outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “MonoRail (software)” →

How to study MonoRail (software) in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what MonoRail (software) means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain MonoRail (software) out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is MonoRail (software) in simple terms?

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, MonoRail differs from standard ASP.NET Web Forms development by enforcing separation of concerns us…

Why does MonoRail (software) matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study MonoRail (software)?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on MonoRail (software).

Tags

  • C Sharp libraries
  • Free computer libraries

Keep exploring