The Software Factories provide you with a set of proven practices for building distributed applications. These practices are exposed through architectural overviews, patterns, how-to topics, reference implementations, automated guidance packages, and application blocks. There are several SW factories you can download today ( Web Service (WSF), Smart Client(SCSF), web client (WCSF))
Microsoft Software Factory
- Software factories mean, different things to people: some are more academic, some are more pragmatic and more tool-focused. Like the one Microsoft is using for example “A software factory is a structured collection of related software assets.
- When a software factory is installed in a development environment, it helps architects and developers predictably and efficiently create high-quality instances of specific types of applications.”
- Although the differences, they all share some common motivator : helping the developer (or designer/architect) to get the job done in a more efficient way (time-to-market) and more with more quality.
- MS SF is also about guidance. It should feel having an experienced person next to you and advising you what you should , when you should do it and how you should do it . In the current incarnation of SF this will translate into some menus, wizards and templates to the standard Visual Studio environment (Solution Explorer) to help developers build whatever the SF was intended for.
- MS SF is also about automation. Capturing this expertise/best practices/guidance into integrated, automated features of Visual Studio and letting Visual Studio do some tasks in a consistent (so less error-prone) way , takes away some chores from the developer. You could say SF are about re-use but not only code but also expertise.
- MS SF is also geared towards abstraction . The patterns and best practices to build a web service are not directly translated into code but there’s is an intermediary step. This gives you an opportunity to delay certain implementation decisions. It enforces you to think about it first. So the model is not the code but an abstraction (visual or not) of what you’re trying to establish and this data is kept and not lost.
- The technologies that makes this possible are
- The Guidance Automation Toolkit and its "run-time" companion Guidance Automation Extensions (GAX/GAT)
- Domain Specific Language toolkit
- Advancements in Visual Studio itself (Designer Integration Service) - The main point is that Microsoft Software factories help Software Factories help you build a specific kind of application.
Domain Specific language and DSL Toolkit
- A domain-specific language (DSL) is a programming language or executable specification language that offers, through appropriate notations and abstractions, expressive power focused on, and usually restricted to, a particular problem domain.
- The DSL Toolkit (in the SDK) allows you to build visual interaction components that can be used from with in VS just like you would for example use a Winform Form designer. You drag & drop the VS-integrated graphical notations for a given model on the canvas and model the part of the application the DSL was conceived for. Later the actual code is generated for you. So the toolkits allows you to construct a custom-tailored designer for a model for a particular problem domain.
- The main reason for this specialisation is that the more focused you are on a domain, the more specific you can make the abstractions and the better you can generate code from this models. Note that domain is not necessarily technical but also can be created for a particular sector like healthcare or finance.
Guidance Automation extensions and toolkit
- The Guidance Automation Toolkit and its "run-time" companion Guidance Automation Extensions (GAX/GAT) enable you to extent the Visual Studio 2005/2008 experience.
- The Guidance Automation Extensions (GAX) is the runtime part that needs to be installed on the machines of the developers that want to use the Guidance Packages.
- The Guidance Automation Toolkit (GAT) is the authoring part that helps you create the Guidance Packages and the setup projects to install them. Once you've installed GAT, you'll notice a new project type in Visual Studio called "Guidance Packages". This will contain all the packages that were installed on this machine.
- Designed to simplify integrating reusable code into applications.
- Allows architects to automate development activities that developers would usually have to perform manually; often by following a series of instructions.
- By using the toolkit, architects can also ensure that repetitive and often error-prone activities are performed in a consistent manner, streamlining and accelerating the development process.
Portfolio
Gives answer to various scenarios
- Smart Client Software factory
- Web Client Software factory
- Web service software factory
- Mobile Client Software Factory
- Repository factory : The Repository Factory generates business entities, stored procedures, and repository classes based on an existing database. Can be enabled in the other factories.
- Application Block Software Factory : Included in the Enterprise Library - guides developers through the process of creating new application blocks and extending existing Enterprise Library application blocks.
We can see a line in the advancement of Guidance and guidance automation in particular
- Zero generation : guidelines in paper form, Application block as accelerators , VS templates
- First generation : wizard-like , modelling data is translated into code, modelling data is not kept (Smart Client Software Factory , Web Client Software factory )
- Second generation : Integration of DSL technology, modelling data is kept (Web Service Software factory Modelling Edition )
- Next generation : Integration multiple models
Smart Client Software factory
- addresses the challenges around building complex enterprise Winforms applications. As the complexity increases and the teams grow, the application becomes increasingly difficult to maintain.
- enables designing a composite application that is composed of many discrete, loosely coupled modules. These modules can be developed, tested by separate teams.
- Build upon the Composite Application Block (CAB)
- Not all part are compiled together in a giant .exe file,
- parts are more or less separately and at runtime they are compose together
- CAB provides the “infrastructure” to support the loos-coupling
- Microsoft.Practices.CompositeUI.dll
- Microsoft.Practices.CompositeUI.WinForms.dll
- Microsoft.Practices.ObjectBuilder.dll - Make use of Enterprise Library modules (Exceptions, Logging, Caching, Security)
- Aim SCSF: let application developers concentrate on the “application” logic not the infrastructure part (CAB)
- Generates consistent application infrastructure, style and logic
- Intrinsic separation of form from function / application layers
- Uses Model-View-Presenter pattern (Passive View Variant)
- Integrated front-end to diverse data sources
- Sync & async web services, online & offline capable, caching
- Based on concept of Dependency Injection (ObjectBuilder component from Enterprise Library )
Web Client Factory
- Similarities with SCSF in concept
- Creates Initial Visual Studio Solution
- Web Application Projects or Websites
- VB or C#
- Add View-Presenter, Business Modules, etc.
- for developing applications where the client is running on mobile devices such as PDAs and smart phones.
Web Service Software Factory Modelling Edition
- This is the third version.
- C# only
- ASMX and WCF
- For developing distributed applications communicating via Web services.
- The factory uses three types of models to generate service code ; Service Contract models , Data Contract models, and Hosting models.
- The models are visualized with special “shapes” and their corresponding properties. The look & feel is like the Class diagram tool in Visual Studio. So it is not UML (too generic) .
- The designers that enable the modelling features are actually build with the DSL toolkit. For each of the three model (service, data and hosting) you get different designers. From the demo it looked very slick.
- Extending the WSFm is possible . P&P identified some 11 scenarios. Some of them , like changing something in the exiting code Text templates are very easy , while other require you the download the source code for the WSFm and modify (and maintain ) it yourself.
Repository Factory
- Used to be a part of Web Service factory as the Data Access Guidance Package.
- Now separate package that can be enabled in other packages
- The Repository Factory generates business entities from tables in a existing database, CRUD stored procedures for each table in the database, and repository classes based on an existing database.
- Data Mapper (Fowler) with pure ADO.NET using SPROCS
- Multi-Database Support via Data Access Application Block
- No Relationship Support- 1:1, 1:m, m:m
- No Object State Tracking
- Currency Support Only via Timestamp
- Community Led Development on codeplex.com .
References
- Patterns and Practices Guidance ( http://www.pnpguidance.net/)
- Microsoft patterns & practices SF ( http://msdn2.microsoft.com/en-us/teamsystem/aa718951.aspx)
- Software Factories: Assembling Applications with Patterns, Models, Frameworks and Tools (Jack Greenfield & Keith Short)
- Compuware Belgium forum site, http://intofactories.net/
- Code generation Conference 2008 ( http://www.codegeneration.net/conference/index.php)
- Domain-Specific Development with Visual Studio DSL Tools (Microsoft .NET Development Series) by Steve Cook, Gareth Jones, Stuart Kent, Alan Cameron Wills.
- The EFx Architectural-Guidance Software Factory,Jezz Santos,http://msdn2.microsoft.com/en-us/library/aa905331.aspx
- HL7 Software Factory , Mauro Regio , http://softwarefactories.com/workshops/OOPSLA-2005/Papers/Regio.pdf
- Software Factories: report from the trenches, and thoughts from p&p ,Edward Jezierski , http://blogs.msdn.com/edjez/