The Forum Sample Application

time to read 9 min | 1739 words

So, it looks like the vote goes decidefully for MonoRail, so that is what I am going to build it with. I have setup a project here:
https://rhino-tools.svn.sourceforge.net/svnroot/rhino-tools/trunk/SampleApplications/Hibernating.Forums

I have decided to take advantage of this series and show some other cool stuff that I have used, from the Repository<T> & NHQG to Binsor and MonoRail Windsor Integration.

The application is basically just UI and configuration right now. I did some very rough strcuturing of the UI in a way that should help me work on it.

The most interesting part is probably the windsor configuration:

import System.Reflection

import Castle.MonoRail.Framework

import Castle.MonoRail.WindsorExtension

 

Facility( "rails", RailsFacility )

 

webAsm = Assembly.Load("HibernatingForums.Web")

activeRecordAssemblies = ( Assembly.Load("HibernatingForums.Model"), )

 

for type in webAsm.GetTypes():

      if typeof(Controller).IsAssignableFrom(type):

            Component(type.Name, type)

      elif typeof(ViewComponent).IsAssignableFrom(type):

            Component(type.Name, type)

 

 

Component("active_record_repository", IRepository, ARRepository)

Component("active_record_unit_of_work",

      IUnitOfWorkFactory,

      ActiveRecordUnitOfWorkFactory,

      assemblies: activeRecordAssemblies )

I will probably start recording tomorrow (unlikely) or on Friday.