Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / March 2007

Tip: Looking for answers? Try searching our database.

Java library of patterns

Thread view: 
joshua.krinsky@gmail.com - 12 Mar 2007 18:59 GMT
I was wondering if anyone knew where I could find a design patterns
library for Java.  I've been tasked with creating or finding one and
I've had no luck searching Google.

Thanks
Chris Smith - 12 Mar 2007 20:14 GMT
> I was wondering if anyone knew where I could find a design patterns
> library for Java.  I've been tasked with creating or finding one and
> I've had no luck searching Google.

I have the feeling that you're misinterpreting the purpose of design
patterns.  The amount of common code from a design pattern that could be
abstracted into a library is very small; probably less than a page.  The
idea behind the design pattern lies in how it organizes your own
functionality when you add to it later.  You may as well write that less
than a page of code on your own, rather than complicating deployment by
adding a dependency on a third-party library.  If you don't understand
the pattern well enough to implement it, then you're going to run into
problems anyway.

I'd actually go further, and recommend that you keep writing code and
reading about design patterns at arm's length.  Don't ever set out to
implement a design pattern.  A book on design patterns can give you some
ideas about how to resolve certain kinds of recurring problems, which
you should internalize so that you'll be able to use them organically in
your own designs, rather than producing stilted designs that are driven
by your choice of patterns.

Signature

Chris Smith

Lew - 13 Mar 2007 00:04 GMT
<joshua.krinsky@gmail.com> wrote:
>> I was wondering if anyone knew where I could find a design patterns
>> library for Java.  I've been tasked with creating or finding one and
>> I've had no luck searching Google.

> I have the feeling that you're misinterpreting the purpose of design
> patterns.  The amount of common code from a design pattern that could be
[quoted text clipped - 13 lines]
> your own designs, rather than producing stilted designs that are driven
> by your choice of patterns.

What Chris said. Beyond that, explain to whomever "tasked" you with this that
the idea is fundamentally incorrect. Design patterns are concepts, not code.

Consider an analogy. In natural languages like English or Tagalog there are
grammatical patterns like "verb" and "sentence". Those patterns manifest
differently in different circumstances; there aren't necessarily preset
"grammatical patterns" in those languages. There are instead an infinitude of
language expressions that manifest those patterns.

Your task is analogous to creating a compendium of grammatical patterns for a
natural language as expressions in that language. You would have to create a
comprehensive set of all possible expressions in that language, clearly not
feasible.

-- Lew
thejtk@gmail.com - 13 Mar 2007 18:30 GMT
> <joshua.krin...@gmail.com> wrote:
> >> I was wondering if anyone knew where I could find a design patterns
[quoted text clipped - 33 lines]
>
> -- Lew

What about ACE in C++?  It has classes that provide patterns.  An
example would be the Reactor pattern [p.179 Pattern Oriented Software
Architecture Vol.2] implementation in ACE [p.39 C++ Network
Programming Vol.2].  This is the sort of thing I was talking about
(although I'm not looking for a Java version of ACE).  If it is
possible to have a library of patterns in C++, shouldn't it be
possible in Java?
joshua.krinsky@gmail.com - 13 Mar 2007 18:33 GMT
> <joshua.krin...@gmail.com> wrote:
> >> I was wondering if anyone knew where I could find a design patterns
[quoted text clipped - 32 lines]
>
> -- Lew

What about ACE in C++?  It has classes that provide patterns.  An
example would be the Reactor pattern [p.179 Pattern Oriented Software
Architecture Vol.2] implementation in ACE [p.39 C++ Network
Programming Vol.2].  This is the sort of thing I was talking about
(although I'm not looking for a Java version of ACE).  If it is
possible to have a library of patterns in C++, shouldn't it be
possible in Java?
Mark Jeffcoat - 13 Mar 2007 20:38 GMT
> What about ACE in C++?  It has classes that provide patterns.  An
> example would be the Reactor pattern [p.179 Pattern Oriented Software
[quoted text clipped - 3 lines]
> possible to have a library of patterns in C++, shouldn't it be
> possible in Java?

What about ACE? It "implements many core patterns for
concurrent communication software." Good for it. So does
java.util.concurrent.*. I'll be happy to declare it a
pattern library.

Spring provides much support for MVC, Inversion of Control,
Data Mapper, and many more. Very much a pattern library.

log4j implements Neil Harrison's Diagnostic Logger pattern,
and is (deservedly) nearly ubiquitous in the the server
programming world.

java.util.Iterator is a perfectly decent implementation
of the Iterator pattern. Also fairly common in Java
programs.

Maybe you could ask for something more specific?

(If I were tasked with finding a "pattern library in
Java" by someone who obviously didn't know what he was
talking about, I'd be tempted to show up at the next
meeting with a copy of Spring and go home early.)

Signature

Mark Jeffcoat
Austin, TX

Arne Vajhøj - 13 Mar 2007 02:27 GMT
> I was wondering if anyone knew where I could find a design patterns
> library for Java.  I've been tasked with creating or finding one and
> I've had no luck searching Google.

Patterns are usually language neutral.

If you are looking for examples of standard patterns
like GoF patterns in Java then try:

http://www.fluffycat.com/java-design-patterns/
http://www.patterndepot.com/put/8/JavaPatterns.htm

Arne


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.