José Escrich Blog

extensibility thoughts

  Home  |   Contact  |   Syndication    |   Login
  17 Posts | 0 Stories | 1 Comments | 0 Trackbacks

News

Software Factories Toolkit, download now from http://softwarefactoriestoolkit.net

Tag Cloud


Archives

Post Categories

Image Galleries

Other Blogs

Wednesday, February 27, 2008 #

Some time ago I wrote a post in which I talk about how you can do unit tests over your text templates using the GAX Host. In that example I used a very simple template which receives just a couple of string properties. But it becomes more complicated when you have properties which are complex types ok I know, most probably you're thinking that can resolve that just creating your own mock objects and you're right.

But the thing is that you can do that in a really easiest way using a mock framework. I will not speak here about mock frameworks so you can find a lot of posts about it. I'll speak about MoQ which is a new mock framework developed by Clarius and other companies. You can know more about MoQ in the Daniel's blog and in its Google code page.

In the following example what I did was create a simple text template which uses an IEntitySchema object to create something like a Business Entity, so here we got an issue because we need an instance of that IEntitySchema and, the way to get it using the classic TDD approach, is creating an explicit Mock object.

So here is when MoQ comes to the rescue, if you see the code snippet it has a call to new Mock<IEntitySchema>() which will creates a proxy of an IEntitySchema implementation. After that, I defined our expectations for each interface signature in where we want to test an interaction.

image

image

So, at that point we're ready to perform the tests and make all the assertions, plus the really interesting thing, which is the verification of all our expectations. That basically means that, beside make the assertions over states, now we can check if some interactions was made or not (in other words if some method or some property in the interface has been called or not and if was called with certain parameters values and types or not).

I think that the test interactions are a really interesting thing to include in our classic Todd fixtures.

Download Sample Code

Enjoy.


Saturday, February 16, 2008 #

Finally, and after a grand effort, we got a final release of GAX/GAT February 2008 Release.

Mainly the most important improvements are that now you can use GAX side by side with Visual Studio 2005 and Visual Studio 2008 and now you don't have to do the painful task to unregister all your guidance packages prior to uninstall the previous version of GAX. In this particular release, we made an Upgrade than an Installer so you won't have to uninstall GAX, it will be just a click on the msi to get it everything update without loss any guidance package previously registered (*).

Some of the improvements for this release are:

  • Support side by side for Visual Studio 2005 and Visual Studio 2008.
  • Upgrade than Installer, the current GAX installer is an upgrade, so you don't have to uninstall all your guidance packages then uninstall GAX before to try install it.
  • Now you can also uninstall GAX whenever you want without unregister any guidance packages, it will do that for you ;), anyway you also have a nice UI in the uninstaller which tell you what guidance packages you will lost if you continue the GAX uninstallation.
  • Some error bug fixes when you use GAX for Visual Studio 2008 and the Experimental hive.

You can check the Grigori's Blog to get more information about this release.

Downloads

GAX and GAT must be downloaded and installed separately. GAT requires that GAX is installed first.

Remember: If you have a previous version of GAX installed on Visual Studio 2005, it will be updated to the February 2008 release of GAX. You are no longer required to uninstall GAX and the corresponding guidance packages (with an exception of GAT, which must be re-installed).

Enjoy!.


Thursday, June 07, 2007 #

During this past month I've been working in a new T4 template editor as a part of the SFT.

If you're working with dsl or gax you already know, how the editor looks when you try to edit a text template file, it looks like this:

image

So now you can have a fully colorized text editor for your T4 templates like the ASP.NET Vs editor and you can get it now downlaoding the ClariuS Software Factories Toolkit here.

Colorizing, Intellisense and Validation

In this release it's providing colorizing and intellisense for the T4 statements, like directives, class features and blocks. Regarding the directives you have intellisense for all well known directives and its properties and values. 


 t4editor

One interesting feature is for those the well known properties which represents a type, the intellisense gives a complete list of the current project types including its references. 

 t4editorintellisense00

Validation

Like the ASP.NET editor you have a real time document validation.

Validation

 

Preview Transformation

One useful feature is the possibility to run a template transformation in design time, basically as you know, there are two common contexts to run t4 templates, that's a DSLTools Host and GAX Host. When you use the GAX host, most probably you use properties, so you can specify those properties values through the editor property window.

t4editorproperties

If you want to use complex types you can specify in the property declaration an UITypeEditor and a TypeConverter if it's needed.

t4typeeditor

So to run the transformation you just have to specify some values for the properties and run the preview transformation commands, which is located at top of solution explorer or in the editor context menu. After running the transformation you get a temp file with the output. If you've specified the ouput extension directive the temp file will have that extension, that's useful so that so to instantiate the proper Vs editor for that output file.

The transformation could fail for different reasons, if the transformation fails when the template is compiled you'll get those errors into visual studio error list, however if the transformation fails after the compilation and when the template is running you'll get the errors in a temp output file.

Debugging

Unfortunately, in this version the editor does not have debug yet, however in the meantime you can check the Garethj's Blog, there he has a post of how you can debug a template. I hope we could include this feature on future versions.

What's coming

We're working in one important feature which is supporting intellisense and colorizing for the embedded language like you already have in the ASP.NET editor.


You can try it now, download the Clarius Software Factories Toolkit from here.

Enjoy.


Today we shipped the June CTP of the Clarius Software Factories Toolkit, which includes a new version of the Recipe Designer. The main change what I've been working on, is the serialization behavior in order to support round tripping, beside that was an interesting opportunity to work implementing a custom serialization in a Dsl.

So now if you change the .xml extension of the recipe definition file with  .recipe extension, you'll get a graphical representation of your recipe, the only constraint that it has is that it is not supporting XInclude.

image

Key features

Round tripping: Now you can edit your recipe using the default xml editor as usual maintaining the synchronization with the designer with no extra work.

Improved User Experience: Simplest new ToolBox. Now you basically have two connectors, one to connect arguments with wizard fields or action properties and another to define the flow between actions and between pages. Also the shapes includes useful information like the friendly type name and in the case of arguments if it's required or not

image   rd00  


Main manifest syncronization
: if the recipe definition is well formed, you'll get an xinclude of your recipe in the main manifest file. Also if the recipe already has a unbounded reference, it will be added in the BindingRecipe recipe.

Configurable Attributes Support: You can define in the designer view all your configurable attributes in any element that support it, like actions, valueproviders, etc.

We're working on the next release of Software Factories Toolkit, your comments, suggestions and bug reports are welcome. You can give your feedback through SFT Forums.
http://softwarefactoriestoolkit.net/forums.aspx

Download Software Factories Toolkit Here.


The Software Factories Toolkit June CTP is finally out and the key improvements in this release are:

- Recipe Designer with a redesigned user experiencie and round tripping support, so it could uses the .xml recipe files as is.

- T4 Templates Editor, an useful editor with colorizing, intellisense and support to preview transformation in design time.

- Multi package setup wizard, a recipe which generate a wix setup project with all the package contained in a solution. The most interesting thing here, is that you don't have to create differente setup project for each of your package any more. Now you can create a unified wix project, which could contain two or more guidance package and dsl tools packages. Get more information about this new feature in the Adrian's Blog.

del.icio.us Tags:

- Dsl Recipe Binder, now you can specify bindings to recipes just doing a right click on your dsl designer surface and choossing a reference where the recipes will apply.

You can check the Victor's blog, there you will find an overview of the new features included in this drop.

You can get the latest SFT version here.


Thursday, May 03, 2007 #


Download Sample Package


I guess that there are not a best approach to do the tests without a built in support in the T4 template host. Nevertheless in the Web Service Software Factory we did a very first approach of how you could write test units for t4 templates.

Suppose that we have a template which the output is a simple class, in the following example I did a simple package which contains a T4 template called Programs.cs.t4 so, the idea is, run the transformation and then try to compile the class to get its Type in order to make asserts using reflection.

In the attached sample fixture it has an ExecuteTemplate helper method which has the logic to run the transformation and then try to compile it. (considering that the output is a .cs class, if not, it could return an XmlDocument in case that the transformation results in an xml file).



In the next picture you've the TestMethod which runs the transformation, gets the returned type and then perform different asserts over it.


Notice that you should have created a link to the T4 template file and set the *Copy to Output* property as "Copy if newer" as showing in the following image, this is an important thing because the TestMethod is marked with the DeploymentItemAttribute in order to have the t4 file in the test context. Also you have to reference the Microsoft.Practices.RecipeFramework.VisualStudio.Library and Microsoft.VisualStudio.TextTemplating assemblies which are located in the PublicAssemblies folder.




Download Sample Package

Wednesday, March 21, 2007 #

Finally the new February CTP of the ClariuS Software Factory Toolkit is out and you can download now, from here.

This version includes several new features and some of the key features are the follow:

Different Guidance Package Templates, what this means? now when you go to create a new Guidance Package using SFT you will have the possibility to choose a basic template considering if you want to use just a single file or different files per recipe (using xinclude) to use in that guidance package. Also you will can define a default welcome page, guidance navigator overview and other interesting thing is that you will be able to choose what kind of installer you want to add to the package, that's it a wix setup project or the default Vs setup project.

 

 

Manifest Type Validator,  the types that you place in the manifest could have typos but, usually you discover those errors just in runtime when you're running one of the recipes in your package and it fails. Using the manifest type validator you'll get an error in desgin time for any invalid type in the manifest. The manifest validation is launched with the package registration and you can also disable the validation through the SFT Settings Page.

 

Recipe Designer, although is on an experimental stage, maybe is one of the most interesting features. Basically it's a Recipe Editor made with the DSL tools, which able you to design a recipe in a graphical way. With that, you can drag Actions, Arguments, Page, Value Providers and any recipe element to the designer in a really easy way, also you have a helpful type browser per element that searches all available asset types in the package. When you have done the recipe, you just have to invoke the Generate Recipe command and it serialize the recipe including the recipe chunk in the main manifest file and also including the action at the binding recipe when the designed recipe was set as unbound.

 


Recipe Designer, click in the image to enlarge...


Recipe Designer Type Chooser, click on the image to enlarge...

 

Recipe Binder, provides guidance that will able you to bind any recipe to any host element (in this version applied for Dsl and Vs Designers references). What this means? For example imagine that you're developing a DSL and also you have your own Guidance Package which have a recipe Foo, and you want to launch that recipe when the user do a right click on a certain Shape of your DSL or simpling in designer surface so, the recipe binder simplify all these steps that you can do in just one click.

 
Recipe Binder Wizard, click on the image to enlarge...

 

In addition you will find a lot of assets contained in the SFT Library like Actions, References, Value Providers, Type Editors and much, much more.

 

SFT Home Page: http://softwarefactoriestoolkit.net/

Support: http://softwarefactoriestoolkit.net/support.aspx

Download: http://softwarefactoriestoolkit.net/downloads.aspx


Friday, March 16, 2007 #

Some weeks delayed but is finally out!, this new Febrary 2007 CTP basically has support for Vista and includes another minor bug fixes. The most relevant bug fixes are the follow:

  • Support for Windows Vista
  • Guidance Navigator performance and display improvements
  • Handling of read-only .gpstate files
  • Use of standard system colors in wizards and dialogs
  • Fixes to registration recipes

Tom has published a detailed description of this new release here.

Download the new GAX Feb 2007 CTP here.


Tuesday, March 13, 2007 #

Quite a while ago I ran into the issue where I couldn't remove code snippets from VS. It seems that is not enough (using the hard way) with removing the registry key (that's it: HKLM\Software\Microsoft\VisualStudio\8.0\Languages\CodeExpansions\CSharp\[PathToYourSnippet]) and the proper snippet file.

To do that you should also remove the snippet from the ExpansionsXML.xml file. If you're using XP you will find this file here:

c:\documents and settings\[YOUR USER]\Local Settings\Application Data\Microsoft\VisualStudio\8.0\1033

Although if you're running on vista, you will find it here:

C:\Users\[YOUR USER]\AppData\Local\Microsoft\VisualStudio\8.0\1033

Unafortunately I sent this bug to product feedback but they close the bug.

Another thread where the issue is discussed:

http://forums.microsoft.com/MSDN/ShowPost.aspx?Pos...


Wednesday, March 07, 2007 #

It's avalaible at Visual Studio 2005 SP1 Update for Windows Vista. It includes a lot of bug fixes related with the debugging, profiling and also with web projects using IIS.


Sunday, February 25, 2007 #

There are an easily way to change the position, size and order of the swimlane shapes in your dsl. To do that, you just have to create a partial class of the swimlane that you want to modify its boundary and then override its BoundRules property, like this:

Also you must create the BoundRules custom class and override the GetCompliantBounds method which returns the rectangle in which the swimlane will be painted. This method receives the shape and the proposed rectangle, with those values you can alter any of that as you wish.

Specifying the rectangle you be able to change the location X,Y and also the size of that swimlane.

Enjoy.


Thursday, January 11, 2007 #

Aaron Skonnard published an article on MSDN Magazine in which gives an overview about the WSSF version 2 and all the related things of this version. You can check the post here.

Aaron also published on this past december and another article about WSSF V1 (ASMX) here.

http://msdn.microsoft.com/msdnmag/issues/07/02/Ser...


Wednesday, January 10, 2007 #

I'm glad to announce that after several months of work the Web Service Factory is finally out. This version includes:

  • Designing ASMX and WCF messages and service interfaces.
  • Applying exception shielding and exception handling.
  • Designing business entities in the domain model.
  • Translating messages to and from business entities.
  • Designing, building, and invoking the data access layer.
  • Validating the conformance of service implementation, configuration, and security using code analysis.
  • Planning for the migration to WCF.
  • Applying security to WCF services.
  • Applying message validation.

Donwload: Web Service Software Factory–December 2006 (ASP.NET and WCF services in C#)

Hands-On Lab: Web Service Software Factory Hands-on Lab

Also we ship the ASP.NET VB version for the latest July 2006 release, check here: Web Service Software Factory–July 2006 (ASP.NET services in VB.NET)


Monday, January 08, 2007 #

 Victor have tagged me, so.. here my 5 personal things...

- First, the classic... my first computer was a Texas Instruments 99 which had a *very* big floppy disk reader. I remember that it had a very big cable between the keyboard and the reader. Also I had another computers like Spectrum and the Commodore 64 until that in 1989 when my father bought me first PC. I started programing in Basic :P and continue with Clipper and C++.

- I worked in different things like book seller for two years, graphics designer and disk jockey (yes DJ, without comments pls).

- I like the dogs so, I have two Doberman and one of my hobbies is to train them on different things. They names are "Pedro" and "Diana"

- I have a sail boat which has a 29 feet. Few years ago I was sailing a lot of time with my father and friends. We made a lot of trips in the Argentine Sea (Brasil, Uruguay, Mar del Plata, etc). Unfortunately actually, I haven't to much time to do that.

- I have a daughter, she is 7 years old. I'm married with Raisa and we're waiting a son *Lucas* :)


  

Thursday, November 09, 2006 #

It's available to download at http://www.winfx.com And it's include Windows Workflow Foundation, Windows Communication Foundation and Windows Presentation Foundation. enjoy it.