The builder will pass all the properties that it "collected" to Entry's constructor in one-shot when you call build(). So there is not that much plumbing I see.
And this is a very common pattern. But you may find this complicated still. On Sun, Mar 14, 2010 at 16:08, Emmanuel Lécharny <elecha...@apache.org>wrote: > On 3/14/10 2:56 PM, Ersin Er wrote: > >> You might consider builder pattern with a DSL like syntax: >> >> Entry entry = new EntryBuilder().add("objectClass", "top").build(); >> >> where Entry is immutable. >> >> > That means you have to use a factory to build an entry, and that this > factory returns a mutable object. To get an immutable object out of it, you > have to call a third method. > > Isn't it a bit too complicated ? (even if we don't consider the last method > to create a immutable object). > > > > -- > Regards, > Cordialement, > Emmanuel Lécharny > www.nextury.com > > > -- Ersin ER http://www.ersiner.net