aspose file tools*
The moose likes OO, Patterns, UML and Refactoring and the fly likes Patterns wanted for examples 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 "Patterns wanted for examples" Watch "Patterns wanted for examples" New topic
Author

Patterns wanted for examples

Ray Marsh
Ranch Hand

Joined: Jan 12, 2000
Posts: 458
Does anyone have any patterns that they would be willing to share? I'd like to see some good examples to learn from.
Thanks, Ray


Anxiety does not empty tomorrow of its sorrows, but only empties today of its strength. – Charles Spurgeon
paul wheaton
Trailboss

Joined: Dec 14, 1998
Posts: 20690
    ∞

To really describe patterns well requires some UML. I'll see how I can do with text:
The most popular pattern is the Singleton Pattern. This is where you have only one instance of a class. Usually, there is a method called getInstance() or getSingleton() or something similar. It will have a static variable that starts off as null and when getInstance is called it tests for the null. If null, a new instance is created and returned. Otherwise, the current instance is returned. This way, you are guaranteed that there will always be one instance.
Maybe we should start a new thread for each pattern? I could do a few more. Factory, Decorator, State and Strategy come to mind.

permaculture Wood Burning Stoves 2.0 - 4-DVD set
Ray Marsh
Ranch Hand

Joined: Jan 12, 2000
Posts: 458
UML
Tony Alicea
Desperado
Sheriff

Joined: Jan 30, 2000
Posts: 3222
    
    5
Unified Modeling Language


Tony Alicea
Senior Java Web Application Developer, SCPJ2, SCWCD
paul wheaton
Trailboss

Joined: Dec 14, 1998
Posts: 20690
    ∞

UML is where you draw pictures that represent classes, objects, methods, etc. If you are trying to describe some OO data construct, it's a lot easier with UML.
UML is the language of modern software architects. This is the best way to move an architectural idea from your head to someone else's head.
Patterns help even more. Rather than taking ten minutes to describe, say, a decorator pattern to someone, you just say "we'll use a decorator pattern".
Ray Marsh
Ranch Hand

Joined: Jan 12, 2000
Posts: 458
Is there any relationship between UML and visual developement tools, i.e. Visual Age for Java or Visual Cafe?
paul wheaton
Trailboss

Joined: Dec 14, 1998
Posts: 20690
    ∞

I think some IDE's are starting to come out with UML stuff, but no, that isn't their main gig.
Frank Carver
Sheriff

Joined: Jan 07, 1999
Posts: 6920
There are visual tools which use UML, such as Together/J, ( http://www.togethersoft.com/ ) but the "visual" in most visual tools refers only to graphical creation of GUIs.


Read about me at frankcarver.me ~ Raspberry Alpha Omega ~ Frank's Punchbarrel Blog
Rich Wardwell
Ranch Hand

Joined: Jan 20, 2000
Posts: 33
A neat new tool to do class diagrams and reverse/forward engineering that I just discovered is JaVISION from Object Insight. You can get a trial version from www.object-insight.com. It doesn't include all the functionality of a Together/J or Rose, but is simple, quick, and very easy to use (and puts out some great class diagrams).

<B>Rich Wardwell</B><BR> <A HREF="mailto:rcw3@levelpath.com" rel="nofollow">rcw3@levelpath.com</A> <BR>Sun Certified Programmer for the Java 2 Platform
Amit Zzz Kulkarni
Ranch Hand

Joined: Jul 05, 2000
Posts: 30
I disagree ,patterns started without any tie up to any modelling language later on they converged. I have been implementing patterns for a year or so and I don't know UML at all.
Originally posted by Paul Wheaton:
To really describe patterns well requires some UML.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Patterns wanted for examples