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

What this book covers

Chapter 1, Starting with the Protocol, looks at what protocols are and how they are used in the Swift programming language. We will also examine how the protocol can be used to write very flexible and reusable code.

Chapter 2, Our Type Choices, discusses the different types that Swift offers (structs, classes, enums, and tuples). We will look at several examples of when to use the various types and when not too.

Chapter 3, Extensions, looks at how extensions and protocol extensions are used with the Swift programming language. We will look at examples of how extensions can be used with protocol-oriented programming.

Chapter 4, Generics, Apple has stated that Generics is one of the most powerful features of Swift and this chapter will show how powerful Generics is. We will look at how to use Generics to make very flexible types, and also how to implement the Copy-on-Write feature for our custom types.

Chapter 5, Object-Oriented Programming, examines how we would develop characters for a video game, taking an object-oriented approach. In order to really appreciate the ideas behind protocol-oriented programming, we need to understand the problems it is designed to solve. We will then look at the drawbacks with this design.

Chapter 6, Protocol-Oriented Programming, develops the same video game characters from chapter 5, but this time we will take a protocol-oriented approach to the design. We will then compare the object-oriented approach and the protocol-oriented approach to see the advantages that the protocol-oriented approach offers.

Chapter 7, Adopting Design Patterns in Swift, looks at implementing several design patterns using protocol-oriented programming. For each of the design patterns, we will look at the problem they are designed to solve and how to implement the pattern.

Chapter 8, Case Studies, explores two case studies. This chapter is designed to pull everything from the first six chapters together to show the reader how to use protocol-oriented programming in real-world situations.

主站蜘蛛池模板: 东安县| 呼玛县| 阿瓦提县| 新巴尔虎右旗| 南昌县| 万荣县| 富宁县| 惠东县| 和林格尔县| 昌黎县| 修文县| 阿拉善左旗| 鲁甸县| 莲花县| 凯里市| 张家口市| 武山县| 克东县| 山阳县| 商丘市| 酉阳| 诸城市| 资中县| 九寨沟县| 璧山县| 新和县| 乌海市| 阿城市| 兰考县| 彭泽县| 卢湾区| 集贤县| 东丽区| 东港市| 称多县| 乌鲁木齐县| 营山县| 炉霍县| 酒泉市| 屯昌县| 安溪县|