So Ryan, the apostle of everything on the web, has been spreading the gospel of Open Rasta for months. Tonight I decided that finally, I should download and give this fantastical framework a shot.
For an explanation on what OpenRasta is and is not, I shall direct you to their sites:
Open Rasta Documentation Open Rasta Download Home What I am going to do is just describe my experience trying their framework for the first time.
I am a person that likes to learn by trying so I immediately jumped to the ‘creating your first OpenRasta website’ (here). I have looked at some of Ryan’s code and have survived several conversations with Ryan over the framework. ;) I believe that is enough preparation for at least a simple tutorial.
Well I go to the modifying the web.config section and was left with a broken solution. Apparently from the time the tutorial was written and the time I downloaded the version 2.0.2039.312, the handlers and modules all moved to another assembly. I had a gut feeling it moved and when I talked to Ryan, he confirmed my suspicions. Supposedly he is going to try and update the tutorial.
In the meantime, just change ….”OpenRasta.Web.OpenRastaHandler, OpenRasta”
to… “OpenRasta.Hosting.AspNet.OpenRastaHandler, OpenRasta.Hosting.AspNet”
So change the assembly reference from the OpenRasta.dll to the OpenRasta.Hosting.AspNet.dll
I assume if you are reading this you have the skill set to modify said correction for the other references.
After that I breezed through the creation of the ‘Home’ resource and the ‘Home’ handler. No duh? Any programmer can make a couple of classes. :)
I’m at the configuration section and I have to say, I love the fluent interface. Anyone who has talked to me in the past 6 months knows I love the pattern. It instantly makes any framework extremely approachable.
The tutorial has you making a manual configuration. I tried to find an auto configuration just using some intellisense with no luck. I will investigate this further. If I was going to use OpenRasta I would definitely want a convention based solution. Even with a nice fluent interface, I really don’t want to manually create all my mappings by hand.
But there is something to be said for simply creating a mapping like :
1 2 3 4 |
|
I ran the app expecting the 405 method error as the tutorial predicts.. and got an empty page. I was using FireFox, so I jumped over to IE and was then greeted by the 405 error. I assume FireFox is either handling the problem gracefully or I don’t have some settings setup to display these errors. /shrug
So then I created my ‘Get’ method on my HomeHandler. One of the things that did attract me to OpenRasta was the POCO handlers. I’ve grown to appreciate very clean code with some acceptable conventions. Just makes life easier. I can focus on the domain problem and not the intricacies of any given framework.
Most of this seemingly new re-invention of HTTP as ESB, REST, Atom.. etc is interesting in that its a reexamining of a technology we use all the time. I haven’t done web development in roughly 3 years. The majority of my experience is in smart client apps. That is just the way my career and projects played out for me. The websites I created were always very basic and probably crap if judged by web developer gurus.
Anyway.
We click links and magically we get a web page. We don’t really think much about it. Sort of like turning on a light switch or starting your car. We just expect things to work and don’t really worry about it. How many drivers can actually explain a combustion engine?
There is a lot going on in the background to make the web work. This new (new to me at least) area of development is leveraging the tech the way it was supposed to be used (if I am to believe the pioneers in this arena). A lot of this is a change of perspective. And with any change of perspective it can take awhile to make the transition.
After that side trip down my ramblings, we come back to me having a handler with a Get method. Now I have graduated to a 406 error (as expected by the tutorial).
I then created my view as the tutorial suggested. Now upon trying to fluently configure.. I ran into a snag. Again the tutorial is out dated (which is fine for an open source and still growing framework).
I had to add the “OpenRasta.Codecs.WebForms.dll” to the solution.
Also the fluent configuration suggested is…
1 2 3 4 |
|
But since the AndRendededByAspx is obselete, the code should now be:
1 2 3 4 |
|
I then continued the tutorial until I had my Home View that displayed my lovely welcome message.
Yay! I got my first Open Rasta page to work. :)
Feel free to investigate my project at my Git Hub repository:
http://github.com/RookieOne/OpenRastaExperiment/tree/TutorialCompletion
I’m going to be continuing to change the master branch but the TutorialCompletion branch should remain unchanged.
SO check out OpenRasta and their (and my) tutorial. Its short and is a great window into viewing the web in a slightly different manner.
Thanks for your time!