This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes OO, Patterns, UML and Refactoring and the fly likes Java web-application to UML Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » OO, Patterns, UML and Refactoring
Bookmark "Java web-application to UML" Watch "Java web-application to UML" New topic
Author

Java web-application to UML

Sergey Zhylinsky
Greenhorn

Joined: Nov 15, 2013
Posts: 23
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.
Roberto Perillo
Bartender

Joined: Dec 28, 2007
Posts: 2258
    
    3

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]



    Cheers, Bob "John Lennon" Perillo
    SCJP, SCWCD, SCJD, SCBCD - Daileon: A Tool for Enabling Domain Annotations
    Sergey Zhylinsky
    Greenhorn

    Joined: Nov 15, 2013
    Posts: 23
    Roberto Perillo, can you tell me what program you used to create the diagram?
    Roberto Perillo
    Bartender

    Joined: Dec 28, 2007
    Posts: 2258
        
        3

    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).
    T. Sharma
    Author
    Ranch Hand

    Joined: Jul 30, 2013
    Posts: 46
        
        5
    You can create class diagrams (and other UML diagrams) in ArgoUML. It is a free software.


    Tushar Sharma (Twitter: @Sharma__Tushar)
    http://sharmatushar.blogspot.in/
     
    With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
     
    subject: Java web-application to UML
     
    Similar Threads
    What it takes to be an architect?
    Passed part II + III with 98%
    Advice needed before switching towards Java domain by an experienced PHP programmer
    Part 2 Assigment use cases
    Passed Part2/3 74% & my suggestions to avoid low score