commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Al Chou <hotfusion...@yahoo.com>
Subject Re: [math] design patterns (was Re: cvs commit: jakarta-commons-sandbox/math/src/java/org/apache/commons/math/stat UnivariateImpl.java)
Date Thu, 19 Jun 2003 14:17:19 GMT
--- ericpabst@discoverfinancial.com 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.

Eric,

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_
[http://www.industriallogic.com/xp/refactoring/]?), so apologies for my
ignorance of their pattern catalog.


Al

=====
Albert Davidson Chou

    Get answers to Mac questions at http://www.Mac-Mgrs.org/ .

__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message