Posts mit dem Label UML werden angezeigt. Alle Posts anzeigen
Posts mit dem Label UML werden angezeigt. Alle Posts anzeigen

Sonntag, 11. April 2010

jSonde – Generate a UML Sequence Diagram

The eclipse TPTP profiler has a very cool feature, create a UML sequence diagram from a profiling session. But the problem the TPTP profiling agent doesn’t run on my MacBook. So I looked for other free tools and I found jSonde an open source Java profiler (GPL).

jSonde can be used to generate a UML sequence diagram from a java application by profiling the app e.g. this can be used to document the actual implementation of a use case. How a this can be done, I will show step by step here in this post:

Step 1.) Get jSonde from http://www.jsonde.com/

Step 2.) Create a JUnit test case for the use case / function which you want to document, or when you do TDD look for an existing test...

Here the example code of my test:

@Test
 public void testPurchase() {

  Seller sellerOne = kasse.getSeller(100);
  Seller sellerTwo = kasse.getSeller(101);

  Position hose = new Position();
  hose.setDescription("Hose");
  hose.setPrice(2150);
  hose.setSeller(sellerOne);

  Position kleid = new Position();
  kleid.setDescription("Kleid");
  kleid.setPrice(2150);
  kleid.setSeller(sellerTwo);

  Sale sale = new Sale();
  sale.addPosition(hose);
  sale.addPosition(kleid);

  kasse.purchase(sale);  
 
}

Step 3.) Run the test e.g. in eclipse (or in other IDE) with the follow VM parameter: “-javaagent${JSONE_PATH}/lib/jsonde.agent-1.0.0.beta7.jar=60001”





Step 4.) Start jSonde and click File -> New Project



Step 5.) Enter a project name and the namespace of the application then click Connect


Step 6.) After the test is pass, click sequence diagram and select the test method in the tree view



Here the full UML sequence diagram for the "Purchase" test implementation:



Links:

Samstag, 16. Januar 2010

Painting by Hand with Bamboo

I played around with BAMBOO, I tryed to draw a class diagram by hand. The idea to have a alternative to a Flip Chart in a meeting or workshop. But I think drawing on paper is much faster :-( ...

Here my first drawing with ArtRage (Demo Version) and Bamboo:

Do not Paint Work with Textual DSL instead

A better option can be to use a DSL instead of hand drawing stuff, e.g. in a brainstorming meeting. Here a example DSL for the picture bellow made with yUML:

[Seller]+1-0..*[Position]
[Sale]+->1..*[Position]
[Position]->1[PositionKey]

[Seller Repository]->[Seller]
[Position Repository]->[Position]
[Sale Service]->[Sale]

[Basar Kasse Service]->[Seller Repository]
[Basar Kasse Service]->[Position Repository]
[Basar Kasse Service]->[Sale Service]

And here the diagramm made by yUML from the DSL:


But I will work on my drawing skills, with BAMBOO, so maybe it will be come a alternative for me to get things fast on a screen ...

Links:
- yUML - http://yuml.me
- ArtRage - http://www.artrage.com/
- BAMBOO - http://www.wacom.eu/

Dienstag, 24. November 2009

yUML - cool UML tool

yUML is a web based small UML tool and it makes a lot of fun to create diagrams with it, here my first use case example diagram made with yUML

No real use cases only a diagram for test yUML...

Links: