commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Al Chou <>
Subject Re: [math] design patterns (was Re: cvs commit: jakarta-commons-sandbox/math/src/java/org/apache/commons/math/stat
Date Thu, 19 Jun 2003 14:17:19 GMT
--- wrote:
> Al,
>       It sounds like the pattern you're proposing is the Strategy design
> pattern (see "Design Patterns" by the four authors).  Basically, an object
> has multiple possible delegate objects, each of which implement a common
> interface.  Then, as the state changes, the strategy can switch from one to
> another.  This makes it transparent to the caller that multiple strategies
> are being used, and that they are even changing, but allows for good
> encapsulation, flexibility, and extensibility.
>       As for invoking using either static methods or instance methods, the
> Commons Bean-Utils does this.  There's a BeanUtils simpleton (all static
> methods) that delegates to a BeanUtilsBean, which can be instantiated,
> extended, etc.  So, the most common/shared version is accessible from
> either way, but any specialized version must be instantiated yourself and
> called directly.
>       Design Patterns are a great way to make Java do what we want it to.


Thanks for the great reply.  I haven't made it a priority to read my copy of
_Design Patterns_ (I figured _Refactoring_ was a better place for me to start;
also, have you seen the book-in-progress _Refactoring to Patterns_
[]?), so apologies for my
ignorance of their pattern catalog.


Albert Davidson Chou

    Get answers to Mac questions at .

Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message