You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by bu...@apache.org on 2003/10/28 22:15:57 UTC
DO NOT REPLY [Bug 24191] New: -
OptionBuilder only has static methods, yet many return an OptionBuilder instance
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=24191>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND
INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=24191
OptionBuilder only has static methods, yet many return an OptionBuilder instance
Summary: OptionBuilder only has static methods, yet many return
an OptionBuilder instance
Product: Commons
Version: unspecified
Platform: Other
OS/Version: Other
Status: NEW
Severity: Enhancement
Priority: Other
Component: CLI
AssignedTo: commons-dev@jakarta.apache.org
ReportedBy: lance@teaminabox.co.uk
First of all, I think CLI is great.
However, the OptionBuilder really gets my goat. All of the methods are static,
yet all, except the create() methods, return an OptionBuilder instance.
Presumably this is to allow us to chain calls to the builder, but by chaining
calls, we are calling static methods through an instance, which is generally
considered bad form.
Also, it doesn't really qualify as an instance of the Builder Pattern in its
current form since it does not meet the intent: 'Separate the construction of a
complex object from its representation so that the same construction process can
create different representations' (this is because of the static methods).
Why not make the methods non-static and get the client to create an instance of
the builder before proceeding? In it's current form, it seems a bit schizophrenic.
Regards,
Lance
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org