c# - What is a real-life use for the builder design pattern? -


I have read about it, I think this is a fundamental task - I am a normal, real life for this method use of.

For reference, I work with most commercial applications, web and windows using Microsoft Stack.

think about a travel program. There are many things that you can add to the hotel, rental cars, airline flights and travel card like every cardinality are 0 to *. Alice can have a car and a hotel, while Bob can not have two flights, no cars and three hotels.

To get a travel program out, it will be very difficult to build a solid factory or even a simple factory. What you need is a factory where you can take different steps, there may be some steps, as a result of the other creation process, others do not have very different types of objects.

In general, you should start with the factory and go to the builder, if you need more grain control on the process.

In addition, there is a good description, code example and UML in it.


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -