On Mon, Nov 23, 2009 at 9:38 PM, Reinier Zwitserloot <[email protected]>wrote:

> It gets more complicated rather quickly when you start adding
> optionals into the mix; where do you store the default values?
>

Wouldn't you store them in the builder? I don't think you can get very far
without a build() method, though there are various ways of doing without one
for a while.

For extra safety, you could make the builder itself immutable.

There are some nice blogs about builders for unit test data by Nat
Pryce<http://nat.truemesh.com/archives/000714.html>and Jay
Fields<http://blog.jayfields.com/2009/01/most-java-unit-tests-consist-of-class.html>.
I think they could blend nicely with Dick's and FEST's auto-complete-driven
approach.

Moandji

--

You received this message because you are subscribed to the Google Groups "The 
Java Posse" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/javaposse?hl=.


Reply via email to