• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Java web-application to UML

 
Ranch Hand
Posts: 89
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

I've recently decided to gain some experience in programming design. I read "Refactoring: Improving the Design of Existing Code" by Martin Fauler, "Design Patterns: Elements of Reusable Object-Oriented Software" by the Gang of Four. Finally, I obtained some skilles in usage of the patterns from the aforementioned books.

Both of these books possess UML diagrams (primarily class and sequence diagrams). So my second step was to create UML diagrams by myself. And I decided to take a Java web-application. I have little experience in UML so could someone help to build a proper class diagram for the following source code:



This peace of code uses external ZK framework. To tell the truth I have no idea how I can depict the relations between container (Tomcat), external framework (ZK, Spring, etc.) and my own web-application and wether I am to do so.
 
Bartender
Posts: 2292
3
Eclipse IDE Spring Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Howdy, Sergey!

I think I'd go with the following diagram. A couple of remarks:

  • The GoF design patterns book uses OMT notation, not UML;
  • Don't worry too much about making your class diagram as detailed as possible. What I've learned over the years is that its real value is in communicating design decisions. Add to your diagram the things you judge necessary to communicate your choices.
  • If I make no mistake, your MainFrame class represents a window, right? I would avoid adding a getMenubar public method to such a class, because someone with a reference to an instance of a MainFrame class could call MainFrame.getMenubar and start doing things that MainFrame wouldn't know. In other words, the menu bar wouldn't be well encapsulated. Add methods to your MainFrame class that deal with your menu bar.
  • class_diagram.png
    [Thumbnail for class_diagram.png]
    The class diagram that describes the code above.
     
    Sergei Zhylinski
    Ranch Hand
    Posts: 89
    1
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Roberto Perillo, can you tell me what program you used to create the diagram?
     
    Roberto Perillo
    Bartender
    Posts: 2292
    3
    Eclipse IDE Spring Java
    • Likes 1
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Oh, sure! It was Astah. You can find it here. You can use the Community version, which is limited, or you can try the Professional version, which expires in 20 days (if I make no mistake).
     
    Author
    Posts: 63
    6
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    You can create class diagrams (and other UML diagrams) in ArgoUML. It is a free software.
    reply
      Bookmark Topic Watch Topic
    • New Topic