Monday, December 7, 2009

Component definition changes from UML 1.x to UML 2.0




Component diagram is used to show how the components of a systems are structurally related to each other. There has been a change in the notation of a component in UML 1.1 as compared to UML 2.0. In UML 1.1, files, DLLs, Jar files etc were also treated as components. This, in a way, was a little confusing as the original idea of a component was something that encapsulates a behavior and has a well defined interface. In UML 2.0, the definition of a component has become more clearer and sharper. In UML 2.0, they are strictly logical and design-time only constructs.

Wednesday, July 29, 2009

class diagrams showing packages

While describing the overall design, it is a very good idea to describe the code structure and the inter-dependency of source code. We can use Class Diagrams to describe package structure and the dependecy of packages onto one another.

Friday, July 17, 2009

Architecture Discovery

Visual Studio Team Architect Edition 2010 is coming up with Architecture Discovery feature for .NET classes/namespaces/assemblies. This features is quite the same as that of Rational Software Architect (RSA) for Java objects. This would further reduce the role of RSA in .NET code generation/engineering. Going forward that would hardly be any takers for Rational UML tools for .NET modeling/engineering. Visual Studio Team Editions would provide complete experience for Architects, developers and project managers.

Monday, July 6, 2009

Why State Chart Diagram Diagrams ( State Machine Diagram in UML 2 )

So why do we need State Chart Diagrams. People often make good use of Sequence and class diagram as they are largely most popular diagrams that developer makes use of. State Chart Diagrams are very powerful diagrams when it comes to depicting LOGIC. So ask yourself this question - how can I depict business logic in UML. Well sequence diagram is certainly not the answer. Sequence diagrams are for representing control flow logic between objects and not business logic. State chart diagram should do a good job for representing business logic. Lets take an example. An account can exist in many states - 'under process of opening', normal, suspended , closed, 'not used for last 6 months', etc. What business, operation can be performed on a account depends on what state it is in. Consider using state chart diagrams for representing your business logic around account manipulation. Activity Diagram is also a good way of representing business logic. In most cases, a combination of 'Activity Diagram' and 'State Chart' diagram is good for depicting Business Logic.

Sunday, June 28, 2009

Generating Sequence Diagram from Code


Indian developers shows immense interests in Generating Sequence Diagram from Code. In fact, about 10 % of the total projects Indian System Integrators get are around Documentation generation from legacy code.

There are tools that help you to generate Sequence diagram from source code to a good extent but their scope is only that of a function. That does not help much from the prospective of understanding the user interaction. However, it can only be used to understand if a function has a big enough business logic or some complex algorithms.

What people are looking for is a way in which you can generate sequence diagram across tiers and that for a full end-to-end scenario or a use case. Basically they want to generate sequence diagram showing UI classes, Business Logic objects all the way down to stored procedures all in one sequence diagram. I am yet to come across a tool that does it well. In fact it not so easy to achieve this because in order to generate such a sequence diagram, the tool has to have an understanding of the underlying system architecture. There could be 100s of combinations of different MVC choices and, in fact, to make it further complex custom MVC frameworks that the code may be implementing.

One of the way a UML sequence diagram from the running code can be created for the entire use case is by running it in profiling mode. One need to make sure to filter out lots of unwanted classes in that otherwise a sequence diagram with enormous number of classes on one diagram would be useless. Ultimately, you are going to get an image in this case, and not the model. That too would not cover the stored procedure or other database objects.

Saturday, June 20, 2009

3 functionals of UML

When I talk to developers, a whole lot of them want UML for Code Model Synchronization. Well, UML can certainly help there but that’s not the only thing.

UML Models are primarily used for 3 purposes:

1. Visualization: When you start getting a graphical representation of what you have in mind, lots of new ideas come in. You start getting hints of using design patterns when you look at the UML diagrams. Once you have decided to use a design pattern in a given situation, again UML helps to implement it. UML also helps you to visualize anti patterns that are emerging in your designs.

2. Documentation/Collaboration: This is according to me the biggest use of UML among System Integrators. In a team, UML models helps a lot for Architect to communicate the designs to developers and so on..

3. Coding Generation/ Synching: It works too. Its mostly the Class diagrams that are synchronized during forward and reverse engineering process. There are different approaches for code-model synchronization that I will separately describe in my next posts.

Thursday, June 18, 2009

UML Modeling , Visio & Visual Studio 2008

People have been asking what is the story for UML Modeling with Visual Studio 2008. The way Visio used to be integrated with Visual Studio 2005, it does not work the same way with Visual Studio 2008.

You could simply use Visio for UML modeling stand alone. However, If you want to sync your UML models with Visual Studio 2008, currently you have to rely on third party tools such as SPARX Enterprise Architect. Thats works well and nicely integrated with Visual Stuido 2008. Also watch out for Visual Studio Architect Edition 2010 which has a good support for UML diagrams. Visual Studio Architect Editon 2010 is crrently in Beta and expected to release later this year.