程序缺少文檔?系統過于龐大?如何有效維護?MaintainJ,為您的Java程序把關!
MaintainJ是一款Java應用程序維護工具,可以在開發文檔缺失的情況下使用。MaintainJ生成的序列圖及類圖,可以呈現Java對象的脈絡,有針對性地 對程序進行改造與完善。
MaintainJ是一種反向工程工具,它能夠為Java代碼庫生成運行時序列圖和類圖。MaintainJ基于Eclipse構建,因此能夠在所有基于Eclipse平臺構建的IDE上運行。
功能亮點:
顯示調用上下文:在序列圖中,當鼠標在調用上懸停的時候,就會彈出提示框,顯示出調用方法的參數和返回值。
顯示運行時SQL:不管是哪種JDBC框架,MaintainJ都能夠捕獲到發送到數據庫實際雨欣的SQL語句以及其中的參數。
支持多JVM的應用程序:用戶可以跟蹤運行多個JVM上的應用程序,并且能夠在單獨的序列圖中看到端到端的調用流程。
大綱視圖:序列圖的大綱視圖會顯示出用例中的所有類和調用能夠一次選中并刪除多個包、類或者調用。并且在序列圖中添加了一個選項。可以把所有getter和setter方法篩選掉。
JSP調用:在用例中對JSP文件的調用也會顯示在序列圖中,當一個JSP文件中包含了多個其他JSP文件,那么對內部JSP的運行時調用也會顯示。
響應:節約時間40%!

優化:節約時間20%!

響應:節約時間40%!

(注:左右圖為使用MaintainJ前后的結果)
文檔工作:節約時間90%!
新項目啟動:節約時間75%!
How does MaintainJ help users?
- Using MaintainJ, Java developers can quickly analyze, understand, document and enhance large Java code bases。
- MaintainJ generates detailed runtime sequence and class diagrams for a single use case。The arguments and return value of the call are shown in the sequence diagram. The runtime SQL calls made during a use case, regardless of the database frameworks used, are shown. All these details help developers to quickly troubleshoot a problem or to analyze and enhance the application。
- MaintainJ supports tracing applications deployed across multiple JVM's。The call trace captured on different JVM?s can be merged to view the end-to-end call flow across JVM?s。
- MaintainJ supports runtime impact analysis。
- Users can filter out the unwanted details from the MaintainJ generated diagrams and then export the diagrams as UML2 model files。
- Any UML diagrams generated at runtime can be verbose and difficult to read. MaintainJ provides simple user interface to dynamically explore the sequence diagrams. Users can also search for a class, method or database table or field used in the use case。
- MaintainJ offers various options to filter out unwanted details from the generated diagrams and to view them at the level of abstraction that the user want。
- Users can easily troubleshoot multi-threaded applications using MaintainJ - The sequence diagram shows the runtime interactions between threads in different colors. This helps developers to quickly troubleshoot a multi-threaded application, which would be hard to do using a traditional debugger。
- MaintainJ integrates seamlessly with JUnit - Users can generate a sequence diagram for every test case and check the sequence diagram for any troubleshooting later。
- MaintainJ saves lot of effort for teams that maintain large Java applications。
Why should developers be interested?
Any developer who has ever tried to change a large Java application should not need much persuasion. For the remaining few, here are a few reasons :
Dynamic Binding - Dynamic or runtime binding in Java makes understanding code more difficult. Developers often need to understand the runtime object interactions for a specific use case either to debug or enhance the application. Dynamic binding helps in building very flexible systems but, at the same time it increases the time to understand the system. It is also common to employ multiple levels of dynamic binding, like a Vector containing another Vector, which further complicates the issue.
Observer Pattern - Many enterprise applications follow Observer Pattern for flexibility, where 'listener' (or observer) objects change model state besides 'listening' (or observing) for the state changes. When many such listener objects, which are often determined at runtime, change the model, it becomes hard to understand and debug a large application.
Multi-threaded Applications - Multi-threaded applications are always difficult to code and debug. Using MaintainJ, one can see the sequence of method calls happening in each thread in a neat sequence diagram. This makes debugging multi-threaded applications much easier.
Externalized Data and Rules - Externalizing configuration data as well as rule based logic to XML files is very commonly found in the present day Java applications. Very often, the logic to determine the runtime classes is soft-coded in xml files. In a not so well documented large-scale system, it is very hard to understand how the xml file drive the system.
Poor Design - Designing robust and flexible systems at the same time is hard. Maintaining them as the systems evolve is harder. If poor design slips into this equation, it becomes very hard to understand a system after 2-3 years from initial launch.
Here are some other scenarios where MaintainJ helps developers.
Complements Debugger - MaintainJ complements debugger rather than replacing it. By generating the class and sequence diagrams for a use case, it reduces the time spent in debugger. Unlike other reverse engineering tools, MaintainJ offers uncluttered and focused UML diagrams. For sequence diagrams, which get cluttered very easily, MaintainJ offers features like call folding to generate crisp diagrams.
During Code reviews - MaintainJ can also be used during code reviews. Rather than reviewing the entire source code, one can review the diagrams to find deviations from the design standards. Class diagrams showing the dependencies help to weed out unwanted dependencies.
For Agile Teams - For agile programming teams, MaintainJ provides always up-to-date documentation of the system. Useful UML diagrams can be generated whenever one needs them.
