filmov
tv
Java Clean Code Tutorial #3 - Builder Design Pattern Example

Показать описание
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
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
Комментарии