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  #   
 Tuesday, December 18, 2007

It is there, a new Software Factory Community Portal!

 Martin Danner, Jezz Santos and myself have been talking about starting up a community around software factories for some time and now we finally did it.  

This community is all about software factories, domain specific languages, Visual Studio Extensibility and other related topics. The portal includes a forum, blog aggregation, news and additional resources like links, articles, books, etc. We haven’t finished adding all resources yet but registered users are allowed to add new resources, provide ratings and add comments.

So, please join us there, start discussing and participate in building a community around software factories!

posted on 12/18/2007 8:19:16 AM UTC  #   
 Thursday, November 01, 2007

We already announced the availablility of part 1 in our "Packaging & Building Software Factories" series here. Today, part 2 called Automated Builds with Team Foundation Server is also published. Enjoy!

posted on 11/1/2007 4:24:07 PM UTC  #   
 Monday, October 29, 2007

Finally, part 1 of  our (short) series about "Packaging and Building Software Factories" is published on MSDN. The goal of these articles is to help you with packaging your software factories and implementing a team build with Team Foundation Server. As you will see this isn't always as straight forward as you might expect! These are the parts in this series:

I co-authored the series with Jezz and my colleague Rene. Thanks guys! Also, many thanks to our reviewers: Gareth, Pablo, Attilah, David and Mark Nichols !

We also included reference implementations for you to download and created a CodePlex project (for part 2 in this series) that we will use to publish some additional MSBUILD tasks and 'utilities'.

Stay tuned for part 2 and let us know what you think!

posted on 10/29/2007 8:06:52 PM UTC  #   
 Thursday, October 18, 2007

Ok, part 1 in our "Building Software Factories" series is finally on MSDN! . This part called "What are we building and why" describes what a factory is in concrete terms and explains what it takes to build one. As you can read in this post from Jezz part 2 and 3 will follow (soon?!).

Also expect another series about Packaging and Building Software Factories REAL soon.

posted on 10/18/2007 7:16:02 PM UTC  #   
 Monday, July 30, 2007

The slides and recording of our (Jezz and myself) session ‘Build Your Own Software Factory’ are now available for download.

From the statistics of my blog I know that most of my ‘readers’ don’t live in Japan, but If you ARE in Japan on 21st-24th August and plan to visit TechEd Yokohama, come join us and attend our session.

posted on 7/30/2007 11:47:25 AM UTC  #   
 Sunday, July 01, 2007

I was just checking my mail after a two week holiday and noticed an e-mail telling me I am awarded with a Microsoft MVP award (Visual Developer – Solution Architect).

Wow! Thank you very much!

posted on 7/1/2007 8:24:25 PM UTC  #   
 Tuesday, March 06, 2007

Factories 201 Series - Building Software Factories

Post authors: Edward Bakker and Jezz Santos.


Well, we have finally come to the end of this 201 series on ‘Building Software Factories’.

First time arriving here? - we have listed the entire series above – please have a look through those posts before ending it below.

If you are arriving here after reading (hopefully all) the posts in the series, we wanted to say, good on you, and thanks for sticking it out with us.

Series Wrap-Up

Well, we have spent quite a bit of time and thought in putting this series together for you. The motivation behind this effort has been that we’ve recognised that there is little practical information helping ordinary professional developers on getting started with building and understanding software factories. We have had quite a head start on this and wanted to share our knowledge and experiences with you and the community to promote the uptake of building factories, which in turn should promote the adoption of software factories and the industrialisation of software in general.

This series was created in a format that asks a logical sequence of questions that you might have when trying to figure out how to build software factories today. We have covered many such issues as they arose and shared much of the combined knowledge and experiences built up over the last few years in this space. We will be sharing more resources on this in future posts – so stay tuned to our blogs.

We hope that you can take the guidance represented in this series forward as a starting point for developing your own software factories further. We recognise openly and frankly in the series that this is not a trivial undertaking today, but hopefully we have shown you that it is very possible and how to successfully approach it. Hopefully we have also directed you to what’s most important, where you should direct your energies, and how to build factories practically and realistically.

Your Feedback

One of the primary objectives of this series was to connect with many more of you in the community and share ideas and innovations about everyone’s efforts at building factories today.

We have received a small number of comments to this series so far, which we have been keen to discuss at length, and hope we have done a good job at answering the questions appropriately. Hopefully, there are many more of you out there building factories, or at least considering building them, and so we hope to hear more from all of you on that. Please drop us a comment on the appropriate post and we will work hard to get you an answer you will find useful.

If we are doing a good job please let us know. If we are doing a poor job and you don’t like the guidance we are giving please let us know that also. This should shape any future guidance we give the community in this space, and at least we can start further discussions with those of you in this space. Hopefully, we will also get a feel for just how many of you are out there are in this space.

The Final Say

There should now be a little more information out there to help you build a software factory right now on the Microsoft platform with the current toolsets. This series was created exactly for that purpose to share with you the experiences we have had in building factories and give you insights into the issues we have faced on this road already.

As more and more people jump into this space we expect to see from the community more detailed, formal guidance on this subject, so that the community as a whole can learn from previous experiences and elevate the adoption and the application of software factories to real world projects.

After all we think that the act of building a software factory should leverage the tenants that software factories promote themselves, i.e.

“Package domain expertise and guidance in a form that others can re-use and manipulate to create solutions using simplified descriptions of the problem at hand.”

Hopefully we have done a good job of that for you, and hopefully you will consider the experiences we have shared in this series in your factory building efforts.

Come see us...

Tech Ed Bloggers

We are proud to announce that we will be presenting a session on ‘Real World: Building Software Factories’ at Tech-Ed 2007 in June this year.

The 300 level session will contain material from this series and demos and examples of other factories to explain the concepts. We would love to meet up with you there and answer your factory building questions.

 

Many Thanks, Jezz Santos and Edward Bakker

posted on 3/6/2007 10:36:48 AM UTC  #   
 Tuesday, February 27, 2007

Previous posts in the Factory 201 series:


After reading all of our previous posts (don’t tell me you skipped one!) we know what automated assets to build, which tools and technologies to use and how to build a factory. The final step here will focus on the quality attributes we have to keep in mind during the design and development of our factory in order to make it a stunning success! In other words, “What should we strive for?” when building our factories?

Abstraction

In a previous post “With what would you build it?” we already mentioned the power of using abstractions in our factory. Let’s dig in this a little further and see why abstraction is definitely the top thing we should strive for!

Increased Productivity

One of the advantages of using abstractions in our software factory is significantly increased productivity. We can think of an abstraction as a simplified representation of a specific problem. In fact, we are probably using abstractions in our job as a developer or architect every day. (i.e. 4G programming languages, class diagrams, API’s, class libraries, frameworks, DSL’s etc.)

Think about it, for example, if we build a helper class to perform a specific task (say: logging to a file) we are actually using abstraction. We create a class and some methods that simplify the details of logging, file management, rolling-over, naming, log details and formats etc. Once we have the helper class in place we can just re-use the helper class using some basic parameters without focussing on the details of how it works anymore. We solved our problem more simply by creating the helper class.

Now, let’s elaborate on this a little further. Suppose we only use this helper class in certain circumstances of a particular type of solution, let’s say only for certain components of a particular application. In this case, we don’t use or need all the possible parameters of the helper class (because we only use it in a certain way in this context), and let’s say we identify 5 different cases of use, each with different parameter values. Now we can build another higher-level helper class that wraps the original helper class, and defines only one parameter which describes one of our 5 cases – perhaps an enumeration. Our new helper class is now an abstraction of the older helper class – because it simplified its usage in this particular context. Typically, this new level of helper class becomes part of a framework for those types of applications, because we have made certain types of assumptions about how the helper class is to be used.

[To clarify this, using abstraction for simplifying a problem is something we see all time. For example, take ADO.NET that hides a lot of the low level details that are needed to communicate with a SQL Server database. On top of that we have Enterprise Library that adds another abstraction level to make data access even more straight forward. In the future, ADO.NET vNext and the Entity Framework will do an another attempt to raise the level of abstraction for “data programming”]

As we continue to build up the levels of abstraction, you can see that we can solve more specific problems at less level of detail, and also by using a higher level description or language. If we can get close to a point where we can provide these abstractions in terms of the specific problem we are solving, we are making it real easy to program our application (based on minimal information). This is where productivity is gained.

Abstraction Roadmap

When developing a solution you can think of many abstractions, when you add modelling and automation to this picture the possibilities for abstraction build upon each other vastly:

Platform API’s → Application API’s →Helper Functions →Class Libraries → Frameworks → Domain Models → Software Factories

Each of the abstractions denoted above increases the level of abstraction of the problem you are solving, and in each case also narrows the domain of the solution you are providing for – this is the simplification part. I am sure it’s obvious to you that using a domain model to configure an application is far quicker than writing programming API’s to describe the same thing.

The other key point here is that I can configure my application in terms of high level things that make sense to that application and not in the low level details of the API’s. This means that those using the domain model now don’t need to be programmers they can have higher level skill-sets like solution design, requirements gathering and interpretation etc. By raising the level of abstractions we are moving from a physical design (platform API’s) to a logical design (domain model) that exposes less details and is understandable for a much wider audience.

Automated Guidance

Another very important aspect we have to keep in mind during the development of our factory is the level of automated guidance we expose to our factory users. In our post “What would you build?” we have already discussed the different types of automation assets that we might want to use in our factory but we have make sure we use them in their most effective way.

Remove Mundane Tasks

A top quality attribute (from a developer’s perspective) for using our factory would be to provide automated assets that remove the rote and menial tasks from the factory user’s ToDo list. At best remove these types of duties completely from the developers ToDO list. We as solution developers, often have some predictable boring tasks that we have to do over and over again. By exposing automated assets for these types of tasks we save our factory users from completing these mundane and in-variable tasks and let them focus on the variable and more exciting design aspects of the solution they are building. Our factory users will definitely love us for that!

Transfer Domain Knowledge

The design of our automated assets must ensure they capture knowledge and experiences and can be used to make that knowledge available for others. Using the example of a DSLs’ domain model which holds the knowledge about the underlying solution domain and how it can be and should be manipulated. By using the DSL, the user is presented with all the knowledge of how to describe the domain, the parts and relationships of that domain, and the description of the pieces within it.

The important part of this is that the domain model helps the user to figure out the key parts (concepts) in the domain. The domain model (and designer in case of the DSL) guides the user through the process of modelling a solution for the problem by using concepts that make sense to him. In fact, the user learns the domain and the important concepts of it but also how to provide a solution by using these abstractions.

Enforce Compliance and Completeness

When we design the automated assets (and factory as a whole) we encapsulate the architecture of the factory product in the domain model that is used by the factory – this is the model of the product.

We can build automation assets to populate or configure the product model and in this way ensure compliance with the implicit architecture of the product. Because these models have configuration to address their variance, validation can be used explicitly to ensure the factory user has not configured parts of it incorrectly with respect to the whole solution.

Automation assets can also be used to examine the model, check for completeness and use that information to guide the factory user in his next steps he needs to execute in the factory to complete the product.

Full Automation vs. Flexibility

When designing our automated assets we have to keep in mind to keep them limited and focused on one particular concern. It doesn’t make sense to build a huge fully automated asset that covers multiple concerns and generates a lot of unrelated artefacts (i.e. source code and configuration files). It also doesn’t make sense to build a DSL that tries to model to world. If we expose a number of small, highly focussed automation assets we have a much more flexible factory because we can, for example, change the order in which we manipulate the assets, combine them or even decide not to use some automation assets at all to better meet the requirements for the product we have to build.

However, if we go too far with variability and refining our abstractions and automated assets to a more detailed level we might end up with a factory that is less productive because there are more “moving parts” that needs to be configured which also increases the complexity of using the factory.

Finding a balance between full automation and flexibility is absolutely key here!

Usability

Because we are so busy developing our software factory we might forget that building a fully fledged and super cool software factory that generates the perfect product isn’t enough to make everyone want to use it. In the end it is often the factory user that has a huge influence in the adoption of our software factory. This means we have to make it cool to use the thing and make it flexible and intuitive enough to use and improve the experience of building solutions in this domain with it!

You don’t want people to discard you factory because it too hard to use, or discover how to use effectively. Don’t assume they will read the manual!

Promote Adoption

Another thing we have to keep in mind during the development of our factory is the fact that the factory is likely to be used by other less-skilled and less-knowledgeable developers than the ones that building the factory. They might not even have to be developers! This means, we might have an issue here in convincing other development teams to adopt the factory and use that instead of their existing tools, frameworks and utilities they are so familiar with. Or worse, have built themselves!

To get our factory adopted by our audience we have to lower the bar for them to start using the factory. Of course there are multiple ways to achieve this and they will probably differ dependent on the organization structure we are working in. Suppose we are working in an organization where the factory is build by a dedicated team that is known by the several project teams responsible for delivering products. In this example, the factory team can support the project teams in the start up phase of their project to get familiar with the factory and makes sure the project team gets up to speed on using the factory real quick. Once the factory is adopted by the project team responsible for building the product, the factory authoring team can start collecting the feedback from this team to enhance the factory and increase the usability of the factory even better. You see this in the process described in “How would you build it?

Role Sensitivity

A software factory, just like any other development tool, is potentially used by a lot of project team members (factory users). i.e. Developers, Architects, Testers, User Experience Engineers, Technical Writers etc. To get the full potential from our factory, and factory users, we must make sure the factory targets the audience that is supposed to use the factory in the way they want to use it. In other words before we start developing our factory we need to know what types of users we expect for our factory. Do we only target architects, developers, testers or is it a mix of these types of users that we are aiming at?

Why is it important to know the factory users? Well, each type of user is interested in a different set of concerns and views of those concerns (In factory terminology this is called a ViewPoint). For example, an architect might only be interested in the high level view of the system design while the developer is interested in much more technical details.

Once we know our audience, and those who we are building the factory for, we can attempt to provide them with the right tools, views and level of abstraction to support them do their job in the best possible way and be more productive when using the factory.

Customization

Software development is rapidly changing. New technologies, new paradigms happen almost every day. To be successful in software development we have to keep up with these changes, and therefore our software factory has to too!

In our post “How long will it take?” we have seen that our factory only start to pay back after we have used it for greater than ~5 times, so we better make sure we can customize our factory very easily to meet evolving requirements and additional product variants. This is exactly why we have an iterative development cycle as defined by “How would you build it?

One of the key requirements of any development tool like a factory is to be flexible enough to address as many use scenarios and development environments as possible. Otherwise its’ use is limited. There are two aspects of customization worth noting here:

Factory Customization

Firstly, there is customization of the factory itself, usually to accommodate a change in architecture or change in variability of the existing architecture that the factory models. This is hard to accommodate if the factory itself presents a closed programming interface. However, this can be accommodated by defining good extensible infrastructures to the architecture so that those using the factory can easily customize it to add or remove features or variability that the factory presents. We see this most when ‘horizontal factories’ are customized to suit certain vertical scenarios, where variability in most cases wants to be predefined, and fixed, and therefore requires removal from the user experience of the factory.

As an example. Consider a (horizontal) factory that builds web services. If I want to ‘verticalise’ this factory and customise it to suit building certain types of financial web services, then it’s likely that for financial web services, I want to pre-define certain Operations Contracts and Data Contracts to use. The Operation and Data Contracts are one point of variability of the horizontal factory, and the horizontal factory provides assets to allow the user to configure them. Now that I want to customise this factory to make a new verticalised version that is financial services based, I want to be able to say that the Operation and Data Contracts are fixed to certain industry standards, and no longer configurable by the factory user.

Product Customization

Secondly, there is customization of the automation assets used to create the product itself. Typically, the scenario here is that you want to alter the automation assets used to transform the model of the product into a physical solution.

As an example. Consider a factory that generates source code as its final product. The source code is determined by the factory in code templates, which are used to transfer the models of the factory into a physical solution. So consider, that the generated code does not agree with you in some way. Often, this needs to be changed to suit an organisations’ coding standards, or include some organisations standard copyright header, or perhaps you want to change the code that is output because you have a more optimal way to write the solution.

Extensibility & Composability

One of the key issues of building factories is in providing the right guidance and solutions to varying requirements. Creating a factory for a large domain increases the chance that the guidance it offers is limited in addressing wider usage scenarios.

For example, consider a factory that builds web services. This factory is likely at some point to define a mapping of the web service’s logical architecture to source code artefacts. In doing that, the factory itself will have to make decisions about what patterns and technologies to use to do that. The assumptions it makes to do that may not be valid for all cases, and it is such cases that may prohibit the use of the factory at all, if the factory user cannot customize or influence how that is done. In smaller domains the chances of meeting this issue are smaller, because the possible solutions are smaller in number. However, even in smaller domains, there can be several solutions that apply to different circumstances. This means that larger domains need to be composed of smaller domains, where each smaller domain could be swapped out for a different implementation.

Composite Factories

In order to practically achieve this we need to be able to compose larger domains from smaller domains, and have the domains interact with each other. Furthermore we need to be able to potentially swap-out each domain with a different implementation.

In factories, this can be achieved by providing extensibility mechanisms that accommodate plugging in and out various other factories to provide the sub-domains. We call these sub-domain factories ‘factorettes’. These extensibility points are key for expanding the use of your factory, so others could provide alternative implementations for the pieces of you factory to suit their needs.

One such use of this is to provide specific technology implementations or strategies for implementation such as the ‘EFx Factory’ does, so that factory users can pick and chose which technology to use to implement the Service Contract or Data Mapping layers, for example. Of course you can choose many other aspects to make extensible in your factory apart from technology. Perhaps you want to allow other factories to provide better views of a part of a domain, or provide better implementations of it as well.

Summary

In this post we tried to list the important quality attributes for software factories. Building factories isn’t (only) about using the available technologies to build some automated stuff that is just cool. We have to realize that we need to take special care to ensure the factory is useful for our users, improves their productivity and adds value to help them deliver high quality products.
posted on 2/27/2007 8:24:05 AM UTC  #