Solution Composition in Windows Azure Cloud Service Project Template
Goal: This blog post aims to show you the new solution composition feature in the "Windows Azure Cloud Service" project type. In addition, I posted some additional thoughts on how this could be expanded as a very useful starting point for all projects.
The new "Cloud Service" project template includes a new feature (This is my name until Microsoft officially names it) "solution composition". In Visual Studio 2010 Beta 2 (if you install the Windows Azure SDK), you will see a new Cloud Service template. Through the screen shots below, I am going to highlight some of the key features of "solution composition".
Cloud Service (Azure) Project Type
Selecting the Cloud Service template brings up an additional dialog box that allows you to add a number of additional project types. Currently VB.NET, C# and F# web role and worker role projects are supported. Selecting the project and selecting the arrow button adds this project to the Cloud Service solution.
If you need several projects of the same type, you can add multiples of the same type. Notice the screen shot below illustrates a solution with three seperate C# worker role projects (assemblies).
Once added, project names can be renamed or removed. Red arrows below highlight the controls that allow editing of a project.
After clicking the OK button, a complete Cloud Service solution is created with all the projects properly added to the roles folder.
Why Does This Matter?
If you have architected large-scale n-layer prototypes or projects, you can clearly see the benefit of "solution composition". This allows you to select the projects you want ahead of time and "compose" a single solution. For example, imagine you want to create a Silverlight application with a WCF service. You might start with a Silverlight ASP.NET project type. However, then you need to manually add all the projects yourself and properly add the references between them in Visual Studio (i.e., WCF service project, BLL assembly, DAL assembly, LINQ to SQL dbml, Silverlight BLL, etc.). It would be much better to simply select the projects that will compose your solution and have Visual Studio generate the whole solution.
Solution Composition Features I Would Like to See
The Cloud Service template in Visual Studio 2010 Beta 2 is a step in the right direction; however, it can be greatly improved. These are some of the items I would like to see:
- Make "solution composition" available for all Visual Studio 2010 templates.
- Allow the architect/developer to build a dependency/reference tree between projects.
- Integrate the solution folders feature (Allows you to logically organize the solution).
- Allow the architect/developer to add specific functionality to a project.
- For example, if I want to have a DAL that uses LINQ to SQL, the ability to "checkbox off" and add a LINQ to SQL class
- Allow the architect/developer to specify the assembly references for each project (.NET, custom toolkit, etc.).
- Include a "smart namespace naming" feature. Assemblies are named namespace+project name.
- Ability to save the entire "solution composition" as a template itself for future use
- Integrate with TFS and replicate to all developers (?)
- Add diagraming feature
How Useful is This?
After reading this, you might be thinking that this is overkill and how often are you creating "large solutions". If you have prototyped a lot of solutions, this will be a Godsend. Furthermore, a lot of consulting shops that have to quickly generate client-specific prototypes would greatly benefit from this feature In my opinion, the more tedious (plumbing) tasks that are automated, the more I can focus on architecture or design of software solutions.