Project Status

by alec.whittington 4. September 2011 02:54

It's been a while since I have blogged on anything S#arp Architecture (S#) related. I've been quite busy as of late, but still work with S# everyday and am very much commited to this project. 

Leadership Change

Geoffrey Smith has done a great job to date and is a valuable member of the S# team. He has recently changed jobs and no longer has the he would like to the project. So who will be taking the reins now, me. This project is very dear to my heart and something I would like to see continue on for as long as it is relevant. 

Project Status

This project is very much still alive and kicking. There are a lot of new things going on not only in the .NET world, but outside of it as well. MVC 4, HTML5, CSS3, NodeJS, Javascript Web Applications (think GMail) just to name a few. There has also been some updates to some of the 3rd party dependencies; NHibernate, Castle, MvcContrib, and others.

We are taking the next few weeks to internally discuss what we would like to propose as a road map to the our community. This planning will include information on when 2.0 will be a full release in addition to new features, changes to existing features, and new samples.

Tags: , , ,

Road Map | S#arp Architecture

Making SharpArch 2.0: Who Can Help Me? Part 1

by Jonathan George 18. May 2011 04:37

Who Can Help Me? started life towards the end of 2009, after myself, Howard, James, and a host of other amazing ex-colleagues worked together on www.fancydressoutfitters.co.uk. We’d built the client-facing site using S#arp Arch and a bunch of other open source tools, and wanted to put together a vastly simplified sample app demonstrating how we did it. And so, we build Who Can Help Me? and put it out there for the community to play with.

Despite not originally being intended as a S#arp Arch demo, it was adopted as one. Which gave rise to the question: what do we do with it for S#arp Arch 2.0? When we built it, we wanted to demonstrate the architecture and toolset we used for an enterprise-level e-commerce site. We didn’t go out of our way to demonstrate any specific patterns, and we made no effort to demonstrate many of the nice features offered by the different tools we used. After some back and forth between the team we decided that things have moved on in the last 2 years, and whilst we are all still proud of the e-commerce site it was based on, WCHM is not representative of the way we choose to build websites today.

In addition, those who follow Ayende’s blog may have noticed his recent code review on WCHM. He raised some valid issues with the code, and fortunately there are several upcoming SA 2.0 features that will help me address them. So here’s the hit list for how WCHM 1.9.6 will go not only to 2.0, but also to being a true Sharp Architecture sample app.

Firstly, relevant points from Ayende’s review:

The mapping sucks

The pattern we adopted when writing our controllers is as follows:

  • Receive request.
  • Make request to tasks layer (aka application services); get domain entities returned.
  • Use mapper to map entities to view models.
  • Return view result, passing view model.

This looks extremely simple on paper, and for the most part it is. However it has a few issues:

  • It can get messy quickly, especially if your view requires several disparate pieces of data – in this case, the controller makes multiple calls to the tasks layer to retrieve the required data, which is then passed into a mapper. Often this mapper will use other mappers to map collections or child view models.
  • It is, as Ayende pointed out, a breeding ground for SELECT N+1 issues.

S#arp Arch 2.0 has a solution to this problem in the form of the Enhanced Query Object approach. So, to populate a view model we no longer make calls into the tasks layer. Instead we use a query object which retrieves all necessary data. Because the EQO talks directly to the NHibernate session we can bypass the layers of abstraction that Ayende derides in his posts, replacing it with LINQ/Criteria/HQL/named queries/whatever else we think is the right fit for the problem.

Too many specifications

There are quite a few specifications in the domain layer. They fit nicely into two categories:

  1. Specifications that just shouldn’t be there at all. This covers ProfileByIdSpecification and CategoryByIdSpecification. Simply put, these shouldn’t exist. Instead, the FindOne method on the relevent repository should be used, which simply passes through to the Session.Get<T> method.
  2. Specifications that aren’t really specifications. Unfortunately, this covers the remainder of the specifications. The problem is, a specification is really intended for codifying a business rule – so an OverdueInvoiceSpecification would capture what it means for an invoice to be overdue. When you look at it in that way, it’s pretty obvious that TagByNameSpecification (for example) is not codifying any business rule and as such has no place in the domain layer.

Unfortunately this means I’ll be deleting all the existing specifications. Hopefully I’ll be able to come up with a good example or two to replace them with.

Now, onto a few of my own points:

Anaemic Domain Model

Anaemic Domain Model (Wikipedia, Fowler) normally – and in my opinion, somewhat unfairly – gets labelled as an anti-pattern. It actually made a lot of sense in the original application, because in fact there was no domain logic to speak of. However, since Sharp Arch has all the DDD terms baked in, WCHM needs to do more than pay lip service to these, so I’ll be doing my best to improve this.

No obviously identified aggregate roots

Following on from the previous point – the code in WCHM doesn’t follow the DDD practice of accessing entities via aggregate roots only, so this will be another thing to improve.

Replace existing Tasks with Commands

WCHM currently uses a traditional tasks layer, with the different methods grouped up into a few different application services – CategoryTasks, ProfileTasks, etc. As described above, the query methods will be pulled out of these tasks and moved into queries that will be homed alongside the controllers. The remaining methods will be separated into commands, which will remain in the Tasks layer.

Merge Web.Controllers and Web

As detailed in Geoff’s Introductory post in this series, we’re merging controllers back into the main web project, and renaming to Presentation.

Summary

In reading this, you might think that I’m saying WCHM is a steaming pile of something unpleasant. Nothing could be further from the truth – www.fancydressoutfitters.co.uk is a project that I’m proud to have been part of, and WCHM is an extension of that. The site has been running with no significant unplanned downtime for nearly 2 years now, from a project that went from nothing to live in just ten 2 week sprints.

However, I hate it when code I’ve written is allowed to stagnate – like most of us, I look back on code I’ve written and think about all the ways it could be better. I hope that there will never be a day when I look back on one- or two-year old code and realise I’ve learned nothing since it was written. In the meantime, I’d appreciate any feedback people have on WCHM and this post.

@jon_george1

This is cross-posted from my main blog.

Tags:

S#arp Architecture

Making SharpArch 2.0: Repositories, Build and Packaging

by Jonathan George 15. April 2011 08:10

Following on from Geoff’s first post in this series, this post details the move from two repositories (Sharp-Architecture and Sharp-Architecture-Contrib) to the current set up, including how we’ve restructured the repositories themselves and included a common build system across everything.

TL;DR

We’ve moved all the SA repositories into a single GitHub organisation, separated samples into their own repositories, brought the repository structures in line with one another, and implemented a common build system shared by the solution in each repository.

Some Background

Until the end of last year, Sharp Arch consisted of two repositories. We had Sharp-Architecture, which contained SA itself and the Northwind sample app, and Sharp-Architecture-Contrib, which was pretty much what it said on the tin. The master versions of these repositories lived in Billy’s GitHub account.

When we started talking about Sharp Arch 2.0, Billy had already taken a step back from the project. Who Can Help Me? had been adopted as a second sample application (with the master version living in my GitHub account), and we had big plans for both Sharp Arch itself and the sample apps we provide for it. As a result, we made a few decisions:

  • We’d bring all of the Sharp Architecture repositories under one roof so that it was obvious what was “official” Sharp Arch and what wasn’t
  • We’d provide each sample app – including Northwind – in it’s own repository, rather than having a single massive repository containing SA core and all of it’s samples.
  • We’d adopt a common structure for all our repositories, so that people know what to expect when getting into each one.
  • We’d provide a common way of building all of the projects, so that we didn’t need something specific in each repository.

Step 1. Sharp Architecture organisation on GitHub

This was the easy bit; as you probably already know if you’re a Sharp Arch user, we’ve created a new GitHub organisation that our repositories can call home. It’s at https://github.com/sharparchitecture/ and at time of writing, contains the following repositories:

  • Sharp-Architecture
    The core Sharp Arch projects. This currently has a master branch, which is the source of the current release (1.9.6), and a develop branch which contains the restructured work in progress version.
  • Sharp-Architecture-Features
    An all-new, 2.0 repository containing code for the different persistence options we’re providing for Sharp Arch 2.0. Because it’s new for 2.0, the master branch of this repository contains the code that’s aligned with the develop branch in the main Sharp-Architecture repo. Apologies if this is somewhat confusing.
  • Sharp-Architecture-Contrib
    As with the core repo, the master branch contains the source of the current release and the develop branch contains the Contrib project that will support SA 2.0.
  • Sharp-Architecture-Build
    Common build system for the Sharp Architecture solutions – see below for more information.
  • Northwind
    The original SA sample app. As before, master contains the code that goes along with the current SA release, and develop will be updated to use SA 2.0.
  • Who-Can-Help-Me
    Sharp Arch’s second sample app. As before, master contains the code that goes along with the current SA release, and develop will be updated to use SA 2.0.
  • Sharp-Architecture-Template
    A new kid on the block, this will eventually contain the reference project structure that is used to generate the Templify package for SA. At the moment, our Templify package is built from the Northwind sample, but we are intending to change this as part of the 2.0 release.
  • Sharp-Architecture-Cookbook
    Another newbie – this is a new sample application that differs from Northwind and Who Can Help Me? in that it doesn’t intend to be a real world example of how to use SA to build an app. Instead, it will contain a series of examples of different things that can be done with SA. “Recipies” that you might find in the cookbook could include the different ways of setting up NHibernate (Automapping, Fluent and traditional HBM mapping), using SA with WCF, usage scenarios for LinqRepository and the Specification pattern and so on. Our hope is that over time, this will become the main reference for “how do I…” questions.

Step 2. Repository structure

We decided to standardise on the repository structure used in WCHM. At the top level, it contains the following folders:

  • Build
    Build scripts for the project – see below for more details
  • BuildSystem
    Git submodule used to pull the common build bits and pieces from Sharp-Architecture-Build.
  • Common
    Contains any common files used across multiple projects. In practice, this is normally a CommonAssemblyInfo.cs file, which holds the assembly attributes shared across all projects in solution, and an AssemblyVersion.cs which is automatically updated by the build process to ensure that assemblies get a version number that matches the TeamCity build number.
  • ReferencedAssemblies
    Pretty much what it sounds like – external libraries that are used by the solution. These are normally organised into subfolders for each dependency, in order to make it crystal clear which assemblies are part of which dependency – for example, the NHibernate folder contains the core NHibernate.dll, Iesi.Collections and other supporting bits.
  • RequiredPackages
    Installers for anything you need to set up  locally in order to use some or all of the solution. For example, it helps to have the T4Toolbox installed to work with the T4 templates that are currently part of SA, so the installer for this is included in the RequiredPackages folder of the Sharp-Architecture repository.
  • Solutions
    Home for the projects that make up the solution. As you’d expect, each project is in it’s own subfolder, and the solution file sits here as well.

As mentioned above we felt that a common structure for the repositories is important. Not only does it mean that you know what to expect when getting into each repository, it also facilitates the next major step  - the creation of a common build system for all of the projects.

Step 3. Common Build System

Up until 2.0, Sharp Arch has relied on a Nant build script for build and packaging. This has served well so far, but with the changes we’ve made in the way our repositories are structured, the time was right for a change.

The build system we now have consists of two parts:

  1. A set of common MSBuild targets and tasks that encapsulate steps within the build process – for example, building a solution, running unit tests, or packaging source files. These files live in the Sharp-Architecture-Build repository, and each repository contains a submodule that pulls this into the BuildSystem folder.
  2. A script that is specific to each repository and invokes the correct tasks from the common build project, with the correct parameters for the project. This script, along with some batch files that can be used to run it, exists in the Build folder of each repository.

Using this set up, and with the knowledge that each repository is structured in the same way, it’s simple to assemble the correct tasks to build and package any of the solutions from the Sharp Architecture repositories. For example, the process to build the Sharp Architecture core solution consists of the following steps:

  • Clean (remove any files from the Drops folder that are about to be recreated by this build)
  • Update the common assembly version number file that’s shared by all projects.
  • Build the solution
  • Run the MSpec unit tests
  • Merge the assemblies together
  • Package the assembly and source files.

If you compare this with the build process for Northwind – which, given it’s a sample app rather than the framework itself, you might expect to be somewhat different – you’ll see the following steps:

  • Clean
  • Update the common assembly version number file that’s shared by all projects.
  • Build the solution
  • Run the NUnit unit tests
  • Package the assembly and source files.

Clearly the bulk of the steps are actually the same as those required by the core Sharp Arch solution, hence the reason for encapsulating each of these steps in it’s own target so that it can be easily consumed as needed.

This system does, unfortunately, add some complexity to the process of getting source from GitHub and building locally. Once you’ve done a git clone of any of the repositories, it’s then necessary to run two additional commands against your clone.

  • git submodule init initialises the submodule
  • git submodule update updates the submodule with the files from the correct commit of the Sharp-Architecture-Build repository.

Anything that raises the barrier to getting started with Sharp Architecture is clearly not a good thing, so we’re still looking at ways in which this process can be improved.

Once the submodule is up to date, the files in the Build subfolder can then be used to build and package the solution. These scripts are also used for our CI builds, and when used with TeamCity they ensure that the assemblies created and packaged by each build are correctly version stamped with the build number, and that the packages created by the build process are published as build artefacts.

Next steps

As we continue working towards 2.0, it’s likely that we’ll evolve what I’ve described here but it’s unlikely to change radically. We’ll probably move to using NuGet instead of the old fashioned way of pulling in external dependencies, which may affect how we use the ReferencedAssemblies folders in each repository. And we’re also not entirely happy with the additional complexity that using Git Submodules adds to the mix, so we’re still thinking of ways to improve this. In addition, we’ll be making some additions to automatically create and publish the Templify and NuGet packages for Sharp Architecture.

As always, we welcome all suggestions, feedback and pull requests so please get involved and help us make Sharp Architecture something you want to use in your projects.

@jon_george1

This is cross-posted from my main blog.

Tags: , ,

S#arp Architecture

Sharp Architecture 1.9.6 NuGet Package

by alec.whittington 11. April 2011 08:23

 One request we received when NuGet first came out (as NuPack) was for Sharp Architecture to release a package. We all agreed that this would be a good way to deliver updates in the future as it meant the end user did not have to download either the source or a template just to extract the assemblies.

Well the wait is over, today we released a NuGet package for Sharp Architecture 1.9.6. The package has the following dependencies:

 

Don't worry about all of those dependencies, when you install the package, you can choose to use the -IgnoreDependencies command-line argument to only reference SharpArchitecture. 

You can find the project by using the package manager console:

And install it using the following command:

Once everything is installed, you will notice that a new folder has been created at the solution root of your Sharp Architecture folder structure.

This folder will contain the following packages in it:

I do have a couple of other packages installed, MvcScaffolding for one, so you will see some packages that are not referenced by Sharp Architecture. Please let us know if you have any problems with the package. It is very much a work in progress.

 

This was cross posted from my main blog: http://weblogs.asp.net/alecwhittington/default.aspx

Tags:

Integrating MVCScaffolding and SharpArchitecture

by Geoffrey.Smith 11. April 2011 07:14

N.B. This article isn’t meant to get you up and running with MVCScaffolding and Sharp, but merely as an exploratory article on editing MvcScaffolding T4 templates.

Steven Anderson has a pretty interesting series on MVCScaffolding. It is not a novel idea, Rails does it, Django sort of does it, even JavaScriptMVC does it, so let’s do it, let’s fall in love, err, scaffold.

I went ahead and created a project based on 1.9.6, and in keeping with Steve Anderson’s example, I’m going to go ahead and call our project “Football.” First thing, I blew out the existing code generation and the controllers project, then added a controller folder to Football.Web.

As in the aforementioned example, let’s bring up the Package Manager Console, and set the default project to Football.Web (NB, MvcScaffolding requires a reference to MVC3 to work):

PM> Install-Package MvcScaffolding
'EntityFramework 4.1.10311.0' already installed
'T4Scaffolding 0.9.9' already installed
'MvcScaffolding 0.9.9' already installed
Successfully added 'EntityFramework 4.1.10311.0' to Football.Web
Successfully added 'T4Scaffolding 0.9.9' to Football.Web
Successfully added 'MvcScaffolding 0.9.9' to Football.Web

We won’t be needing EntityFramework and a lot of the automatic wiring is already done via the Templify package. That doesn’t really matter right now, let’s create a model and see if it can correctly find a model in another assembly and generate the scaffolding:

namespace Football.Core
{
   using System.ComponentModel.DataAnnotations;
   using SharpArch.Core.DomainModel;

   public class Team : Entity
   {
       [Required]
       public virtual string Name { get; set; }

       public virtual string City { get; set; }

 

 [Range(1898, 2100)]

       public virtual int YearFounded { get; set; }
   }
}

Hey, those don’t look like NHValidator properties! They aren’t, they’re DataAnnotations, which is an expected feature somewhere in the 2.x release cycle. For sake of simplicity I’m going to keep them.

Steven uses DateTime for the Founded property, but who cares the date and month? No one. The first team was founded in 1898 (Arizona née Chicago Cardinals) and let’s chose 2100 as a way of telling the future they need to probably spend some money on rewriting this.

Okay, cross your fingers, let’s see if it works:

PM> Scaffold Controller Team
Scaffolding TeamsController...
Added database context 'Models\FootballWebContext.cs'
Added 'Teams' to database context 'Football.Web.Models.FootballWebContext'
Added controller Controllers\TeamsController.cs
Added Create view at 'Views\Teams\Create.cshtml'
Added Edit view at 'Views\Teams\Edit.cshtml'
Added Delete view at 'Views\Teams\Delete.cshtml'
Added Details view at 'Views\Teams\Details.cshtml'
Added Index view at 'Views\Teams\Index.cshtml'
Added _CreateOrEdit view at 'Views\Teams\_CreateOrEdit.cshtml'

No errors, and it correctly found the Id property on the inherited Entity class! I’m saying we’re about 90% of the way there. It looks like all we’ll need to do is edit the template files to get rid of those EntityFramework references and change everything to feel more like a Sharp project.

This would be part 5 of Steven’s series, “Overriding the T4 Templates,” “<yourSolutionDir>\packages\<scaffolderPackage>\tools to see the structure of scaffolders and templates.” Since Sharp gives you the Dbcontext stuff for free with IRepository<Team>, let’s focus on the controller in \MvcScaffolding.0.9.9\tools\Controller\ControllerWithContext.cs.t4. I’ve put my changes up on Gist and the resulting template looks a lot more like Sharp, doesn’t it?

namespace Football.Web.Controllers
{
   using System.Linq;
   using System.Web.Mvc;
   using Football.Core;
   using MvcContrib;
   using SharpArch.Core.PersistenceSupport;
   using SharpArch.Web.NHibernate;

   [HandleError]
   public class TeamController : Controller
   {
       private readonly IRepository<Team> teamRepository;

       public TeamController(IRepository<Team> teamRepository)
{
           this.teamRepository = teamRepository;
}

       public ViewResult Index()
       {
           return View(this.teamRepository.GetAll().ToList());
       }

       public ViewResult Details(int id)
       {
           var team = this.teamRepository.Get(id);
           return View(team);
       }

       public ActionResult Create()
       {
           return View();
       }

       [HttpPost]
[Transaction]
       public ActionResult Create(Team team)
       {
           if (ModelState.IsValid)
           {
               this.teamRepository.SaveOrUpdate(team);
               return this.RedirectToAction(c => c.Index());  
           }

           return View(team);
       }

       public ActionResult Edit(int id)
       {
           var team = teamRepository.Get(id);
           return View(team);
       }

       [HttpPost]
       public ActionResult Edit(Team team)
       {
           if (ModelState.IsValid)
           {
               this.teamRepository.SaveOrUpdate(team);
               return this.RedirectToAction(c => c.Index());
           }

           return View(team);
       }

       public ActionResult Delete(int id)
       {
           var team = this.teamRepository.Get(id);
           return View(team);
       }

       [HttpPost, ActionName("Delete")]
       [Transaction]
       public ActionResult DeleteConfirmed(int id)
       {
           var team = this.teamRepository.Get(id);
           this.teamRepository.Delete(team);
           return this.RedirectToAction(c => c.Index());  
       }
   }
}

With a bit of hacking, I’ve managed to get rid of the plural controller/view names, along with commenting out the creation of dbcontext, view it here.

If you just want to play around with the scaffolding, I also put up the entire project
here.

This just generates a controller and associated views based on a model. What abouts schema generation? I don’t like how EntityFramework acts a blackbox in this regard. I’d much rather have a method in the infrastructure layer that outputs a *.sql file:

var session = NHibernateSession.GetDefaultSessionFactory().OpenSession();

using (TextWriter stringWriter = new StreamWriter("GenerateSchema.sql")) {
           new SchemaExport(configuration).Execute(true, false, false, session.Connection, stringWriter);
           }

According to Seif it may actually be simpler than this, with just a change in the config file.

Thoughts on where this should go?

Tags:

S#arp Architecture

Making SharpArch 2.0: Introduction

by Geoffrey.Smith 9. April 2011 03:15

 

Welcome to the first part of an ongoing series, Making Sharp Architecture 2.0. The goal of this series is to walk through the development of the next iteration of Sharp Architecture as it happens. We hope that increased transparency will give insight to design decisions and, more importantly, foster discussion on how to improve a great framework.

The series begins in medias res, as much work has already gone into the 2.0. To recap the current status of 2.0.

Project Structure Renaming

The current project structure follows the tenants of a properly layered design, but through accidents of history, does call itself by any standard naming scheme. This a quick one to knock out:

1.0 2.0
Application Services Tasks
Core Domain
Data Infrastructure
Web Presentation
Web.Controllers Merged with Presentation

Why tasks and not application services? Services is, unfortunately, a loaded term. There’s Windows' Domain Services, Service Oriented Architecture, web services, and menagerie of other jargon that pulls and tugs at the meaning of service. Let’s go back to Eric Evans' definition:

“[The Application layer] Defines the jobs the software is supposed to do and directs the expressive domain objects to work out problems. The tasks (emphasis mine) this layer is responsible for are meaningful to the business or necessary for interaction with the application layers of other systems.

"This layer is kept thin. It does not contain business rules or knowledge, but only coordinates tasks and delegates work to collaborations of domain objects in the next layer down. It does not have state reflecting the business situation, but it can have state that reflects the progress of a task for the user or the program.“ (Evans 70)

The idea that the presentation layer calls tasks to be performed seems a much more natural fit for this.

The reasoning behind moving controllers from a separate assembly are two-fold. First, given that controllers are tightly integrated to the views they show, the separation seemed like a bit of needless abstraction. Second, rather pragmatically, moving controllers to co-habitate with views allows the built-in Visual Studio tools to function correctly. Moving controllers to a separate assembly, if you so desire, is a trivial task nonetheless.

Introduction of SharpArch.Features

One of the ideas presented by Sharp is that the persistence technologies themselves are fungible. There’s quite a bit of debate as to whether or not this is actually necessary. I will concede that most projects do not move from a traditional RDBMS to a document store without a major refactoring. If a project were to use a lot of different database technologies, due to its size or complexity, it would probably benefit from a more robust service bus and a move away from the repository pattern.

What would be beneficial, would be to start a new Sharp project with whichever database technology you want to use in easiest manner possible. This is the idea behind moving NHibernate and persistence frameworks to their own assembly with SharpArch itself being persistence ignorant.

Stepping back a minute, does pulling the persistence framework out of the core project violate good design principles? After much research, I don’t think so. In fact, it allows the other layers in Sharp Architecture to be even more loosely coupled. Larman prefers to put frameworks entirely as a “subsystem within the technical services layer,” (Larman 623) not tightly coupled with the rest of the project.

How tightly coupled is SharpArchitecture to NHibernate? As tight as one could be, even where it logically shouldn’t be. For example, since there is an NHibernateRepository and a Repository, you might conclude that the latter is a generic version of the former. That would be wrong, there’s plenty of pernicious little references to NHibernate everywhere. Take SharpArch / SharpArch.Data / NHibernate / Repository.cs:

public virtual IList<t> GetAll() {

            ICriteria criteria = Session.CreateCriteria(typeof(T));

            return criteria.List<t>();

        }

Session is not a generic session manager, but instead belongs to NHibernate.Session, and obviously CreateCriteria exists only in the context of NHibernate. This would make more sense if NHibernateRepository.cs didn’t also exist, which it does. Cleaning this up should go along way to creating a more persistence independent framework.

Conclusion

We moved to a better, more precisely named project structure. This has the advantage of allowing the built-in features of Visual Studio to work out of the box. We also looked at a major restructuring involving moving the persistence subsystem to its own assembly and keeping it from polluting the rest of the framework. Next time, we’ll look at implementing Udi Dahan’s Query<T> as a way of passing Linq fetch queries down to the persistence layer.

References

Craig Larman. 2001. Applying UML and Patterns: An Introduction to Object-Oriented Analysis and Design and the Unified Process (2nd ed.). Prentice Hall PTR, Upper Saddle River, NJ, USA.

Eric Evans. 2004. Domain-driven design: tackling complexity in the heart of software. Addison-Wesley

This is cross-posted from my blog

Tags:

Sharp Architecture 1.9 released

by alec.whittington 19. December 2010 07:37

It has been quite some time since our last release. This latest release brings upgrades in several dependencies as well as removing of others.

Upgraded

The following dependencies have been upgraded to their latest versions:

Removed

The following have been removed from the project:

  • MvcContrib.Castle -> There were only two classes from this assembly we were using: WindsorExtensions.cs and WindsorControllerFactory.cs. Since the release schedules of many OSS projects do not match up and the fact that the MvcContrib project had already updated their vNext (MVC 3) branch with the castle dependencies and not the MVC 2 branch, it was decided we should bring these two classes in and lose the dependency when it was not needed.
  • Castle.DynamicProxy2 and Castle.MicroKernal -> The assemblies were merged into other assemblies by the Castle project. They are no longer needed
  • NHibernate.Linq -> Since NHibernate 3.0 GA has a new Linq provider, it was no longer needed.

Download it now

We are offering this release in two formats, a Templify package and binaries only. Since the source is readily available, we no longer will be prodiving it in the downloads. If you do not know what Templify is, you can read about it here. If you are going to spin up a new solution, please follow the guide for using Templify below. It will show you how to get the package into your Templify repo. If you are wanting to upgrade a 1.5.x or higher solution, follow the guide to upgrading.

Starting a fresh solution with Templify

If you have not already downloaded and installed Templify, do so now. You can obtain the build from: http://opensource.endjin.com/templify/download.htm

  1. Download the Sharp Architecture 1.9.0.0 Templify package from: https://github.com/downloads/sharparchitecture/Sharp-Architecture/sharp-architecture-1.9.0.0-templify-package.zip
  2. Extract the contents into their own folder
  3. run the copy-package.cmd script
  4. Follow the instructions located here (http://weblogs.asp.net/alecwhittington/archive/2010/10/10/using-templify-to-create-a-new-s-arp-architecture-solution.aspx) to get up and going using Templify.

Upgrading your existing project

These instructions are only good for people using Sharp Architecture 1.5.x or higher.

  1. Download the Sharp Architecture 1.9.0.0 binaries only zip from: https://github.com/downloads/sharparchitecture/Sharp-Architecture/sharp-architecture-1.9.0.0-binaries-only.zip
  2. Extract the contents into their own folder
  3. copy the contents of the folder into your /lib folder
  4. Delete the following from the /lib folder
    • Castle.DynamicProxy2.dll and .xml
    • Castle.MicroKernel.dll and .xml
    • Castle.Services.Logging.Log4netIntegration.xml
    • MvcContrib.Castle.dll and .xml
    • NHibernate.Linq
  5. Open your solution in Visual Studio
  6. Go through each project and remove references to
    • Castle.DynamicProxy2
    • Castle.MicroKernel
    • MvcContrib.Castle
    • NHibernate.Linq
  7. Now you need to update your projects to use the proper version of the updated components. There are several ways to do this, from upgrading each .*proj file manually or by using Visual Studi. I've done it both ways, but prefer to use VS to help out.
    • Using Visual Studio - Open a project that references any of the following: Castle.*, NHibernate.*, MvcContrib.*, Fluent NHibernate, or SharpArch. Right click on the reference and click properties. Once there, set Specific Version = true. This will update the proj file to use the version that is in your /lib folder.
  8. Build the solution to see what errors are there
    • Remove reference to MvcContrib.Castle from your global.asax in the .Web project.
    • [OPTIONAL] Update your component registration to use the newer Castle.Windsor API

Your mileage will vary. If you find any issues with this, please report them on the google group, http://groups.google.com/group/sharp-architecture.

Notables

I would like to point out that we have removed the dependency on MvcContrib.Castle, if you are using anything more than the WindsorExtensions.cs and WindsorControllerFactory.cs, then you will need to implement that functionality yourself or upgrade MvcContrib to the latest dependencies. While we normally do not like to nick code from others, in this case we wanted to upgrade to the latest version of Castle (also required for NHibernate and Fluent Nhibernate) and would have had to make a custom build of MvcContrib to do so properly. The end result is that those two classes now reside within S# and we have one less dependency that has a dependency.

Tags: , , ,

S#arp Architecture | Templify

Sharp Architecture welcomes new team members

by alec.whittington 30. October 2010 01:54

As with most open source projects, S#arp Architecture relies on its user base to for support, ideas, bug fixes, etc. We've been very fortunate to have a passionate user base that really fosters a sense of sharing. In the past few months 3 community members in particular have stepped up to help out with code, answering questions on the group and on StackOverflow, and documentation. We have decided to offer these gents positions on the S# team.

Please join us in welcoming Geoffrey Smith, Seif Attar, and Dan Smith to the S# team.

 Geoffrey Smith

 Geoffrey offered to help out with documentation and UI. He will be joining the main S#arp Architecture team and lending a hand with the 2.0 rewrite. One of his first tasks will be to spice up the Northwind sample. If you have ideas of items you would like to see in a Kitchen sink type sample, let him know. Geoffrey is relatively new to the .NET / C# world, coming from a Java / Python background. He most recently used S#arp Architecture and Lucene.net to index and search a large document repository. As a guilty pleasure, he enjoys working with the Arduino-based ArduPilot to create fully autonomous drones.

Seif Attar

Seif will be joining us in the role of the S#arp Architecture Contrib project lead. He has been developing software for 8 years, mainly using C#. Being a Linux user and free software advocate, he was very happy to find out about the Alt.Net movement as he could finally combine his work with his sense of community. He has been using S#arp Architecture and learning from its community since early 2009. He is active on the mailing list as well as StackOverflow.

Dan Smith

Dan is joining us on the S#arp Architecture Contrib team. He is currently the lead programmer for a medical device sales and training company in Connecticut. He uses S# day to day at work along with techniques he has learned from the WCHM project using AutoMapper and MEF.

 

Both Seif and Dan will be involved with the 2.0 rewrite on the Contrib as well as the main project. We know the community will join us in welcoming them

Tags:

Road Map | S#arp Architecture

Sharp Architecture 2.0: How are we going to get there?

by alec.whittington 11. October 2010 06:14

Now that we have published our 2.0 road map, several people have asked us how are we going to get there. Simple, one step at a time.

One step at a time

We have previously blogged about Templify (here and here) being the way we are going to deliver a S#arp Architecture solution. That was step one for us, so you could say that we are already starting to deliver 2.0. Our next steps will be as follows (subject to change)

  1. Create an initial 2.0 release that includes (v1.7.X)
    1. Convert solution and projects to Visual Studio 2010
    2. Convert all projects to .NET 4.0
    3. Reorganize the solution structure for the solution template (moving to a Who Can Help Me based folder structure)
    4. Solution to use new MSBUILD based build system
    5. Package for Templify
    6. Document new Build process
    7. Add documents for Templify
  2. Create next release that includes (v1.8.X)
    1. LINQ Specifications
    2. Component composition
    3. Component registration
    4. Isolate NHibernate
  3. Create the next release (v1.8.5.X)
    1. Support for Castle 2.5
    2. Support for NH 3.0 (whether it is a GA release or not)
    3. Fluent NHiberate compiled against NH 3.0
    4. Support for MVC 3
    5. Change Validation (Data Annotations for UI, NHibernate.Validator for Model)
  4. Create the next release (v1.9.X)
    1. Convert Default Package to use Spark as its default view engine
    2. Add documentation (blogs and wiki) on how to properly setup the Spark environment
    3. Include the new Plugin architecture
    4. Add documentation (blogs and wiki) on the new Plugin architecture
    5. Support for NoRM / MongoDb
    6. Support for Azure
  5. Create the 2.0 release (v2.0.X)
    1. Final bug fixes
    2. Update all documentation
    3. Add samples via Blog posts
    4. Update Northwind
    5. Update Who Can Help Me
    6. Start creation of 3rd sample

All of this is subject to change based on the needs of the community / the team.

Conclusion

As you can see, we have an ambitious schedule a head of us. The team and I are really excited about what we have planned and cannot wait to share it with everyone. Some of it is very exciting, like the Plugin architecture and alternate data store support.

S#arp Architecture 1.6.5 will be the last stable release until 2.0 is released. The interim releases will all be listed as Alphas or Betas and should only be used in production if YOU are comfortable with it. If you are not or need to wait for a stable release, please wait for 2.0. For each release, we will also provide another Templify package. If you want the full source, you can download it from GitHub.

Tags: , , , , ,

Road Map | S#arp Architecture | Templify

Using Templify to create a new S#arp Architecture solution

by alec.whittington 10. October 2010 18:51

Last week Howard van Rooijen blogged about Templify. I am happy to announce that Templify is now the offical way to create a S#arp Architecture solution. Templify comes packaged with a S#arp Architecture package, so there is nothing you need to do, other than install Templify, to get it going. I'll leave the details on how to install and use Templify for Howard's post. This article assumes you have Templify installed already.

Create a new S#arp Architecture solution with Templify.

 

Tags: , , ,

S#arp Architecture | Templify

About the Team

Sharp Architecture was originally created by Billy McCafferty.

The project is currently led by Alec Whittington and the development team currently consists of James Broome, Jon George and Howard van Rooijen

Page List