Bob Lee: Generating sequence diagrams with aspects

Discussions

News: Bob Lee: Generating sequence diagrams with aspects

  1. Bob Lee, in "Generating Sequence Diagrams Using AspectJ," documents a process that uses two AOP frameworks (AspectJ and dynaop) as well as SEQUENCE, Alex Moffat's sequence diagram generator, to generate a sequence diagram.

    The results are amusing and enlightening, as many of the sequence points get ignored by sequence generators (for example, it includes all calls and constructors, which generates a busy sequence diagram.)

    What do you think? Would you use aspects like this in your development?
  2. Yes![ Go to top ]

    Definitely. If it is that easy to generate them, why not? I have found sequence diagrams to work well when I need to get some code across to new developers.
  3. Ah....the idea I once had[ Go to top ]

    We actually did this before AOP hit the fan with jboss using a custom interceptor. By using an mbean configuration we could start/stop the logging of invocations, and then populate an xml document as input to an open java sequence generator. It worked very nicely - it even had a separate function for transaction monitoring - visual representation of the hierarchy of transactions generated for a certain business function.

    Needed some polishing, but it was already there over one and a half year ago.

    http://www.conduct.no/pub/screenshot_analyzer.png
  4. Ah....the idea I once had[ Go to top ]

    Needed some polishing, but it was already there over one and a half year ago.

    That's cool, but like I said in the entry, this is a rewrite of a demo I released almost three years ago. ;)
  5. Its sure is a improvement over using Aspects only for logging !!
  6. Did Bob forget that he already did this 3 years ago with his own aop framework? :-)
  7. Did Bob forget that he already did this 3 years ago with his own aop framework? :-)

    Ha ha. From the article:
    Over the past couple weeks a few people have inquired about a demo I wrote a few years ago named jAdvise SEQUENCE. It combined my old AOP framework with SEQUENCE, Alex Moffat's sequence diagram generator. In the demo, a simple method interceptor generated a SEQUENCE data file. The idea is you need runtime information to generate complete sequence diagrams. Rather than perpetuate retired code, I've implemented a more robust version using AspectJ.
  8. Did Bob forget that he already did this 3 years ago with his own aop framework? :-)
    Ha ha. From the article:
    Over the past couple weeks a few people have inquired about a demo I wrote a few years ago named jAdvise SEQUENCE. It combined my old AOP framework with SEQUENCE, Alex Moffat's sequence diagram generator. In the demo, a simple method interceptor generated a SEQUENCE data file. The idea is you need runtime information to generate complete sequence diagrams. Rather than perpetuate retired code, I've implemented a more robust version using AspectJ.

    Darn, my caching interceptor totally failed, which made me skip reading the article. Force.Refresh.Now. :)
  9. It is an awesome piece of work.

    We showed a demo of a version we did for the JRockit AOP at JavaOne this year (e.g. VM support for Bob's work).

    All jaws dropped, people were drooling over it. It was the main attraction at the BEA booth.

    Good job Bob. :-)
  10. It is an awesome piece of work.We showed a demo of a version we did for the JRockit AOP at JavaOne this year (e.g. VM support for Bob's work).All jaws dropped, people were drooling over it. It was the main attraction at the BEA booth. Good job Bob. :-)

    Thanks. Alex did the hard work though. ;)
  11. This with dynamic AOP is indeed quite cool, as f.e. using JRockit AOP ones can at no cost drill down in a live WebLogic server and understand how the request handling is happening - something way beyond the usual thread dump techniques.

    Mixing the sequence diagram with AOP was an awesome idea you should patent Bob !, and obviously it survives the hype cycles, AOP landscape evolution etc. This demo illustrates non intrusiveness and obvliousness, but suffers a bit from the fact that it does not illustrates the underlying AO reasoning and gained modularity.
  12. Hi Alex,

    I hate to be the party pooper but reverse engineering of the call sequence and turning that into a UML sequence diagram has already been done in many tools that use AOP and Interceptors. In fact this has been done for calls across servers. Admittedly the rendering has differed slighty across tools with each one calling it a new revolution in visualization. RetroVue? which has been around a very long time provided this via its journaling/debug system. Sequencing has also be done for distributed component systems such as CORBA.

    JRockit AOP does offer the potential to build extremely cool (and hopefully) useful tools for both development, testing and production phases with very little overhead. We have internally some pretty nice demos but they are not yet ready for viewing.

    Transaction history sequencing via interceptions (JDBInsight 2.1 a long time ago):
    http://www.jinspired.com/products/jdbinsight/whatsnew.html

    JXInsight can even generate a UML sequence diagram for database table/column access.

    Regards,

    William Louth
    JXInsight Product Architect
    JInspired

    "J2EE tuning, testing and tracing with JXInsight"
    http://www.jinspired.com
  13. That's valuable info William
    I think the success of Bob Lee' (and Alex Moffat) work stands in its simplicity - as I think it is one aspect (no matter the framework) and around ten swing classes. For real world, there is indeed a high need for much more advanced system to be able to find the useful information in the possibly huge amount of what gets reported.
  14. I think the success of Bob Lee' (and Alex Moffat) work stands in its simplicity - as I think it is one aspect (no matter the framework) and around ten swing classes. For real world, there is indeed a high need for much more advanced system to be able to find the useful information in the possibly huge amount of what gets reported.
    Indeed Bob's hat trick is just a glimpse of how tracing could enable UML as an environment for postmortem investigation. If runtime history is recorded akin to omnicient debugging (at least on the classes or instances of interest), then UML's rich set of static and dynamic diagrams could be animated forward or backward in time. Different diagram types could be shown side by side and animated in tandem. Imagine diagnosing a concurrency bug via postmortem single-stepped replay of any combination of dynamic diagrams (state machine, sequence, timing, communication, activity, or interaction overview diagram). Failed orchestration could be reviewed more abstractly, with less semantic distraction, and less cognitive load than ever before. Not only would debugging involve less strain, it might even be de-skilled.
  15. Quite useful[ Go to top ]

    When Bob did that last time using jAdvise, I got interested in it as way of understanding some of the old code. With jAdvise there were some issues so I ported it to use AspectWerkz at that time and added some filtering option to the UI to zero in on certain packages. It turned out to be quite useful.

    Fun stuff.