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

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:

主站蜘蛛池模板: 西峡县| 汝阳县| 陆良县| 云阳县| 安阳县| 牡丹江市| 福安市| 商洛市| 镇康县| 丰城市| 额敏县| 望城县| 葫芦岛市| 普安县| 胶州市| 壤塘县| 新泰市| 开平市| 科技| 兴国县| 平武县| 南昌市| 进贤县| 漳州市| 封开县| 资阳市| 织金县| 五指山市| 库尔勒市| 南开区| 旅游| 温泉县| 肃宁县| 嘉峪关市| 麦盖提县| 礼泉县| 响水县| 孙吴县| 辽阳县| 白沙| 易门县|