úterý 23. července 2013

Graph outline

Dependency graph outline
An initial sketch of the dependency graph have arisen from discussion with my thesis supervisor. The graph consists of two types of nodes:
  • Class nodes ①, ② representing any Java type that is somehow involved in CDI.
  • Bean nodes ③. Bean node represents a set of instances of certain Java type that are indistinguishable is sense of typesafe resolution i.e. instances living in the same context and having the same set of qualifiers.
Each of these nodes can appear as a single collapsed node ② or as a subgraph ③ of class/bean members (fields and functions) ④.

There are three types of arches:
  • Arch that connects bean node and belonging class node ⑦.
  • "production" arch ⑤ that leads from a class member annotated by
    @Produces to a node of produced bean.
  • "injection" arch ⑥ that leads from a bean to a bean member which is the bean injected in.
 @Produces annotated member are depicted in class nodes because same member of two instances of the same Java type usually can't produce beans of different qualifiers. However @Inject annotated member are located in bean nodes because typesafe resolution takes into account the scope of bean the injection point is in.

pátek 21. června 2013

Introduction and Architecture

Introduction

CDI Inspector is set of tools to visualize and inspect CDI components and their dependencies. It's aimed to help Java EE developer to orient in large project. The goal is to create an interactive oriented graph where node represents a CDI component and edge a relation "being injected into".

The Inspector can retrieve information about CDI components either about projects opened in IDE or about running applications deployed in JBoss AS server.The result graph can be viewed either in IDE window or in web browser.

Use cases

There are two key use cases for this tool. First, it is a brief inspection of running application, even in production mode. Web interface is used in this case.

Second, it is make it easy to get view from above of the project and navigate around the project while development. IDE plugin is used in this case. Thanks to integration with Eclipse it is possible to inspect just a selected package or single class or open class in source code editor from the graph.

Architecture

Following figure shows information flows of CDI Inspector. Yellow modules are part of the project.

 

The part running in Eclipse IDE (JBDS)consists of three Eclipse plugins. Two of them retrieve CDI metadata either about local projects using JavaEE Tools (part of JBoss Tools) or about deployed applications via REST protocol from application server. The third plugin manages graph view and IDE integration. Visualization can be activated from context menu of various nodes of 'Package Explorer' view. Plugin can show class represented by graph node in 'Package Explorer' view or open it in source editor. Node details are displayed in 'Properties' view. If one decides to inspect local projects only, this pars can work on its own.

JBoss AS hosts extension that collects information about CDI components in running applications and provide it to other Inspector module. This module runs as a standard application and publishs passed information using REST protocol alongside a simple client web application that can display the graph.

CDI Inspector is hosted on GitHub and currently is available in very preliminary version.