万本电子书0元读

万本电子书0元读

顶部广告

Swift 4 Protocol-Oriented Programming - Third Edition电子书

售       价:¥

9人正在读 | 0人评论 9.8

作       者:Jon Hoffman

出  版  社:Packt Publishing

出版时间:2017-10-06

字       数:29.4万

所属分类: 进口书 > 外文原版书 > 电脑/网络

温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印

为你推荐

  • 读书简介
  • 目录
  • 累计评论(0条)
  • 读书简介
  • 目录
  • 累计评论(0条)
Build fast and powerful applications by harnessing the power of protocol-oriented programming in Swift 4 About This Book ? Leverage the power of protocol-oriented programming in your applications and learn from real-world use cases ? Create a flexible code base with protocols and protocol extensions ? Leverage the power of generics in Swift 4 to create very flexible frameworks Who This Book Is For This book is for Swift developers who want to learn and implement protocol-oriented programming in their real-world applications.. What You Will Learn ? Understand the differences between object-oriented programming and protocol-oriented programming ? Explore the different types that Swift offers and what pitfalls to avoid ? Delve into generics and generic programming ? Learn how to implement Copy-On-Write within your custom types ? Implement several design patterns in a protocol-oriented way ? Design applications by prioritizing the protocol first and the implementation types second In Detail Swift has become the number one language used in iOS and macOS development. The Swift standard library is developed using protocol-oriented programming techniques, generics, and first-class value semantics; therefore, every Swift developer should understand these powerful concepts and how to take advantage of them in their application design. This book will help you understand the differences between object-oriented programming and protocol-oriented programming. It will demonstrate how to work with protocol-oriented programming using real-world use cases. You will gain a solid knowledge of the various types that can be used in Swift and the differences between value and reference types. You will be taught how protocol-oriented programming techniques can be used to develop very flexible and easy-to-maintain code. By the end of the book, you will have a thorough understanding of protocol-oriented programming and how to utilize it to build powerful and practical applications. Style and approach This book is written for developers who learn best by working with code, so every concept discussed in this book is reinforced with real code examples.
目录展开

Title Page

Third Edition

Copyright

Swift 4 Protocol-Oriented Programming

Third Edition

Credits

About the Author

About the Reviewer

www.PacktPub.com

Why subscribe?

Customer Feedback

Preface

What this book covers

What you need for this book

Who this book is for

Conventions

Reader feedback

Customer support

Downloading the example code

Downloading the color images of this book

Errata

Piracy

Questions

Starting with the Protocol

Protocol syntax

Defining a protocol

Property requirements

Method requirements

Optional requirements

Protocol inheritance

Protocol composition

Using protocols as a type

Polymorphism with protocols

Type casting with protocols

Associated types with protocols

Delegation

Designing with protocols

Protocols in the Swift standard library

Summary

Our Type Choices

Classes

Structures

Access controls

Enumerations

Tuples

Protocols

Value and reference types

Recursive data types for reference types only

Inheritance for reference types only

Dynamic dispatch

Swift's built-in types

Copy-on-write

Summary

Extensions

Defining an extension

Protocol extensions

Text validation

Extensions with the Swift standard library

Conforming to the Equatable protocol

Summary

Generics

Generic functions

Type constraints with Generics

Generic types

Associated types

Generic subscripts

Copy-on-write

Generics in a protocol-oriented design

Generics in the Swift standard library

Summary

Object-Oriented Programming

What is object-oriented programming?

Requirements for the sample code

Swift as an object-oriented programming language

Issues with the object-oriented design

Summary

Protocol-Oriented Programming

Requirements for the sample code

Swift as a protocol-oriented programming language

Summarizing protocol-oriented programming and object-oriented programming

Differences between object-oriented programming and protocol-oriented programming

Protocol and protocol extensions compared with superclasses

Implementing vehicle types

Using value and reference types

The winner is...

Summary

Adopting Design Patterns in Swift

What are design patterns?

Creational patterns

The singleton design pattern

Understanding the problem

Understanding the solution

Implementing the singleton pattern

The builder design pattern

Understanding the problem

Understanding the solution

Implementing the builder pattern

The factory method pattern

Understanding the problem

Understanding the solution

Implementing the factory method pattern

Structural design patterns

The bridge pattern

Understanding the problem

Understanding the solution

Implementing the bridge pattern

The facade pattern

Understanding the problem

Understanding the solution

Implementing the facade pattern

The proxy design pattern

Understanding the problem

Understanding the solution

Implementing the proxy pattern

Behavioral design patterns

The command design pattern

Understanding the problem

Understanding the solution

Implementing the command pattern

The strategy pattern

Understanding the problem

Understanding the solution

Implementing the strategy pattern

The observer pattern

Understanding the problem

Understanding the solution

Implementing the observer pattern

Summary

Case Studies

Logging service

Requirements

The design

Conclusion

Data access layer

Requirements

The design

Data model layer

Data helper layer

Bridge layer

Using the data access layer

Conclusion

Summary

累计评论(0条) 0个书友正在讨论这本书 发表评论

发表评论

发表评论,分享你的想法吧!

买过这本书的人还买过

读了这本书的人还在读

回顶部