S#arp Architecture - Taking the hassle out of starting new projects

In March 2006 Billy McCafferty wrote an article on CodeProject about NHibernate best practices using ASP.NET. He took the time to discuss the advantages of using an O/RM with ASP.NET as well as information on Dependency Injection / Inversion of Control with Windsor. After a period of time, Billy created a new project on Codeplex (later moved to Google Code) that expanded upon those ideas and principals. This new project is named S#arp Architecture. From the S#arp Architecture home page:

"Pronounced "Sharp Architecture," this is a solid architectural foundation for rapidly building maintainable web applications leveraging the ASP.NET MVC framework with NHibernate. The primary advantage to be sought in using any architectural framework is to decrease the code one has to write while increasing the quality of the end product. A framework should enable developers to spend little time on infrastructure details while allowing them to focus their attentions on the domain and user experience. Accordingly, S#arp Architecture adheres to the following key principles:
  • Focused on Domain Driven Design
  • Loosely Coupled
  • Preconfigured Infrastructure
  • Open Ended Presentation
The overall goal of this is to allow developers to worry less about application "plumbing" and to spend most of their time on adding value for the client by focusing on the business logic and developing a rich user experience".

 To help accomplish this S#arp Architecture has introduced a project template for Visual Studio 2008. This project template creates the solution, all of the projects, and just recently added a CRUD Scaffold generator. In addition the project template, S#arp Architecture uses ASP.NET MVCCastle Windsor for Dependency Injection / Inversion of Control, NHibernate and Fluent NHibernate.

One of the things I appreciate the most is the time it saves when I am setting up a new project. I also like the flexibility it has. While the default presentation layer is ASP.NET MVC, this could easily be switched out to the presentation medium of your choice. If you choose to leave ASP.NET MVC, then you can use any of the View Engines available (Spark and nHaml are my choice). By default S#arp Architecture uses its own custom view engine so that you can use areas (see the documentation for the project). Thats right, I said AREAS!! The significance of this is the fact the Scott Guthrie recently announced that the RTM version of ASP.NET MVC will NOT ship with this built in.

If you currently use NHibernate and are sick of the XML mapping files, then you will love Fluent NHibernate. It makes mapping your domain objects so much easier. In case you have some tough mappings (in my case a composite key), you still have the option to use the XML mapping files. One of features there has been a lot of buzz about is the auto mapping. This little gem allows you to map your whole application in very few lines of code.

I would highly recommend S#arp Architecture to anyone that wants to make their life a little bit easier, while encouraging you to use best practices.

No Comments