Re: Question About Builder Object



To add to H.S.Lahman's response,

You can combine patterns as well. For example, if you want your concrete
builder to use a strategy to construct the object.

<calling-code>
MyBuildStrategy strat = MyBuildStrategy.StratFactory(); // see factory
method pattern
MyBuilder bld = MyBuilder.CreateBuilder( strat ); //
assign in the strategy to use by builder

MyTargetObject myobj = bld.CreateTargetObject(); // when
building the object, use the strategy.
</calling-code>

Of course, if the concrete builder has a one-to-one relationship with the
strategy, it is little more than a strategy itself, so the factory method
pattern will do with a strategy pattern under it. Depends on how you want
to isolate the dependencies.



--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
--
<parwal.sandeep@xxxxxxxxx> wrote in message
news:1172583756.430294.30920@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hello Group !!

I'm newbie in Design pattern.
I'm using Builder pattern for my application.

i want to know that can Concrete builder have their own private
function which can be called by
public function which concrete builder has to implement..

or

concrete builder can only have the public function ..

can any body tell me what is standard for that ..

thanks in advance !!!

Sandeep



.



Relevant Pages

  • Re: Builders/Factories and Inheritance.
    ... I don't own a copy of the Gang of Four book, so i can't check what they wrote, but i think they describe something that's a bit like the relationship between an XML parser and a DocumentFactory, where you have a Director that knows what steps have to be performed, and a Builder that knows how to execute the steps, and where the steps ultimately yield a complex Product of some sort. ... The other pattern, which i *think* might originate in a talk by Josh Bloch, is where a Builder is essentially a mutable, fairly passive holder for state that is then used to construct some Product in a single big-bang constructor invocation. ... public void addHeading; ... public Medal(MedalLevel level, Event event, String athlete, Nation nation) // ... ...
    (comp.lang.java.programmer)
  • Re: Design problem while using Builder pattern
    ... > pattern book, to explain the problem that I am facing. ... > There is no problem in calling BuildPartA(), BuildPartB, ... If you need to know which concrete builder you have then Builder ... pattern is really best - do you have concrete details, ...
    (comp.lang.java.programmer)
  • Re: Design problem while using Builder pattern
    ... > pattern book, to explain the problem that I am facing. ... > There is no problem in calling BuildPartA(), BuildPartB, ... If you need to know which concrete builder you have then Builder ... pattern is really best - do you have concrete details, ...
    (comp.lang.cpp)
  • Re: Design problem while using Builder pattern
    ... > pattern book, to explain the problem that I am facing. ... > There is no problem in calling BuildPartA(), BuildPartB, ... If you need to know which concrete builder you have then Builder ... pattern is really best - do you have concrete details, ...
    (comp.object)
  • Re: Pattern Implementation
    ... I said "If you need a builder, it is best to put it into a class so that you ... learn that the reason for placing a building in its own class is because, ... I do not answer questions on behalf of my employer. ... programmer helping programmers. ...
    (comp.software.patterns)