Vitaly's WebLog
Software development, startups, marketing

TFS Workbench and MS Project

December 5, 2010

If you are practicing Scrum and use TFS for this you probably know there are several project templates exist for TFS and Scrum. There is a couple from MS and there is also quite popular 3-rd party template from http://scrumforteamsystem.com/ guys. Here is a comparison of these template (it is from a company that created one of the templates, so it may be biased).

We've used "MSF Agile v5" for some time and now trying "Scrum for Team System v3.0". This template comes with a tool called "TFS workbench" (ex "Scrum Masters Workbench"). Some may find this tool handy, but if you expect high level of quality as in MS products you will be disappointed. It is free product (at least yet). Anyway this topic not about this tool, although I use it in the post title as the name of template is too generic.

If you are using SfTS 3.0 you may find that tasks hierarchy is lost when you export your WIs to MS Project. To fix this you need to do the following:

1) CD to "C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\" 

2) Run "TFSFieldMapping download /collection:"http://YOURTFSSERVER:8080/tfs/YOURCOLLECTION" /teamproject:YOURPROJECT  /mappingfile:"c:/temp/MappingFile.xml""

3) Open c:/temp/MappingFile.xml and add the following line:

<HierarchyLinkType LinkType="Scrum.ImplementedBy" />

4) Run "TFSFieldMapping upload /collection:"http://YOURTFSSERVER:8080/tfs/YOURCOLLECTION" /teamproject:YOURPROJECT   /mappingfile:"c:/temp/MappingFile.xml""


Isolating UI from Middle Tier

October 20, 2008

 

One, if not the main, principle of the good architecture is its openness against 'possible' changes. It can be viewed on different abstraction levels - some classes can be open for some changes in business logic, entire layers may be designed to be open for global changes like switching to another DB engine. As OCP states, entities should be open for extension, but not for modification. This means that your architecture should support its extension in planned ways easily without changing much code (you should write new of course). That is why seasoned developer likes to use interfaces here and there :-) And that is what dependency injection is for...

It’s a good practice to build Data Access layer in a way it is not tied to specific database. So if you use SQL server and then decide to use Oracle, you need to write new Data Access classes specific to Oracle and do not need to rewrite entire system. 

I was surprised, but it turns out that you can isolate user interface logic for web project in the same way. 

There are many JavaScript libraries that allow you to build rich Ajax based UI that lives inside your browser. The only what is needed from middle tier is to return data in some simple format (JSON, XML). So you can plan your architecture for a possible change of middle tier (ASP.NET to JSP?) if you need to. A good example of rich UI JavaScript library is ExtJS. I recommend taking look at it if you did not do that yet.

 

 

 

 

 

 

 

 

 


.NET Framework Programming Model for Add-Ins

March 24, 2008

It seems that there is still lot to learn about .NET Framework 3.5. I've found today (thanks to Daniel Moth) that is one more interesting feature was added in .NET Framework - Programming Model for Add-Ins. Basically, it allows you to build application that can be extended by add-ins. You may say that it is not a great task to build your own model. Yes, it is easy to. To build simple model. But what this new programming model offers is a complete solution. There are the following services that you can leverage:

  • Independent Versioning. You may want your host app and add-ins to version independently.
  • Discovery and Activation services
  • Isolation Levels. You may want load your add-ins in separate application domain. Separate from a host app or in seperate app domain for each add-in. There are several levels of isolation you can choose from. 
  • Lifetime management. Because of the facility above (isolation Levels) you may be not able to rely on Garbage Collection. Fortunately, there are facilities to manage lifetime of objects in this programming model.

I would definitely recommend reading a bit about this on MSDN if you are building Smart Clients sometimes. There are also some good resources on Daniel's blog that will help you to start. By the way, Daniel calls this as Managed Add-ins Framework (Great name, except of usage of 'Framework' term, that is a bit overused already) Interesting, if that is official name of this feature (I did not find mentions of MAF in official docs)?

 


Great resource on design patterns and refactoring

February 4, 2008

I've stumbled upon a great web resource containing description of design patterns, antipatterns and refactoring techniques. It is easy to read, have good illustrations and intuitive navigation. I would advice visiting it.

Design patterns are described in GOF style and there are mainly (if not only) GOF patterns. So in case you haven't this great book on your shelf when you need it, you can go to this website and find info you need. In addition to design patterns there is good description of antipatterns and refactoring how-to’s.

Code examples on this site are in C++ and Java, but it should be easy to understand them if you are proficient in C# only.

I almost forgot to leave the URL :-) Here it is: http://sourcemaking.com/


How to make incremental DB update script in VS2008

January 20, 2008

One of the most tedious tasks in database-driven software development is to make database change scripts. You meet it just as you product version becomes higher than 1. You usually have to maintain create script that creates you DB from scratch and also change script(s) that will upgrade existing databases of previous version(s) to the latest one. And those databases most probably have customer data in them that you cannot damage.

In the latest release of Visual Studio there is new type of database projects that helps maintaining your database scripts significantly. I've already wrote review of new features, but such important topic as generation of change scripts in missing in that post, so I decided to write new post on it.

From the first sight it seems that VS can generate only create scripts, which it places in /sql folder by default. Hopefully, it also can generate change script, although this feature not so easy to discover. It can be found in database compare tool. It generates scripts based on differences between two databases (between schema that you have in DB project and some DB instance). It is not well automated, so you have to copy the script it generates, review it manually, and save in a file yourself.

Some manual changes may be need in script. One good example: if you have used rename wizard to rename column in some table you may expect that data that was in that column will be kept by a script. Unfortunately, this type of change is not handled well by VS 2008. Yes, there is warning in UI, but who reads those warnings :-)

 VSDBP_RenameWarning

There is option in project properties "Perform 'smart' column name matching when you add or rename a column". Here is what MSDN says about this option:

Specifies whether to apply a heuristic when you deploy updates to determine when to rename a column instead of performing a DROP and an ADD operation. The heuristic is based on the properties of the column and the names of the source and target columns.

I hoped that setting this option will fix the problem with column rename, but unfortunately this did not work for me. I tried renaming CategoryName -> NewCategoryName and CategoryName -> Category1. In both cases this did not work. Perhaps they need to provide more info on the heuristic they use...

There is also protection from data loss. You can control it by setting in project properties. Unfortunately, changing this setting did not work for me too.

VSDBP_SchemaUpdate

VSDBP_Properties

Anyway, this is undoubtedly a great feature. And should help maintaining incremental update scripts a lot.


.NET Framework Library Source Code now available

January 17, 2008

Scott Guthrie announced that source code of .NET Framework library is now available. You can drill down to code written by Microsoft when debugging your application in Visual Studio 2008. And you even see developers comments in source code :-)

Today I'm happy to announce that this is now available for everyone to use. Specifically, you can now browse and debug the source code for the following .NET Framework libraries:

  • .NET Base Class Libraries (including System, System.CodeDom, System.Collections, System.ComponentModel, System.Diagnostics, System.Drawing, System.Globalization, System.IO, System.Net, System.Reflection, System.Runtime, System.Security, System.Text, System.Threading, etc).
  • ASP.NET (System.Web, System.Web.Extensions)
  • Windows Forms (System.Windows.Forms)
  • Windows Presentation Foundation (System.Windows)
  • ADO.NET and XML (System.Data and System.Xml)


Here is sample code snippet. This is the beginning of HttpRuntime.ShutdownAppDomain method: