开发者

Tools for managing a complicated project setup with many frameworks and no documentation [closed]

开发者 https://www.devze.com 2023-04-13 07:15 出处:网络
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references,or expertise, but this question will likely solicit debate, a
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 11 years ago.

We have to extend a huge java project that makes use of frameworks like maven, spring, struts, freemarker and closure templates.

We do have access to source code but barely any documentation, and we have to extend this system.开发者_StackOverflow社区 Our only solution is to find the place in the existing code, where something similar is already done. To find this place, we try to start from the action that is called and then with the help of the debugger try to find out which classes and Spring beans are involved.

The stack traces from the debugger are quite hard to understand, since a lot of reflection is being used.

Does anybody had a similiar setup and could provide a few tipps how to manage such a complicated setup?


Yes I have had a similar setup, and I used fdisk, because in my case the code was also buggy and not understandable. ;-)

This job is really hard. And I can give you only one tip: build regression tests


Never had this specific case, but were I you, I would try some AOP with AspectJ in order to wrap every call of the application, collect this real-time data and analyze it to see where the action occurs. You could build some nice heat maps or other visualization around such data.


Use Eclipse IDE for your application. It support spring ,struts and many framework for j2ee application .I like it's debugger and i easily understand it's stack trace. Typically, the debugger in Eclipse is configured to suspend execution at the location where the exception was thrown, on all uncaught exceptions. The exception might be handled later, lower down in the stack frame and might not lead to the thread being terminated. This would be cause of the behavior observed. Configuring the behavior of Eclipse is straightforward - in the Preferences Dialog, the Debug pane under Java in the tree hierarchy, has the option titled "**Suspend execution on uncaught exceptions", which can be unchecked.


I think although task on hand looks hard, There are few tools that might help

  • I would use a Java EE ide, there are lot of options to name a few Eclipse, Net Beans , webstorm, I would recommend eclipse
  • I start with struts config (struts-config.xml), I think this pulgin should help you, Open the struts config using the plugin and You will have a good view of the application flow
  • Install spring IDE helps with spring context edit's
  • You need to find out how the spring container is instantiated, Since it is a web application look in web.xml, If i have to guess then you should find configuration for spring context loader listener or may be DispatchServlet
  • Since you did not mention any thing in your post, I was not sure if the struts actions are being managed by spring or not
  • If they are not manged by spring then they might accessing spring managed beans in action classes using WebApplicationContextUtils
  • If there are no tests, I would write a test at least to load spring container in isolation if you use Junit and Spring test It is simple, look here for more

     @RunWith(SpringJUnit4ClassRunner.class)
     @ContextConfiguration(locations={"classpath:spring-context.xml"})
     public class CTSWebServiceTest 
     {
          //if annotations are being used
            @Autowired
        ApplicationContext ctx;
     }
    
  • If you could get the application flow using the struts plugin, Then you can map out the various flows that should help you a lot with the views (freemaker)

  • Since you did not quantify the change as for as maven is concerned the changes should be minimum more like adding new dependencies etc, You can use this m2eclipse plugin for maven

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号