Jul 16 2008

Hammett goes to Microsoft

Tag: Castle,Open SourceSymon Rottem @ 10:59 pm

For those didn’t know already there’s some interesting news floating around out on the grapevine…apparently Hamilton Verissimo (aka Hammett) has joined the Microsoft team – congratulations Hammett!

Hammett has been the founder and guiding light behind the Castle stack which includes the popular MVC container MonoRail, the Windsor IoC Container and Dynamic Proxy (which is used extensively in the NHibernate project as well).

While this most likely bodes well for Microsoft MVC and Unity IoC I do have to wonder what impact this will have on the the future direction of the Castle stack. My assumption was that Hammett would be stepping back from the project due to a conflict of interest, although according to his blog this isn’t going to be a problem so he’ll stay involved.

As there are many committers on the Castle development team I certainly don’t imagine that it’s going to go away event if he has to step back, but having a someone who is passionate, actively involved and provides a leadership for a project goes a long way to keeping it healthy; look at NHibernate as a good example – when Sergey stepped down as the lead things got a little muddy for a while.

I do believe that it’s important that open source alternatives remain active and viable alternatives for the health of the software development community, so I hope that, if required, someone else can take up the reins with the same level of passion and commitment shown by Hammett in his long history with the project.

Does anyone have an inkling of what’s going to happen next?

Jul 13 2008

NHibernate 2.0 Beta 2 Released

Tag: NHibernate,Open SourceSymon Rottem @ 5:57 pm

For those not watching the mailing list a new beta release of NHibernate 2.0 was released today and word is that if no major issues show up the first release candidate will be made available in another two weeks.

This is a fantastic announcement and although the alphas and betas have been pretty damned good it’s nice to see that things are underway for a production release in the not too distant future – a nice thing to see in any open source project.

Exellent work and kudos to Fabio Maulo and the rest of the team working on the project!

Apr 22 2008

NServiceBus Tutorial

Tag: Open Source,SOASymon Rottem @ 10:28 pm

Staying on the SOA theme, there was a post today on the NServiceBus mailing list from Mohamed Ahmed Meligy about the NServiceBus Tutorial he’s put together.

Mohammed is working for a company that’s been evaluating NServiceBus for an internal project and they’ve been kind enough to share the document with the rest of the community using a Creative Commons license.

The document will probably be evolving rapidly, but right now it’s an excellent starting point for anyone who’s trying to get their head around using NServiceBus as their messaging middleware, so go and take a look to get you off and running.

Mar 22 2008

NHibernate Proxy Generator

Tag: NHibernate,Open SourceSymon Rottem @ 4:11 pm

I just stumbled over an interesting post on William C. Pierce‘s blog explaining how to set up NHibernate to run in a a medium trust environment and still get the benefits of lazy loading.

I’ve seen a few queries about how to do use lazy loading under medium trust in the past but have never really investigated it myself having assumed it was just one of those things you couldn’t do since proxies are generated through reflection and reflection permissions are not granted in medium trust environments.

Well it turns out that isn’t the case if you get a little creative.

What William has done is to create his own proxy factory that NHibernate can be configured to use so it will provide proxies that were generated at compile time where you have full trust rather than generating proxies at runtime where the reflection permissions are restricted.
He’s also provided a tool to generate those compile time proxies and released his hours of hard work as the NHibernate Proxy Generator (or NPG) so you don’t have to invest time of your own.  The project is still in it’s infancy but it’s released under the Apache License 2.0 so you can download the source and contribute should you so desire.

William has provided more information on how NHibernate can be configured to run in medium trust and use NPG generated proxies in his blog post so head on over there if you’re stuck with medium trust and still need lazy loading.

Mar 19 2008

DocBook MonoRail Docs in Contrib

Tag: Castle,Open SourceSymon Rottem @ 12:19 am

For those who don’t lurk on the Castle Development mailing list, the new DocBook version of the MonoRail documentation I’ve been working on has now been submitted to the Castle Contrib repository. If you want to download a copy of the source to build and play with you can find it here:


This initial checkin contains only the MonoRail DocBook source files in their initial, unedited state, NAnt build scripts to generate the output and the toolchain required to do the build.

At this stage output generated includes single page HTML, multi-page HTML (one page per chapter) and a CHM file. I anticipate the addition of PDF and VS 2005 add in documentation formats in the near future. The following links provide a sample of the current generated output:

To build the documentation you will need to have a Java runtime installed, however you can easily use IKVM.NET as an alternative as long as you don’t mind making some minor changes in the build files. Each book can be built by executing NAnt against its build file (monorail.build for MonoRail, for example) or the whole tree can be built by using the default.build file. Keep in mind that right now there are only MonoRail docs, so either way it’s essentially the same thing.

Right now the content is only basically styled and only some code blocks have been set up for syntax highlighting. There are also likely to have been a couple of errors in transferring the data and several internal and external links are still broken. Since I have now got an initial buildable version in place I should be able to return my focus to fixing these and other content issues as well as continue work on migrating other frameworks in the Castle stack to the DocBook format.

Any feedback is welcome.

Mar 07 2008

Documenting Castle – Proposed Structure

Tag: Open SourceSymon Rottem @ 2:17 pm

This documenting thing is something of a challenge. I’ve been working industriously away on groking the DocBook schema a little better, figuring out the transformation tools and how to automate them while also trying to come up with a structure that makes sense for presenting the data that already exists.

To get myself off the ground I’ve elected to restructure the existing MonoRail 1.0 RC2 documentation first since there are so many people out there currently using it and it makes sense for my team. Certainly it makes sense to get the trunk code documented quickly too, but I know the RC2 stuff better at the moment, so that’s my starting point, like it or not.

Below is the chapter/section layout I’m proposing for MonoRail. This layout covers pretty much everything that’s in the existing user guide documentation and getting started guide. I think it exposes most of the concepts and addresses the concerns of those who are getting to know MonoRail in a top down fashion so the simple stuff is presented first and the concepts follow each other in a relatively intuitive fashion and it can be expanded on fairly easily. Of course, that’s just my take and you may not agree – feel free to provide constructive feedback and I’ll take it into consideration.

I’ll be posting more on the the process I’m going to use for generating the documentation shortly and should have a draft HTML version of the content based on the layout below using the existing content from the website in the next few days, so stay tuned!

1. Introduction
 1.1. Overview
 1.2. Background
  1.2.1. What is MVC
  1.2.2. Convention Over Configuration
 1.3. Why Use MonoRail
 1.4. How It Works
 1.5. Licence Information
 1.6. Support
2. Getting Started
 2.1. Requirements
 2.2. Creating the Project Skeleton
  2.2.1. Using the MonoRail Project Wizard
  2.2.2. Creating the Project Manually
 2.3. Controllers and Views
  2.3.1. Your First Controller and View
  2.3.2. Setting the Layout and Resuce
  2.3.3. Creating the Index View and Action
  2.3.4. Creating the Layout
  2.3.5. Seeing the Results
  2.3.6. Passing Values to the View
  2.3.7. Creating a Rescue
 2.4. Data Binding
  2.4.1. Simple Parameters
  2.4.2. Complex Objects
 2.5. Integrating with ActiveRecord
  2.5.1. Adding Assemblies
  2.5.2. Configuration
  2.5.3. Building the Model
  2.5.4. Initializing the Handler
  2.5.5. ActiveRecord Sacffolding
  2.5.6. Creating a CRUD Page Using DataBind
 2.6. Final Comments
3. Installation
 3.1. Running Under IIS
 3.2. Using Casini
 3.3. Mono with XSP
 3.4. Mono with Apache
  3.4.1. Configuration
  3.4.2. Apache Httpd2
  3.4.3. Application Deployment
 3.5. Deploying to a Shared Host
4. Configuration
 4.1. Formal Definition
5. Controllers
 5.1. Naming Convention
 5.2. Areas
 5.3. Actions
  5.3.1. Default Action
 5.4. Redirecting
 5.5. Data Binding
  5.5.1. The SmartDispatchController
  5.5.2. Other Useful Properties
  5.5.3. Simple Parameter Binding
  5.5.4. Custom Binding
 5.6. Wizards
  5.6.1. Wizard Controllers
  5.6.2. Wizard Action Provider
  5.6.3. Steps
  5.6.4. Nested Actions
  5.6.5. DoNavigate
  5.6.6. Conditional Steps
  5.6.7. The WizardHelper
  5.6.8. Windsor Integration
 6.1. Folder Structure Convention
 6.2. Selecting a View to Render
 6.3. Passing Values to a View
  6.3.1. The PropertyBag
  6.3.2. Flash
 6.4. Shared Views
 6.5. Cancelling a View
 6.6. Accessing Values Passed by the Controller
 6.7. View Engines
 6.8. Javascript and Ajax
7. View Components
 7.1. Creating a View Component
 7.2. Using View Components
 7.3. Passing Parameters
 7.4. Block and Nested Sections
 7.5. Built In View Components
  7.5.1. CaptureFor
  7.5.2. SecurityComponent
8. Filters
 8.1. Creating a Filter
 8.2. Ordering
 8.3. Skipping Filters
 8.4. Passing Parameters
 8.5. Block and Nested Sections
9. Layouts
10. Rescues
11. Authentication and Authorization
 11.1. Forms Authentication
 11.2. Filters
 11.3. Using PrincipalPermission
 11.4. The SecurityView Component
12. Helpers
 12.1. Built In Helpers
  12.1.1. AjaxHelper
  12.1.2. DateFormatHelper
  12.1.3. Effects2Helper
  12.1.4. FormHelper
  12.1.5. HtmlHelper
  12.1.6. PaginationHelper
  12.1.7. ValidationHelper
  12.1.8. WizardHelper
13. Resources and Localization
 13.1. Using Resources
 13.2. Setting Up the Current Culure
 13.3. Localization
14. Sending Email
15. Unit Testing
 15.1. The TestSupport Assembly
 15.2. Exposing the Website Application Directory
  15.2.1. Overriding GetPhysicalDir
  15.2.2. External Configuration
16. Integrations
 16.1. ActiveRecord
  16.1.1. Scaffolding
 16.2. Windsor Container
17. Advanced Topics
 17.1. Routing
  17.1.1. Routing
  17.1.2. Root Directory Mapping Workaround
 17.2. Dynamic Actions
  17.2.1. Dynamic Action Providers
 17.3. Scaffolding
 17.4. Extensions
  17.4.1. Custom Session Extension
  17.4.2. Exception Chaining Extension
  17.4.3. Creating Your Own Extensions
 17.5. Service Architecture
 17.6. Custom Bindable Parameters
 17.7. Using Resources to Store Views

Edit: After a comment on the mailing list from Erik Dahlstrand I noticed that somehow I’d forgotten to include the entire section on Helpers in the above structure so I’ve updated the list to include it.

Feb 28 2008

Zenoss System Monitoring

Tag: Open SourceSymon Rottem @ 2:10 pm

At the moment I’m working on a system that consists of about 45 machines working together, providing a range of services, all of which need to be monitored for availability and that everything is running within measured thresholds. It’s important that if any of these machines or services fail that someone is notified and that if the issue isn’t resolved in a reasonable time frame that some kind of escalation process will ensure others are notified until something is done.

Having no available budget when I began investigating options I started looking at FR/OSS solutions to solve the problem. After a couple of false starts with Nagios and Hyperic HQ (which only missed the cut because it’s free version was missing one particular feature I needed; the ability to schedule repetitive maintenance periods – a pity that because otherwise it looks like an excellent FR/OSS product) I took a look at Zenoss Core and had a nice surprise.

Zenoss does a spectacular job of simplifying the process of adding new machines to be monitored – once the hosts have been SNMP enabled (and WMI enabled, for Windows boxes) you can set up a network in Zenoss and tell it to scan the network for new devices after which it will dutifully add all detected hosts with SNMP.

What’s really nice is that you can simply switch devices from a basic detected profile type to a more specific type (ie, Windows host, Linux host, router, switch, etc.) and Zenoss will do further investigation on the device based on its type. For example, if you designate the device as a Windows host it will query for other Windows related information including the software and services installed on the box. Similarly if you select Linux or Solaris it will perform other OS specific checks, etc.

Also interesting is that it establishes an inventory of the software installed on all the devices so you can determine which machines are running which software. By default each host is re-profiled every 6 hours and if any changes are detected the database is updated and you can be notified of the changes.

Once the hosts have been added Zenoss dutifully harvests issues from system logs, checks for availability of designated processes or services, and tracks values like available memory and processor usage (and yes, even custom data can be collected) over time. Hell, there are event pretty graphs for you to look at. Once the data is coming in notifications can be configured which can be triggered by outages or data exceeding thresholds and they can be sent by a variety of methods (email is one and is certainly the easiest to get running, but there are SMS/paging options amongst others).

Zenoss isn’t perfect, however. It can perform very slowly sometimes due to the way it manages caching data – it looks like it uses all available system memory to the point where it actually uses up the swap space as well. And navigation can sometimes be a pain as you have to move through multiple menus to get to sub groupings of machines unless you’re prepared to type the url to the group by hand.

Regardless, overall I’ve been pretty impressed with what Zenoss can do. There are some features missing from Zenoss Core, but their enterprise version seems to address most of these, and since it’s OSS there’s nothing you can’t choose to do yourself…if you can find the time.

Feb 23 2008

NServiceBus is Growing Up!

Tag: Open Source,SOASymon Rottem @ 4:52 am

NServiceBus is an Open Source Enterprise Service Bus framework released not so long ago by Udi Dahan and this week it got to it’s feet and wandered over to it’s new home at http://www.nservicebus.com. The site is still under construction, but it’s great to see a .NET OSS solution so recently released moving ahead so rapidly.

Over the last few months I’ve been evaluating it for use in an application and it’s certainly got a lot going for it. Configuration is not difficult and is planned to become even easier and using it is child’s play. There’s support for long running multi-message sagas, publish-subscribe semantics, pluggable transport layers, a vastly simplified and transport agnostic programming model and more – it’s definitely worth a look if you’re planning on building a scalable solution.

The only thing it’s been lacking so far has been documentation – a few months ago I submitted a patch with some code docs that might be used for generating API docs, but they’re a drop in the ocean and I really did them because I needed to read the code to really understand what was going on under the hood and marking up the methods with some code docs just seemed like a good idea to help me grok the whole thing.

What’s really needed is some guidance and tutorial style documentation and it looks like that’s beginning to get underway with the new site. Regardless, the source package comes with some great sample applications that demonstrate solutions to various common problems and since reading well written code is about the most basic method of revealing intentions the samples can work well to get you off the ground pending those additional docs.

I recently wrote a post called Do I Need Message Prioritisation? in which I discussed NServiceBus and some of the difficulties I was experiencing – I don’t think I gave it enough credit since it may not be the perfect fit for my specific problem, but I can certainly see it’s value and have plans to make heavy use of it in the future.

It’s really nice to have OSS alternatives available that don’t tie you to one specific vendor and I highly recommend NServiceBus as a software project to make friends with if you’re looking at writing scalable applications in an SOA context.