Feb 29th, 2008, 08:24 AM
how best to model Spring apps
We are wondering the best way to formally model our projects at the design phase before we start coding. UML doesn't seem to represent Spring apps very well, as the classes are glued together by Spring rather than by their direct relationships to each other. (I just reverse-engineered the UML for my last Spring project using myEclipse, and I mainly see a load of discrete interface/class implementation pairs.)
I did find this an issue also while I was coding that project, as a way to visually conceptualise the way the project hung together felt lacking.
What I really want is a convention to pictorially represent the Spring relationships together with the class relationships in my project (and then of course ideally a tool to forward and reverse engineer!)
Is there such a thing and I'm just missing it?
Mar 3rd, 2008, 07:17 AM
myEclipse Spring bean graph
I just generated the Spring bean graph from myEclipse - I did this early on in my project, but now it looks a whole lot more meaningful and does point up some places where the structure is odd or the bean names are not entirely self-documenting, so definitely a useful exercise as part of the iterative design process.
Would still be interested to know if and how others create visual representations of their Spring apps.
Mar 3rd, 2008, 08:46 AM
I think UML should be used as a high level representation, not as a direct mapping to your implementation. You can have a look at AndroMDA to get some idea of what a high level representation of an app could look like.
AndroMDA generates code for your project (Model Driven Architecture) from your UML diagrams. But your UML is still mostly independent of the underlying technology. IMHO that's how it should be ...
Mar 3rd, 2008, 08:51 AM
Forgot to add some links :
AndroMDA : http://andromda.org/
The getting started guide gives you an overview of the general architecture generated by AndroMDA, and goes into details on how to model data components and their associations, value objects, services, and a lot more ...
Mar 5th, 2008, 05:56 AM
Originally Posted by gehel
so basically I should have my Class Diagram & Uses Cases reay, before coding & integrating Spring, right?
What about having an entire java application (stand-alone), & now integrate Spring into it?
Mar 5th, 2008, 06:36 AM
Again, that's only my humble opinion ...
Originally Posted by kochen
It depends what kind of UML you already have for your existing app, and how much of the design you will change. Ideally, a high level representation in UML should be independent of the implementation technology. If you model a service layer in your UML, you can define its methods, the dependencies between a particular service and the DAOs it uses, ... All that should not reference Spring.
Again, if you have a look at AndroMDA, they use UML at a sufficiently high level to be able to generate from the same model a Java / Spring implementation or a .Net implementation (at least, that's the theory ;-) )
Mar 5th, 2008, 08:10 AM
Best approach is to use UML (2) with standar diagrams
- Component diagrams: to view the general architecture
- Deployment diagram: to view the phisycal deployment of the applicacion
- Class diagram, to view the static representation of the application.
OBJECT diagrams, you can diagram every object graph you want. An also you can see all the dependency injection.
I can send you an example if you want.
Mar 6th, 2008, 02:40 AM
Thanks - I'd got hung up on what myEclipse was producing for me, which was class diagrams that either included the dependency injection relationships or the inheritance relationships but not both, but of course I guess the answer is just to draw them in - since hopefully you'll be doing it before you write your java classes anyway!
surrizola, thanks for your very kind offer to send an example - that would be really useful. email address is firstname.lastname@example.org
Mar 7th, 2008, 07:45 AM
Yes, that would be great...
Originally Posted by surrizola
(my email was sent via PM)