File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes OO, Patterns, UML and Refactoring and the fly likes Designs Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » OO, Patterns, UML and Refactoring
Bookmark "Designs" Watch "Designs" New topic


vishal sodani
Ranch Hand

Joined: Aug 26, 2000
Posts: 127
What is the difference between Design Patterns and UML?
Greg Whelan
Ranch Hand

Joined: May 18, 2000
Posts: 52
Design Patterns are structures that experienced Object-Oriented developers have experimentally observed to have frequently occurred in programming. They have desirable qualities such as reusability, performance and concise explanations.
To get a taste of the simplest Design Pattern here's the easily understandable Singleton pattern (note this code doesn't do anything useful other than demonstrate the pattern):

The purpose of the Singleton Pattern is to only allow a single instance of a particular class (that's not entirely accurrate, but correct for now ). You'll see that the class above achieves that goal.
Design patterns are constructs of this flavor that you will find immensely valuable in designing and developing object-oriented systems.
UML is a series of diagramming techniques, visual notations, that are tailored towards expressing the design and execution of an object-oriented system. It consists of 7+ diagram types that each convey a different aspect of a design. Perhaps the most common of these diagrams is the Class Diagram, where classes are drawn in a rectangular box (inside is the name of the class, the methods and the variables). Related classes can be connected with various arrow-types to indicate relationships such as inheritance.
UML is very valuable as a means of communicating designs among developers (and as part of design documentation).
With 2 years of Java developement experience I have found the authoritative "Design Patterns" to be an good book to learn DP (it sometimes makes the topic appear more complex than it actually is, and isn't fully Java-compliant ). I unfortunately would recommend avoiding Cooper's "Java Design Patterns" (a great idea for a book, an extremely poor execution).
For learning UML I found "UML Distilled" to be an excellent book (and very readable). As with programming languages mastery of UML only comes about through usage (and misusage).
vishal sodani
Ranch Hand

Joined: Aug 26, 2000
Posts: 127
Thanks Greg, for such a good reply.I am new to OOPS.I have just cleared certification exam.Now I am doing some advanced topics.For UML I am reading "UML User Guide" by Booch,Jacobsem,Rumbaugh.Is this the right book,Yu suggested a book.Who is the author,and publisher?What are your suggestions for me -as I go about learning Java.
[This message has been edited by vishal sodani (edited September 15, 2000).]
Steve Fahlbusch

Joined: Sep 18, 2000
Posts: 602

as to the books, UML distilled - Martin Fowler (BTW-he talks at most SD2000 confs, if you get a chance, attend - he is a very good speaker)
Desing Patterns - Gamma (et all)
Amala Amperayani

Joined: Sep 27, 2000
Posts: 6
The UML User Guide is a very good book to start with. There are other books worth reading. Here are 2 good books.
Applying UML and Patterns ---
Craig Larman
Fundamentals of Object-Oriented Design in UML ---
Meilir Page-Jones (P)
There is a free OO Modelling tool available on Can you give me more details about the certification exam?

[This message has been edited by Amala Amperayani (edited September 27, 2000).]
Frank Carver

Joined: Jan 07, 1999
Posts: 6920
Please note that, although widely given as an understandable example of patterns, the Singleton pattern (as explained above) is rarely the best choice when developing real Java software. It can be very tempting to see things in terms of singletons when analysing a problem. Processes and procedures in the real world are full of implicit Singletons (one person in the company who does all the ordering, one database used to store all the data, etc.), but these can be very dangerous assumptions when built in to a software solution.
Before you leap to implement the Singleton pattern as a first try of patterns, consider trying one of the other patterns first. Decorator is simple and powerful, for example, and suits well the Java concept of interfaces.

Read about me at ~ Raspberry Alpha Omega ~ Frank's Punchbarrel Blog
I agree. Here's the link:
subject: Designs
It's not a secret anymore!