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="">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=""> 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="">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="">Want
to help create JAX-WSA in today's href=""> 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="">
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 - "

John Reynolds things about href="">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
, the href="">JavaDesktop
community links to the transcript from the recent href="">
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="">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="">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 " [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
News Headlines

Registered users can submit news items for the href=""> News Page using
our news submission
. All submissions go through an editorial review before being
posted to the site. You can also subscribe to the href=""> News
RSS feed.

Current and upcoming href=""> Java Events :

  • March 14-17, 2005 href="">O'Reilly Emerging
    Technology Conference

Registered users can submit event listings for the href=""> Events Page using our href=""> 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="">Java
Today RSS feed. Also, once this page is no longer featured
as the front page of
it will be archived along with other past issues in the href="">

Seeing connections