Tuesday, February 12, 2008

In a previous post we have seen the Application Explorer acting as a starting point for our software factory. To continue our journey, let's have a closer look at this Application Explorer. For example, where does it get the list of installed software factories from? 

factory 

A quick look at GAC on our Rosario VPC reveals a few new assemblies that (based on their name?!) might have something to do with software factories. these are:

  • Microsoft.VisualStudio.SoftwareFactories.Runtime.dll
  • Microsoft.VisualStudio.SoftwareFactories.Runtime.VSHost.dll
  • Microsoft.VisualStudio.SoftwareFactories.ApplicationExplorer.dll 

The Application Explorer is obviously implemented in "Microsoft.VisualStudio.SoftwareFactories.ApplicationExplorer.dll". Currently, no (public) documentation is available so we have to use reflector to find out this assembly holds the "ApplicationExplorerPackage" (inherited from Microsoft.VisualStudio.Shell.Package) which is using the "FactoryManager" (more on that later). Besides the "ApplicationExplorerPackage" this assembly also implements the ApplicationExplorerToolwindow and the ApplicationExplorerControl which are representing the UI of the Application Explorer in Visual Studio.

Digging a little further, we can find out the "FactoryManager" (implemented in Microsoft.VisualStudio.SoftwareFactories.Runtime.dll) is using the "FactoryDescriptorsLoader" to search the Registry for installed software factories on the machine.

please note more classes are involved in this "discovery process" but I am only focussing on the high level to make this post not more confusing than it probably is already. I am sure you know how to use reflector yourself if you are interested in more details ;)

As we can see in the screenshot below the Registry (HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\9.0\SoftwareFactories) in the Rosario VPC holds information about two installed software factories. By looking at the Service Factory node we can see the Registry contains the Name, Description, InstallDir, Version and SchemaFileName of the software factory.

registry 

SchemaFileName?! hmm....is this in anyway related to the "Software Factory Schema that is discussed in the "Software Factories" book? Below a screenshot of the Schema File for Service Factory that we can find in the "InstallDir" of Service Factory (C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies). Pretty interesting to finally find concepts like "viewpoints" and "workproducts" related to software factory implementations.  

Schemafile  

Without going into too much detail, how does this all work?

It all starts in the "VSPackage" (inherited from Microsoft.VisualStudio.Shell.Package) that can be found in "Microsoft.VisualStudio.SoftwareFactories.Runtime.VSHost.dll". At some point a "FactoryManager" (Microsoft.VisualStudio.SoftwareFactories.Runtime) is instantiated. This "FactoryManager" is using a "FactoryDescriptorLoader" to read the Registry and to create (and cache) a collection of "FactoryDescriptor" classes. The information contained in the software factory Schema File eventually ends up as a "Factory" instance that holds the "FactorySchema" which is the root for the FactoryViewPoint, Command, WorkProducts, etc. The Application Explorer on its turn is using the "FactoryManager" to list the installed factories, the viewpoints it contains and enables us to (for example) execute the "Create Product" action that we discussed earlier.

Again, just the high level overview! There are a lot more interesting classes and concepts involved in this but it hopefully gives some basic understanding. In a next post we will try to understand the purpose of the "Commands",  "Viewpoints" and "Workproducts" that we have seen in the software factory Schema File.

To be continued...

posted on 2/12/2008 11:48:22 AM UTC  #   
 Sunday, February 10, 2008

A few months ago "Rosario November 2007 CTP" became available for download. Based on the available documentation, walkthroughs and “mini stories” we can safely conclude that this release wasn’t really build to please the software factory guys out there! However, what it *does* contain is a (limited!) version of Service Factory that works on a very early (?) version of the Software Factory Runtime. This might be interesting. Let’s have a look if this version of Service Factory shed some light about what we might expect from Rosario in the software factory space.

(Of course, this CTP is relatively old already and hopefully a new one will arrive in the coming ? but maybe we can learn something from this CTP already...)

Ok, how does Service Factory looks like in Rosario CTP? To find out we can start a new Service Factory project by using the Application Design template that can be found under the “Distributed Systems” node in the “new project” dialog.

NewProject 

After the template unfolded, the first thing to notice in our new solution is the new “Application Explorer”. From this new “Application Explorer” tool window we can create a “Product” that is based on the installed software factories on the machine. As we can see in the screenshots below this machine has two factories installed and one of them is “Service Factory”.

ApplicationExplorer 

 factory

By selecting "Web Service Software Factory" and pressing "OK" in the "New Product" dialog we end up in a situation that is similar to the one we are familiar with when using the current Service Factory. We can create a "New Model" and use the factory "as usual" from there.

NewModel 

Digging a little further in this CTP tells us (Add or Remove Programs) GAX is installed and GAT isn't! Further we can see that besides the package that looks like the "normal" Service Factory a package called "Web Service Factory Application Designer Integration" is installed.

Controlpanel

A quick look at the installation location of Service Factory (C:\Program Files\Microsoft Service Factory V3) tells us that this version of Service Factory indeed looks like an ordinary software factory that is build on top of GAX. The installation folder still contains recipes, vstemplates, T4 templates, etc.

What does this mean? Can we use our current software factories (or at least parts of them) in Rosario? If so, do we benefit from anything new? How does Service Factory integrate in the Application Explorer? Where do we need this "Web Service Software Factory Application Designer Integration" package for? Is the "Software Factory Runtime" in this CTP of Rosario only implemented by GAX?

To be continued...

posted on 2/10/2008 8:47:04 PM UTC  #