- Design Patterns and Best Practices in Java
- Kamalmeet Singh Adrian Ianculescu LUCIAN PAUL TORJE
- 92字
- 2021-06-25 20:52:34
Simplified builder pattern
In some implementations of the builder pattern, the Director class can be removed. In our class example, the logic it encapsulates is quite simple, so in that case we don't really need a director. In this case, the simplified builder pattern would look like this:

The code that was implemented in the Director class is simply moved to the Client. This change is not recommended when the Builder and Product classes are too complex or when the builder is used to build an object from a stream of data.
推薦閱讀
- 測試驅(qū)動開發(fā):入門、實戰(zhàn)與進(jìn)階
- 深度學(xué)習(xí)經(jīng)典案例解析:基于MATLAB
- MySQL數(shù)據(jù)庫應(yīng)用與管理 第2版
- ASP.NET Core 5.0開發(fā)入門與實戰(zhàn)
- 基于Java技術(shù)的Web應(yīng)用開發(fā)
- 實用防銹油配方與制備200例
- 精通Python設(shè)計模式(第2版)
- Teaching with Google Classroom
- Express Web Application Development
- C#程序設(shè)計教程(第3版)
- Machine Learning With Go
- Advanced Python Programming
- Angular Design Patterns
- 高效使用Greenplum:入門、進(jìn)階與數(shù)據(jù)中臺
- 第五空間戰(zhàn)略:大國間的網(wǎng)絡(luò)博弈