Results 1 to 9 of 9

Thread: how best to model Spring apps

  1. #1
    Join Date
    Jan 2008
    Posts
    6

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

  2. #2
    Join Date
    Jan 2008
    Posts
    6

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

  3. #3
    Join Date
    Jul 2005
    Location
    Geneva (Switzerland)
    Posts
    304

    Default

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

  4. #4
    Join Date
    Jul 2005
    Location
    Geneva (Switzerland)
    Posts
    304

    Default

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

  5. #5

    Default

    Quote Originally Posted by gehel View Post
    I think UML should be used as a high level representation, not as a direct mapping to your implementation.
    Hi 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?

  6. #6
    Join Date
    Jul 2005
    Location
    Geneva (Switzerland)
    Posts
    304

    Default

    Quote Originally Posted by kochen View Post
    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?
    Again, that's only my humble opinion ...

    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 ;-) )

  7. #7

    Default

    Best approach is to use UML (2) with standar diagrams
    General design
    - 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.

    SPRING
    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.
    CTO and Co Founder
    GPI Argentina
    www.gpi.com.ar

  8. #8
    Join Date
    Jan 2008
    Posts
    6

    Default

    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 zoe.james@warwick.ac.uk

  9. #9

    Default

    Quote Originally Posted by surrizola View Post
    I can send you an example if you want.
    Yes, that would be great...
    (my email was sent via PM)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •