CodeBetter.Com
CodeBetter.Com
RSS 2.0 via Feedburner
           Do you Twitter? Follow us @CodeBetter

David Hayden [MVP C#]

         .NET Tutorials, Patterns, and Practices

Castle ActiveRecord and Web Client Software Factory

A question showed up in the Web Client Software Factory Forums about using WCSF with Castle Project's ActiveRecord and I couldn't resist the opportunity to show that indeed these solutions work well together. However, the Getting Started Guide to ActiveRecord is a bit out-of-date, but more importantly, doesn't take into consideration that the Web Client Software Factory focuses on Composite Web Client Line-of-Business Applications. Therefore, you will want to deviate from the getting started guidance mentioned on the Castle Project Website.

Rather than initializing the ActiveRecord Types in the Application_Start Method, you will register the ActiveRecord Types in each of the business modules or foundation modules that make up your composite web client application. Each business module and foundation module has a ModuleInitializer Class that is run only once on application startup and is a perfect place to register the ActiveRecord Types that make up the domain model for each of your business modules.

I am trying to keep all my Patterns & Practices Posts on PnPGuidance so it is easier to find the guidance. You can view code samples of how to initialize Castle ActiveRecord Types with the Web Client Software Factory at the following post:

I find the guidance coming out of the Castle Project so valuable, that I have started a Castle ActiveRecord Category on PnPGuidance and plan to create some screencasts and tutorials to show how solutions from both Castle and Microsoft Patterns & Practices can work really well together. Since I use almost all of the tools from the Castle Project, expect to see other categories in the future.

I hope this helps. Enjoy the diversity!


Published Nov 06 2007, 04:29 PM by David Hayden
Filed under:

Comments

Ayende Rahien said:

David,

Take into account that you can only call ARStarter.Initialize _once_.

If you'll call it twice, it will throw.

I am going to guess that if you have multiply modules in the same app, it will be called twice

# November 6, 2007 6:48 PM
Check out Devlicio.us!

This Blog

Syndication

News

CodeBetter.Com Home