So we're going to begin the discussion of design patterns with the builder design pattern.
Our first creation or design pattern.
So what is the motivation behind a builder.
Well the thing is that some objects are simple and if you have a Symbol object like a point which has
x and y coordinates you can go ahead and create this object in a single constructor call you just call
the constructor provide the arguments and that's it.
On the other hand other objects require a lot of ceremony to create.
So for example when you are constructing a string from a dozen different pieces what you typically want
to do is not call a constructor and not do a concatenation where you have 11 plus signs instead you
make a string builder which actually lets you construct an object piece by piece.
So having an object with 10 constructor arguments is really not productive it's not a great way to go
because people make mistakes when they see too much variety if you have a constructor with 10 arguments
you may up two of the arguments by misplacing one of them.
And once again code completion model IDS is great but it's not that great and sometimes it can give
you a false sense of security in a way so having a massive constructor is not a great way.
And instead you should opt for piecewise construction so allow people to construct objects piece by
piece and provide a good API for actually doing it and this is what the builder pattern is all about.
So a builder is essentially a separate component so when piecewise construction of an object is complicated
then you provide a special API for actually doing it succinctly.