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. 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?


3 Answers 3


You need to try to understand the software from an architectural perspective. That's going to be hard to do studying stack traces.

I would start by laying out the classes in a UML diagram. Struts is an MVC framework, so the project is probably an MVC one. Find out what all of the frameworks are, and analyze your class layout to determine the role each piece fulfills.

Once you do that for awhile, you'll be in a much better position to extend the project skillfully and sensibly.

  • Spring is actually an IoC container. It does have some MVC components (as well as some OSGi components, and probably others), but it's primarily known for its IoC features.
    – TMN
    Oct 13, 2011 at 15:18
  • 1
    Struts is MVC also. There's some MVC in there somewhere; that's where I would start my analysis, at the highest level of architecture. Oct 13, 2011 at 15:23
  • In complex apps, there's often several levels of architecture above the level of Spring/OSGi. Oct 13, 2011 at 15:39
  • +1. To complement the answer there are tools that automatically generate the UML from the source code, eUML2 comes to mind but I'm sure there are others. Oct 13, 2011 at 16:17

how to manage such a complicated setup?

You need two things which are extremely important:

1. Good developers

We are talking reverse engineering here.

There are lots of programmers who can follow a tutorial or copy-paste code they barely understand, or follow the company's training program and roll out working code, but for this kind of situation you need people to do the opposite. Instead of building something, you have to tare something apart and see how it works so that you can later build on it, maintain it, evolve it etc.

Skills are necessary for this, so you need experienced developers. Juniors won't do! Even if they are good developers and hard working people they "haven't yet seen the horrors of war".... if you understand what I mean.

2. Support from management

This is even more important than number one. If you have lots of frameworks, it's a huge project, it's not documented, maybe the business domain is new to you etc, then to get up to speed and be able to enhance the system you need time. You can't just roll up your sleeves and start coding the new features. You must learn, dissect, analyze change a little, test a little etc.

Does management realize this? Are they perfectly aware of the risks that such uncertainty generates? Are they supporting you (they must be the ones to buy you this time, projects don't have the luxury to go on forever) or are they putting pressure because "everything takes to long"?

It's never easy to manage a situation like this, but people are the ones to put your bets on, not tools or UML diagrams.

Best of luck to you!


We did have the same problem in our company. A huge code and no documentation. We have never been able to extend it and the project was redone.

What was funny in the story is that few year later we found out that the team had almost done no code except business rules. They have create a small model and have generated a huge code from it. This is why the code was messy and impossible to understand by new developers. They did not let the original model as well so a really bad experience and exactly what should not be done !!

I sometimes hate Model Driven Development :-) but like UML therefore a reverse engineering of the java code into a class diagram could help but not if the code has been already generated from a model. I mean that a reverse engineering is useful if a hand written code.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.