今天就学习课程吧!
今天就开通帐号,24,700 门业界名师课程任您挑!
Builder pattern overview
- [Instructor] The builder pattern is a very common creational design pattern. Its main purpose is to encapsulate and simplify the creation of complex objects, which makes it much easier to create objects that can have many different representations. It also helps to make the construction code more readable, which is really helpful when the objects constructor has a lot of optional parameters or parameters of the same type. And since the object isn't actually constructed until the builder creates it, the problem of having an object be in an inconsistent or invalid state can be prevented. This kind of pattern is useful in scenarios where the object being created has a complex API with many different constructors or properties and where there's a diversity of valid states that the object can be in, depending upon the values of those properties. Using a builder pattern is pretty straightforward. We have a director object,…
内容
-
-
-
-
(已锁定)
Builder pattern overview1 分钟 52 秒
-
(已锁定)
Builder pattern example9 分钟 58 秒
-
(已锁定)
Factory pattern overview1 分钟 40 秒
-
(已锁定)
Factory pattern example6 分钟 12 秒
-
(已锁定)
Singleton pattern overview2 分钟 10 秒
-
(已锁定)
Basic Singleton pattern example3 分钟 17 秒
-
(已锁定)
Making Singleton concurrent-safe3 分钟 44 秒
-
(已锁定)
-
-
-