Java Clean Code Tutorial #3 - Builder Design Pattern Example

Pubblicato il: 25 gennaio 2017
sul canale di: Philip Starritt
50,261
783

Episode 3 of the free Java Clean Code Training Series.

So what is the builder pattern and why is it needed?
The Gang of Four Builder pattern is an object creation software design pattern.

It solves many problems and challenges such as the never-ending constructor parameter anti-pattern.

Benefits of the java builder pattern:
No need to pass Null objects into the constructor.
You don’t need to guess or try to work out which constructor parameter maps to a certain object’s field. Error prone!
Easily made into an Immutable class. You can now share the object safely between threads or in a multi-threaded environment as you don’t need to worry about mutation of variable state.
Provides control over object construction steps and provides meaningful semantic method names.
Increases the use-ability, maintainability and readability of code when creating objects.

Software is written once and read hundreds of times. So let’s make our fellow developers life easier.

Why clean code?
Simple. Clean code allows us to confidently make changes and deliver more features quickly to our customers.

Don’t forget to subscribe for your regular dose of Java Tutorials!
STOP THE ROT.

Till episode 4,

Philip


In questa pagina del sito puoi guardare il video online Java Clean Code Tutorial #3 - Builder Design Pattern Example della durata di ore minuti seconda in buona qualità , che l'utente ha caricato Philip Starritt 25 gennaio 2017, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 50,261 volte e gli è piaciuto 783 spettatori. Buona visione!