官术网_书友最值得收藏!

Chapter 1. Creational Patterns

The creational patterns are designed to deal with the object creation mechanism in software designing. A system using these patterns becomes independent of how objects are created, which means it is independent of how concrete classes are instantiated.

These patterns encapsulate the use of concrete classes and favor the use of interfaces in the relationship between objects, allowing to have better abstraction of the global system conception.

Thus, if we analyze the singleton pattern, a pattern designed to instantiate only one instance of a class, we find that the mechanism that controls the unique access to this instance is fully encapsulated in the class, which means that this is completely transparent to the client consuming the instance of the class.

In this chapter, we will introduce you to the five creational patterns and discuss how we can use them with Swift:

  • The prototype pattern
  • The factory method pattern
  • The singleton pattern
  • The abstract factory pattern
  • The builder pattern

The objectives of these patterns are described in the following table:

主站蜘蛛池模板: 忻州市| 津市市| 荔波县| 东阳市| 阿拉善左旗| 和龙市| 增城市| 云浮市| 德阳市| 奉新县| 民勤县| 会昌县| 揭东县| 太保市| 乌拉特后旗| 阿合奇县| 丰台区| 藁城市| 苍溪县| 南丰县| 房山区| 长岛县| 文山县| 马山县| 盘锦市| 个旧市| 宣武区| 浦县| 中西区| 通榆县| 仪陇县| 扎兰屯市| 墨竹工卡县| 英超| 南充市| 革吉县| 丰宁| 关岭| 容城县| 龙井市| 仁寿县|