I2SD: Reverse engineering sequence diagrams from Enterprise JavaBeans with interceptors<br />SergueiRoubtsov <br />Alexand...
PAGE 1<br />Interceptors<br /><ul><li>Business method interceptor
when a method is called
Lifecycle callback interceptor
when an object is created or destroyed</li></ul>Logging, security, performance, …<br />Flexibility <br />[EJB 3.0 JSR-220]...
XML file
Upcoming SlideShare
Loading in …5
×

I2SD Reverse Engineering Sequence Diagrams from Enterprise JavaBeans with Interceptors

684 views

Published on

An Enterprise JavaBeans (EJB) interceptor is a software mechanism that provides for introducing behavior implemented as separate code into the execution of a Java application. In this way EJB interceptors provide a clear separation of the core functionality of the bean and other concerns, such as logging or performance analysis. Despite the beauty of the idea behind the interceptors, developing, testing and managing dependencies introduced by the interceptors are considered to be daunting tasks. For example, the developers can specify interceptors at multiple locations and by multiple means. However, different
locations and specification means influence the order of the interceptor invocation, which is governed by more than fifteen different intertwined rules according to the EJB standard. To facilitate development of EJB applications we have designed
I2SD, Interceptors to Sequence Diagrams, a tool for reverse
engineering EJB applications with interceptors to UML sequence diagrams. I2SD provides the developer with a visual feedback and can be used by quality managers to get a broader understanding
of the way interceptors are used in their project.

Published in: Technology, Business
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
684
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • Incosistencies:First, the specification states that &lt;interceptor-order&gt; can specify total orderingof interceptors on a bean at the class level and/or method level. The implementation, however, allows only one such an element: either on the class or on the method level of any particular bean. Second, the specification states: “If the interceptor-order element is used, the ordering specified at the given level must be a total order over all interceptor classes that have been defined at that level and above (unless they have been explicitly excluded by means of one of the exclude- elements)”. However, in the GlassFish implementation, the &lt;interceptor-order&gt; element has the absolute priority and the exclude- elements cannot override it. Third, the specification defines that a &lt;method-name&gt; element should be used to specify an interceptor method. GlassFish, however, requires the &lt;method-name&gt; element to be enclosed in the &lt;method&gt; element. This discrepancy stems from an inconsistency in [21]: while the discussion omits &lt;method&gt;, the XML schema found in the same document includes this element. In all these situations, the algorithms presented in the next section follow the implementation rather than the specification.
  • The plugin uses an internal on-the-fly compiler of NetBeans (what element is selected – name, signature, class/method/…)
  • I2SD Reverse Engineering Sequence Diagrams from Enterprise JavaBeans with Interceptors

    1. 1. I2SD: Reverse engineering sequence diagrams from Enterprise JavaBeans with interceptors<br />SergueiRoubtsov <br />Alexander Serebrenik<br />AurélienMazoyer (Polytech’Nice-Sophia)<br />Mark van den Brand<br />
    2. 2. PAGE 1<br />Interceptors<br /><ul><li>Business method interceptor
    3. 3. when a method is called
    4. 4. Lifecycle callback interceptor
    5. 5. when an object is created or destroyed</li></ul>Logging, security, performance, …<br />Flexibility <br />[EJB 3.0 JSR-220]:<br /><ul><li>How?
    6. 6. XML file
    7. 7. Annotation
    8. 8. At what level?
    9. 9. Bean class
    10. 10. Method (BMI)
    11. 11. Where?
    12. 12. Bean class
    13. 13. Superclass
    14. 14. Separate class
    15. 15. Injected bean</li></ul>public classimportantClass {<br /> public StringimportantMethod() { <br /> …<br /> }<br /> …<br />}<br />Order of invocation<br />
    16. 16. Order of invocation<br />Influenced by how, where and at what level.<br />Governed by complex and interwined laws<br />9 for the business method interceptors<br />7 for the life cycle callback interceptors<br />Comprehension of the invocation order is complex!<br />Visualization: sequence diagrams<br />Beneficial for comprehension [Tiley Huang 2003]<br />Suited for the task as interceptor invocation<br />Sequential<br />Data independent (more or less)<br />PAGE 2<br />
    17. 17. I2SD<br />Co-evolution concern  separation of the parsers<br />Visualization + analysis  SVG (XML-based)<br />Suited for post-processing<br />Integrated in NetBeans<br />Uses the internal on-the-fly NetBeans compiler <br />/ name of department<br />PAGE 3<br />7-10-2011<br />
    18. 18. User scenarios (paper)<br />Developer Alice tries to understand a performance problem<br />Measurements of the explicit calls do not help<br />I2SD exposes “hidden” interceptor calls <br />Alice measures performance of these calls<br />Alice-like demo<br />Quality assessor Bob evaluates maintainability<br />Metrics: number of calls in a scenario <br />[J. Muskens, M. R. Chaudron, and R. WestgeestPROGRESS 2002]<br />Bob runs I2SD as a batch job<br />Compares results against the benchmarks<br />/ name of department<br />PAGE 4<br />7-10-2011<br />
    19. 19. Conclusions<br />Interceptors are flexible and beneficial<br />Order of invocation is challenging<br />Reason for slow adoption?<br />I2SD reconstructs sequence diagrams<br />Helps both developers and quality assessors<br />More information and availability<br />Serguei Roubtsov <br />s.roubtsov@tue.nl<br />/ name of department<br />PAGE 5<br />7-10-2011<br />

    ×