Showing posts with label UML. Show all posts
Showing posts with label UML. Show all posts

Saturday, May 05, 2012

There's a Kanga in my Model... Using KangaModel to easily and painlessly create,share and display sequence diagrams

George Mamaladze - Tiny UML Sequence Diagram Markup Language for Agile Developer Documentation


What is a GOOD documentation?
That’s why it’s important having a good documentation. A good documentation must:

  1. … cover only aspects which can not be easily derived from code, interface or intellisense. Duplication is waste.
  2. … be easy to maintain. Wiki like public knowledge repositories or Q&A platforms like Stackoverflow are good examples. They are easy to edit – if you see and outdated or wrong post, go ahead and fix it!
  3. … be about problem solving, not restating the facts.


To get to the point – the central message of this post is that one diagram tells you more than 100 auto generated documentation pages.

For instance a class diagram showing inheritance hierarchy and relationships between classes could be a great help to get an overview about available functionality and make right choice. (See an example with Stream above). To win the same information from code you will probably need hours of jumping and navigating.

A sequence diagram is another brilliant sample. Due to many indirections, wrapping, tiny classes and methods (which are very good!) it is often not too easy to read a call stack. Sometimes you are looking at a huge call stack trying to understand what’s really going on. What you wish is a high level view on major players in some particular scenario and the way they interact, talk to each other. Having a sequence in such a moment is a great help.

Diagrams are also documentation. Well we’ve discovered that they are necessary, because they cover aspects which can not be really easy read out of code. So point 1 from our 3 is satisfied. But what about maintainability?


Maintainability overhead is probably the reason why open source projects having excellent wiki-s are using diagrams so rarely.

The Solution

The solution is as simple as elegant. It comes initially from authors of The main idea is to generate the diagram from a lightweight markup textual diagram description language. As an example following code


We are gone even one step further. Our open source project KangaModeling at provides a web server application which generates diagrams on the fly. So you can include sequence diagrams in your Wiki articles, blog posts or web sites with just several lines of markup.


What is KangaModeling?

KangaModeling allows you to produce UML (like) diagrams very easily.
The main idea is to generate the diagram from a lightweight markup textual diagram description language.


Key Features

  • No mouse kicking - KangaModeling is made for those who think that full-fledged modeling tools are overdesigned for visualizing communication and relations between software components.
  • Always up to date - if you use a diagram in wiki or blog it is often additional overhead to open a modeling tool, update the diagram, export to image and upload it back.
  • That's why we provide a web service which will produce diagram image from markup in your blog on the fly. You can use our web service at
  • Alternatively if you are looking for an intranet solution - you are welcome to download our ASP.NET web application and host it yourself (for free).


".. is a web service which generates and returns a diagram image based on code snippet you posted to the URL using POST or GET.


You can use it in your Blog,Wiki or Website to generate nice looking diagrams from compact markup.

Placing the code

Place your markup code on the page and surround it with <pre> tag. Set class attribute to




This project came across my desk yesterday (Thanks George!) and the more I look at it the more I think it's pretty neat. There's a number of cool things here. The dev in me digs that the source for all this is available and cries out to me to check out how the parsing and diagramming is done. The manager in me likes the idea of how simple this is to get started with and how quickly sequence diagrams can be created all without expensive tools. The doc guy in my head likes that the images are dynamic and easy to keep up to date and how easy they are to share on a web site.

If you've thought Sequence diagrams hard or too much of pain to keep up for your project, you should check out KangaModeling...

Tuesday, January 31, 2012

Get the Gang of Four in your Visual Studio... At least as UML Toolbox items...

Microsoft Visual Studio UK Team - Visual Studio 2010 UML Design Pattern Toolbox Items Extension

"I presented at the Black Marble Architecture Forum in the North event in December and one of the things I showed was how to create a toolbox item extension to add a UML design pattern into Visual Studio’s UML toolbox. Having done this I checked and couldn’t find any extensions that covered the Gang of Four design patterns, so I thought I’d create an extension to do just that. Let’s start at the end with where to download them and what they give you…

What do you get?

The toolbox items extension gives you some extra toolbox items that cover the majority of the core Gang of Four design patterns. Once installed, if you open a UML class diagram you should see the following additions under Structural, Creational and Behavioural (yes, British spelling) Patterns:


Then open or create a UML modeling project and once you have a class diagram you should see the new toolbox items.


I’ve added the Visual Studio solutions that I created this extension from to Codeplex here. You can download the solutions, take a look at the projects and update/improve/extend/adapt the toolbox items to suit your needs.

How do you build this?

Take a look at the Codeplex project if you want to download the full solutions but as an overview this is essentially simple. It breaks down into 4 key aspects:

UML Profile

I wanted to create a UML profile in order to define the stereotypes that I would use in the design patterns. As an example I wanted to have <<Singleton>> stereotype so that any class that you wanted to implement the Singleton pattern could be identified as such without having to rely on naming conventions, and the name can be independent of the stereotype. A secondary reason is that if I wanted to generate code from the design patterns this would allow the T4 templates to generate the appropriate code for the specified stereotype. I haven’t got round to this part but using a profile means that this will be possible in the future.

The documentation on creating a custom profile is here. This is what I followed but a summary is:



Why is this cool? Because not only do we get a pretty cool package of UML toolbox items, but we get the source AND a walkthrough for how they were created! That's cool...

NOTE: If I remember right, you'll need Visual Studio 2010 Ultimate to use these (since UML projects can only be created/authored/edited in that SKU)

Monday, October 18, 2010

Visual Studio 2010 UML doesn’t support State models. This extension does (add State Models to Visual Studio that is)…

Visual Studio Gallery - StatePatternModeler

“This extension provides a project template to create a State Model. It also provides an item template that lets you generate code from that State Model. …

Check out these two tutorial videos that I did to demonstrate the extension:

How to use the Templates:

How to use the UML Modeling:


Not having State Models in VS 2010 is a sore point for some. Well now, with this Extension, we can “State” to heart’s content… :)

Wednesday, September 29, 2010

Spec Explorer Graduates from DevLabs to the Visual Studio Gallery - Spec Explorer 2010 Power Tool Released (aka Spec Explorer v3.3)

Visual Studio Gallery - Spec Explorer 2010 Visual Studio Power Tool

“Spec Explorer 2010 release 3.3 is now available! This release has new features and revisions. The home page has migrated from DevLabs to VS Gallery where Spec Explorer 2010 is now a Power Tool.

Features & Benefits

Spec Explorer 2010 is a tool that extends Visual Studio for modeling software behavior, analyzing that behavior by graphical visualization, model checking, and generating standalone test code from models. Behavior is modeled in two ways: by writing rules in C# (with dynamic data-defined state spaces) and by defining model scenarios as action patterns in a regular-expression style.

One of Spec Explorer’s major features is the ability to compose models written in these two styles …


Spec Explorer 2010 Release Notes

“Version 3.3
September 27st , 2010
For Spec Explorer 3.3.2796.0


Spec Explorer is an extension of Visual Studio® for creating models of software behavior, analyzing them, and generating and driving model-based tests.  Please read these release notes carefully before using this release.

What’s New in Spec Explorer 2010 Release 3.3

The following new features are provided in this release:

· Probe logging

· On-The-Fly (OTF) testing

· Test method customization

· State search

See the Overview section for more details.

A UML Spec Explorer extension is also being released at this time, but it is not included in the Spec Explorer MSI and must be downloaded separately. Documentation for the UML extension can be found here.

Please note that Spec Explorer 2010 Release 3.3 runs only on Visual Studio 2010. It does not work Visual Studio 2008. Please see notes in the Installation section of this document..

Additional details of these changes and other feature enhancement can be found below in the section entitled Overview of New and Enhanced Features. …”

Visual Studio Gallery - UML Extension For Spec Explorer 2010

“The UML Extension for Spec Explorer 2010 is a Spec Explorer extension for leveraging the UML modeling capabilities of Visual Studio to test from graphical models in addition to textual ones. The current version of the extension allows the use of Sequence Diagrams, which define artifacts similar to Cord scenarios in Spec Explorer.

Users can either use sequence diagrams to slice an existing model or as a stand-alone source to verify an existing system. Users must install Spec Explorer 2010to use this extension.” [GD: Description Leached in Full]

I like the idea of tools that help make my tools easer to test (man, I’m such a tool… Oh, did I say that out loud? ;)

Note that Spec Explorer requires “At least the Professional edition of Microsoft Visual Studio® 2010”


Related Past Post XRef:
Spec Explorer 1.0 – A “Visual tool for modeling software behavior and generating test suites from those models”

Tuesday, August 24, 2010

“Getting Started with UML” DZone Refcard

DZone Refcardz - Getting Started with UML

“The Unified Modeling Language is a set of rules and notations for the specification of a software system, managed and created by the Object Management Group. This DZone Refcard outlines the key elements of UML to provide you with a useful reference when designing software.


With VS2010 Ultimate’s UML support, I’m finding myself, “feeling the need to UML…” I mean, since I’ve already got it I might as well see how I can best use it, right?

Here’s a snap of the PDF.



Related Past Post XRef:
Nine UML’s from a Niner on Nine - Nine using UML with Visual Studio 2010 videos on Channel 9
“Practical UML™: A Hands-On Introduction for Developers” from the Embarcadero Developer Network

Friday, July 30, 2010

Nine UML’s from a Niner on Nine - Nine using UML with Visual Studio 2010 videos on Channel 9

Visual Studio Visualization and Modeling Tools – Team - Channel 9 video series: UML with VS2010

Clint Edmonson, an Architect Evangelist at Microsoft, has posted a series of videos that show how to use the Visual Studio 2010 Ultimate visualization and modeling tools in your software development process:

Clint Edmonson - UML with VS 2010 Part 1: Brainstorming a Project

“In this screencast, Clint Edmonson presents an overview of using a UML use case diagram to brainstorm the scope and features of an application.


If you’ve got Visual Studio Ultimate, you’ve got UML… Might as well see if you can use it to help.

(via C l e m e n s - Channel 9 video series: UML with VS2010)

Monday, June 07, 2010

Visual Studio [Ultimate] 2010 Visualization & Modeling Feature Pack RTM now available on MSDN Subscribers Download


“The Visual Studio 2010 Visualization & Modeling Feature Pack expands the scenarios for exploring and understanding your code. Extend the capabilities of the visualization and modeling tools in Visual Studio 2010 Ultimate… “

Feature Packs are like Power Tools in that they are being released “out of cycle” from Visual Studio, but different in that they are “official” and supported. If you can remember back when, think “NT4 Option Pack”. Per Jason Zander, “Feature Packs are a new concept we are introducing with VS2010.  Like Power Tools these releases are designed to run on top of the existing core bits (no modifications allowed) using extensibility.  Unlike Power Tools, Feature Packs are ideas we fully intend to incorporate into the core product in the future (consider it a head start on v-next).  Because of this a Feature Pack is of higher quality:  localized, fully tested, and formally supported.  Feature Packs are available through your MSDN subscription”

For more information about this Feature Pack, please see;

Jason Zander's WebLog - Announcing: VS2010 Productivity Power Tools and Modeling Feature Packs


Visualization and Modeling Feature Pack

The modeling feature pack provides increased support for visualization (web sites as well as C/C++ code), new UML support, and increased support for layer diagram extensibility to Visual Studio Ultimate 2010.  Cameron Skinner did a great job giving a sneak peak of the feature pack here.  Let me highlight a few items here as well.

Web Site Visualization

Hopefully you have already discovered the power of DGML and architectural dependency graphs for your .NET code (read more about it here). In this release we’ve added support for the structure of your web sites. …

C/C++ (Native Code) Visualization Support

The VS2010 RTM product supports the .NET Framework (versions 1.1 –> 4).  I have received many requests for C/C++ support as well which is now included in this release. …

UML Class Diagram Code Generation

VS Ultimate 2010 added support for the most popular UML diagram types including Class Diagrams.  This release also adds the ability to generate code from your UML diagram targeting the correct T4 template.  Here is a sample class diagram for customers with orders: …

Creating UML Class Diagram from Code

Generating code from a diagram is great when you start with your model.  But often you already have an existing project without diagrams.  With the feature pack you can drag namespaces from the Architecture Explorer to a UML diagram: …

XMI Import

This release enables XMI 2.1 import which makes it easier to bring UML compliant documents into Visual Studio.  For now you will only be able to important documents targeting the subset we support.  You should expect us to add more document types in future releases of the product. …

featurepack …”

Friday, June 04, 2010

“Getting Started with Extending Visual Studio” page now available on the MSDN Visual Studio Dev Center

MSDN Visual Studio Dev Center - Getting Started with Extending Visual Studio

“Learn how to customize and extend Visual Studio to automate tasks or add features.

Introduction to Automation and IDE Extensibility

Learn how to programmatically automate repetitive tasks, extend Visual Studio with tools such as add-ins and wizards, and create packages and Visual Studio applications using the Visual Studio SDK.

Project System

Learn how to write your own Project System as well as how to extend the existing Project Systems in Visual Studio.


Learn how to extend the Visual Studio 2010 fully interactive source debugger.


Written in managed code, and implemented using the Windows Presentation Foundation. You can extend editor features by using the Managed Extensibility Framework. Learn the various ways in which you can customize and extend the Editor.

User Interface

Learn how VSPackages influence the appearance of user interface (UI) elements in the Visual Studio integrated development environment (IDE), how to create UI that closely resembles the Visual Studio IDE, and how to program UI elements in the IDE.

Help Authoring and Integration

Learn how to use tools to produce Visual Studio 2010 compatible help content.

UML and DSL Tools

Learn how to build graphical models to generate code.

Visual Studio Shell

Learn how to create a custom tool that has its own integrated development environment (IDE). The Visual Studio Shell provides a hierarchal project system, integration with editors and designers, source code control, and a familiar user interface that may reduce the learning curve for end users.

Team Foundation Server Extensibility in Visual Studio

Learn how to customize and extend Team Foundation Server to meet your specific needs.

image …”

Lot’s of cool links… one tiny page…

(via IHateSpaghetti {code} - Getting Started with Extending Visual Studio)


Related Past Post XRef:
Extending VS2010 – SDK is out, Scott Hanselman chats about it and there’s a good number of samples already on the Visual Studio Gallery
What’s New in Visual Studio 2010 & .Net 4 – The Official MSDN Source
Visual Studio 2010 and .NET Framework 4 Training Kit – February Release (aka the VS2010 RC Compatible release) – We’re talking 602MB of VS/.Net training stuff here…
UML, T4 and Visual Studio 2010, Oh my…
Feature Builder Power Tool Preview updated for VS2010 RTM – Think “Extension to help build Extensions,” or “Power Tool for Power Tools…”

Monday, January 18, 2010

UML, T4 and Visual Studio 2010, Oh my…

Oleg SychUML Modeling and Code Generation in Visual Studio 2010

“This article provides an overview of UML modeling in Visual Studio 2010. Assuming that reader is already familiar with UML, it focuses on custom UML profiles - an extensibility mechanism that can be used to tailor UML models to a particular problem domain. Readers will see an example of such a profile, which extends UML Class Diagrams for database modeling. Finally, the article shows how code can be generated from UML models using T4 text templates.

UML Modeling in Visual Studio

Visual Studio 2010 Ultimate Edition includes a fully-featured UML (Unified Modeling Language) support, integrated into the IDE. You can create Use Case diagrams to summarize who uses your application or system, and what they can do with it, Class diagrams to describe logical aspects of data types and their relationships, Sequence diagrams to display interaction between classes, components and actors, Activity diagrams to document flow of an algorithm or a business process and Component diagrams to show structure of a system, and how it can be deployed to a logical environment.


As you can see, Visual Studio 2010 Ultimate Edition provides powerful UML modeling tools that can be used for conceptual and logical analysis during software development. UML Profiles can be used to extend standard models and allow modeling information systems at physical level. A limited number of UML profiles is expected to ship with Visual Studio 2010. Custom profiles can be developed to tailor UML models to the needs of individual projects. Combined with T4 Text Templates, this gives developers a powerful tools for model-driven development of information systems, where large portions of the system can be modeled in UML and generated with T4. 



I thought this was a great article on the UML support coming in Visual Studio 2010 Ultimate… I appreciated the compare and contrast with the existing DSL diagramming (i.e. why we should be happy and how this support is going to make our dev lives better)


Related Past Post XRef:
“Practical UML™: A Hands-On Introduction for Developers” from the Embarcadero Developer Network

Monday, May 18, 2009

“Practical UML™: A Hands-On Introduction for Developers” from the Embarcadero Developer Network

edn (Embarcadero Developer Network) - Practical UML™: A Hands-On Introduction for Developers

“Abstract: This tutorial provides a quick introduction to the Unified Modeling Language™

The heart of object-oriented problem solving is the construction of a model. The model abstracts the essential details of the underlying problem from its usually complicated real world. Several modeling tools are wrapped under the heading of the UML™, which stands for Unified Modeling Language™. The purpose of this course is to present important highlights of the UML.

At the center of the UML are its nine kinds of modeling diagrams, which we describe here.

  • Use case diagrams
  • Class diagrams
  • Object diagrams
  • Sequence diagrams
  • Collaboration diagrams
  • Statechart diagrams
  • Activity diagrams
  • Component diagrams
  • Deployment diagrams

Some of the sections of this course contain links to pages with more detailed information. And every section has short questions. Use them to test your understanding of the section topic.

Divider line

Why is UML important?

Let's look at this question from the point of view of the construction trade. Architects design buildings. Builders use the designs to create buildings. The more complicated the building, the more critical the communication between architect and builder. Blueprints are the standard graphical language that both architects and builders must learn as part of their trade.


With UML support coming in VSTS2010 I thought it might be a good time for a review…

(via Bite my bytes - Links of the week #80)