Skip to main content

Patterns within patterns

Posted by daniel on March 11, 2005 at 6:37 AM PST

Seeing connections

There are patterns within and among patterns for many of the original
GoF design patterns. For example, at first look, State and Strategy
look very similar. The UML diagrams used to describe them in the book
are almost identical. Part of the difference comes from the ways in
which the patterns are applied but another key is to understand Joshua
Kerievsky's caution that the UML is one implementation of the
pattern. The UML is not the pattern and it is not the only way to
implement the pattern. Concentrating on the UML makes different
patterns seem similar and sometimes hides the underlying similarity
among patterns.

A striking example is described in the latest column from Robert
C. Martin's Principles, Patterns, and Practices series: href="http://today.java.net/pub/a/today/2005/03/09/factory.html">The
Factory Pattern. In it he shows that "Abstract Factory is just
Strategy used for creating objects." He then reaches back to his last
column that showed the relationships between Strategy and Template
Method and concludes that Factory Method is the pattern that uses
Template Method instead of Strategy.


In Also
in Java Today
, " The FilteredRowSet lets one narrow down the
number of rows in a disconnected object based on filtering logic you
provide without requiring an ongoing connection to your database." In
Kulvir Singh Bogal's DevX article href="http://www.devx.com/Java/Article/27511"> Master the
FilteredRowSet Interface for Disconnected Data Retrieval he shows
you how to provide your filtering criterion based on the
javax.sql.rowset.Predicate interface and how to apply the filter to
some real data.

Aspect-Oriented Programming (AOP) and attributes have their own
typical examples - you often see AOP introduced for logging and
attributes are great for generating code. But what happens when the
two are combined? Bill Burke explains "Together, they make a new
powerful combination that gives framework developers a more expressive
way of providing their APIs." In href="http://www.onjava.com/pub/a/onjava/2004/08/25/aoa.html">Aspect-Oriented
Annotations, he shows how to use attributes to indicate the
point-cuts for AOP, in effect extending the Java syntax by providing,
for example, a pseudo-keyword that indicates a method is to be fired
off in its own Thread.


Eduardo Pelegri-Llopart asks if you href="http://weblogs.java.net/blog/pelegri/archive/2005/03/want_to_help_cr.html">Want
to help create JAX-WSA in today's href="http://weblogs.java.net"> Weblogs . " Arun is looking
for a couple of good members for the JAX-WSA expert group. Specially
from smaller companies and expert individuals."

Srikanth Shenoy asks " When was the last time you manually copied
data from a Struts Form into a Value Object?" His post href="http://weblogs.java.net/blog/srikanth/archive/2005/03/copying_data_fr.html">
Copying data from Struts ActionForm to ValueObject: Easing the pain
explains " Copying data from one object to another is typically
achieved with Commons BeanUtils. However if the source and target
object have different structure and different attribute names,
BeanUtils cannot do much. That's where you will fnd OTOM framework
helpful. OTOM lets you graphically map one class to another in a Swing
UI and create napping metadata. The mapping source code can be then
generated using an Ant task at build time. Sounds useful..? Take a
look - http://otom.dev.java.net "

John Reynolds things about href="http://weblogs.java.net/blog/johnreynolds/archive/2005/03/the_same_big_th_1.html">The
Same Big Things " The techno-clairvoyants have been strangely
quiet of late... so I am left on my own to predict what 'The Next Big
Thing' is going to be. I think that one 'Big Thing' will be to put the
"P" in COBOL: a Common Business Process Oriented Language."


In Projects and
Communities
, the href="http://community.java.net/javadesktop/">JavaDesktop
community links to the transcript from the recent href="http://java.sun.com/developer/community/chat/JavaLive/2005/jl0215.html">
Java Live Chat with Chet Haase and Scott Violet which included
discussions on "Longhorn, SwingWorker as official API, acceleration
work in progress, and grey rectangles".

The Patterns
community is featuring a pointer to the href="http://www.theserverside.com/news/thread.tss?thread_id=32359">Refactoring:
Introduce Adapter. The advantage is it "limits the possible inputs
to the actual object to what clients would normally need so developers
do not have to know which part to get from the data."


In today's href="http://forums.java.net/jive/index.jspa">Forums, finzic
asks "Does anyone here in the Java Development arena have some
suggestions about cheap (if not free!) Java Reporting Engines
? I
currently use a reporting engine that gives me poor control over
embedded pictures and has poor report composition tools, and I need to
find a better tool."

Invalidname has a bit of a File rant saying "java.io.File [has]
"no way to get volume size", "no way to get free space on a volume",
"no access to TYPE/CREA on Mac OS", "no access to mime type on BeOS",
"no access to 'nix file permissions", "concept of unique paths is
wrong on Mac OS (could have multiple root-level devices with same
name)", "no frickin' copy() method", [..]"


In today's java.net
News Headlines
:

Registered users can submit news items for the href="http://today.java.net/today/news/">java.net News Page using
our news submission
form
. All submissions go through an editorial review before being
posted to the site. You can also subscribe to the href="http://today.java.net/pub/q/news_rss?x-ver=1.0">java.net News
RSS feed.


Current and upcoming href="http://www.java.net/events"> Java Events :

  • March 14-17, 2005 href="http://conferences.oreillynet.com/etech/">O'Reilly Emerging
    Technology Conference

Registered users can submit event listings for the href="http://www.java.net/events">java.net Events Page using our href="http://today.java.net/cs/user/create/e"> events submission
form. All submissions go through an editorial review before being
posted to the site.


Archives and Subscriptions: This blog is delivered
weekdays as the href="http://today.java.net/pub/q/java_today_rss?x-ver=1.0">Java
Today RSS feed. Also, once this page is no longer featured
as the front page of java.net
it will be archived along with other past issues in the href="http://today.java.net/today/archive/">java.net
Archive.

Seeing connections