The main points are simplicity and readability. I use the builder almost
exclusively in my code, and it makes the code a lot more readable (esp.
when formatted). You can just use instances of an Option and the setters,
but the various constructors allow you to obfuscate exactly what you are
doing. With the builder, every modifier to an option is clearly stated,
and the option is only created in its "fully-formed" state.

Stated in much clearer language than I could ever have done, thanks Michael :-) One my design goals was to make Options/Arguments immutable. So the ONLY way to create them is via the builders.

-John K


Regards, Michael Lanzetta






"David Graham" <[EMAIL PROTECTED]> 03/04/2003 11:34 AM Please respond to "Jakarta Commons Developers List"


To: [EMAIL PROTECTED] cc: Subject: Re: [CLI] Version 2.0 - API


The builders are to help the building of complex objects
in a verbose manner thus eliminating the confusion that
arises due to methods with many parameters of similar type.

Why can't you just create Option instances and call setters on them to configure them? I guess I'm not seeing the point of the builder.
- - - - - - - - - - - - - - - - - - - - - - -
Jakarta Commons CLI
http://jakarta.apache.org/commons/cli


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to