Roberto Chinnici wrote:
> Tim Quinn wrote:
>> I have changed this so the start() method is on the builder class and
>> returns the running AppClientContainer. I would propose to rename
>> the "Config" to "Builder" because, I would not normally expect
>> something called a config object to able to construct an ACC whereas
>> I would expect that of a builder object.
>
> I'm not so sure about the "builder" terminology. In this case, there
> are no "parts" being built
True, and we don't really have alternate implementations of the
configured characteristics to choose from which might suggest a true
builder.
> and the start() method serves a dual-purpose, since it also starts the
> container.
Are you voicing an objection to the dual-purpose start() method?
Combining the "create" step with the "start" step into one method
prevents some programmer errors. Certainly an alternative would be for
the "Configurator" (or whatever) class to have a createContainer method
returning an ACC instance. ACC would have start and stop methods,
putting us back where you didn't want to be initially requiring runtime
state checking and IllegalStateExceptions.
There is no other operation other than start that a programmer would
want to do with a just-created AppClientContainer. Why require him or
her to explicitly start it with separate method invocation if that's the
only thing to do with it next after creating it?
> Using a fluent interface for easier property setting doesn't make it
> into much of a builder. Maybe a name like
> AppClientContainerConfigurator would be better.
>
> I'm trying hard to avoid suggesting calling it a "Factory", of
> course... :-)
OK, Configurator sounds OK to me.
- Tim