Monorail Introduction


Published on

Showing Monorail functionality with a sample application.
Uses Castle Active Record and windsor integration.

Published in: Technology, Education
1 Like
  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide
  • Monorail Introduction

    1. 1. An Introduction to Monorail. <ul><ul><li>Andrea Magnorsky </li></ul></ul><ul><ul><li>An Open Source MVC framework </li></ul></ul>
    2. 2. Monorail <ul><li>Open Source </li></ul><ul><li>MVC on top of Asp.Net </li></ul><ul><li>Separation of Concerns </li></ul><ul><li>Mature </li></ul><ul><li>Convention over configuration </li></ul>
    3. 3. What am I showing <ul><li>Monorail: MVC framework </li></ul><ul><li>With a model implemented using Active Record </li></ul><ul><li>With Windsor integration. Windsor is an inversion of control container. </li></ul><ul><li>Using Nvelocity as a view engine. </li></ul><ul><li>Why am I showing all this? Because although they are separate components they work nicely together. </li></ul>
    4. 4. How Monorail works
    5. 5. Build it and they will learn it? <ul><li>Twitter App </li></ul><ul><li>User can send Updates </li></ul><ul><li>User can follow other users </li></ul><ul><li>Lets see the Demo </li></ul>
    6. 6. Model <ul><li>Uses Active Record </li></ul><ul><li>Convention over Configuration </li></ul><ul><li>Default set of operations </li></ul><ul><li>Works on top of Nhibernate </li></ul><ul><li>You dont have to use ActiveRecord. </li></ul><ul><li>Lets look at the code for the model </li></ul>* * *
    7. 7. Controller <ul><li>Orchestrates the application flow. </li></ul><ul><li>Convention is <name>Controller ( ie HomeController) </li></ul>
    8. 8. Actions <ul><li>Corresponds to methods in the controller. </li></ul><ul><li>Corresponding view (in Views/<controller name>/<action name>) Can be changed </li></ul><ul><li>Example: /Login/Login.rails </li></ul>
    9. 9. Layouts & Rescues <ul><li>Layouts. </li></ul><ul><ul><li>Not mandatory, use as template. </li></ul></ul><ul><ul><li>In Views/Layouts </li></ul></ul><ul><li>Rescues. To Handle exceptions </li></ul>
    10. 10. SmartDispatcherController <ul><li>Databinding. Parameters as strongly typed objects </li></ul>
    11. 11. Controller <ul><li>Filters. </li></ul><ul><ul><li>Executed Before or after an action </li></ul></ul><ul><ul><li>Normally used for Authentication, logging </li></ul></ul><ul><ul><li>Associated with a controller </li></ul></ul>
    12. 12. Controller <ul><li>Helpers </li></ul><ul><ul><li>Associated with controller. Available in the view. </li></ul></ul><ul><ul><li>There are many helpers. (FormHelper, UrlHelper) </li></ul></ul><ul><ul><li>You can create your custom Helper </li></ul></ul>
    13. 13. PropertyBag <ul><li>The standard way to pass information from the controller to the view </li></ul><ul><li>Not Strongly Typed </li></ul>
    14. 14. Flash <ul><li>A way to persist information between requests </li></ul><ul><li>Normally used to retrieve information about an operation to a user, for example on error. </li></ul>
    15. 15. Windsor Integration <ul><li>Windsor is an Inversion of Control (IoC) container. </li></ul><ul><ul><li>Promotes loose coupling </li></ul></ul><ul><ul><li>Makes you write small classes that have a well defined responsibility. </li></ul></ul><ul><li>Without the integration you can use windsor (or other IoC) for services, but its more coupled. </li></ul><ul><li>Without it, controllers coupled to services and possibly IoC container </li></ul>
    16. 16. Windsor Integration
    17. 17. Windsor Integration
    18. 18. Windsor Integration
    19. 19. Windsor Integration
    20. 20. Controller Testing <ul><li>Careful you don't test the framework </li></ul><ul><li>Controllers should be skinny </li></ul>
    21. 21. Views <ul><li>View Engines </li></ul><ul><ul><li>Nvelocity </li></ul></ul><ul><ul><li>Brail </li></ul></ul><ul><ul><li>AspView </li></ul></ul><ul><ul><li>Others (contributed by Users) </li></ul></ul><ul><li>Layouts. Template views that define the layout </li></ul><ul><li>Rescues </li></ul>
    22. 22. Deployment <ul><li>IIS </li></ul><ul><li>Cassini (only for early development ) </li></ul><ul><li>Monorail can be run on Mono via Apache </li></ul><ul><li>Some Tweaking normally required </li></ul><ul><li>Monorail applications can also be run on the cloud (like EC2 instances) </li></ul><ul><ul><li>Check for more info on how to do this </li></ul></ul>
    23. 23. Thanks Links and Q&A <ul><li>Thanks to my friend and colleague Andrew Smith for his help and Advice on this presentation. </li></ul><ul><li>Questions? You can contact me through my website </li></ul><ul><li>Links: </li></ul><ul><ul><li> </li></ul></ul><ul><ul><li> </li></ul></ul>