万本电子书0元读

万本电子书0元读

顶部广告

Swift 2 Design Patterns电子书

售       价:¥

1人正在读 | 0人评论 9.8

作       者:Julien Lange

出  版  社:Packt Publishing

出版时间:2015-10-28

字       数:155.7万

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

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

为你推荐

  • 读书简介
  • 目录
  • 累计评论(0条)
  • 读书简介
  • 目录
  • 累计评论(0条)
Build robust and scalable iOS and Mac OS X game applicationsAbout This BookLearn to use and implement the 23 Gang of Four design patterns using Swift 2Design and architect your code for Swift application developmentUnderstand the role, generic UML design, and participants in the class diagram of the pattern by implementing them in a step-by-step approach Who This Book Is For This book is intended for competent Swift developers who want to apply enduring design patterns with Swift to structure and scale their application code.What You Will LearnChoose the appropriate pattern depending on the problem to be solvedUnderstand the generic class diagram of each of the 23 GoF patterns and how each object participates in the patternUse Swift to implement these patterns even though the language doesn’t provide all of the object-oriented programming concepts such as abstract class, interface, and so onArchitect your software to avoid the overuse of memory, time spent on calculations, or high network trafficFind the best way to organize your code to make it more secure from the outside worldPrepare your code to make it more flexible when the consumer changes or the third-party component hidden code changesStructure your code to change the algorithm to apply at runtimeDeliver Flyweight responsibility to your objects In Detail Swift is a multi-paradigm language. It has expressive features familiar to those used to work with modern functional languages, while also keeping the object-oriented features of Objective-C. It remains compatible with Apple’s legacy codes and frameworks. A design pattern systematically names, motivates, and explains a general design that addresses a recurring design problem in object-oriented systems. It describes the problem, the solution, when to apply the solution, and its consequences. It also gives implementation hints and examples. Knowledge about design patterns is also one of the best ways to make you different compared to other low-level developers. This book shows you how to use Swift 2 to learn about 23 Gang of Four (GoF) design patterns, and is organized into three categories. The book will present you the five creational patterns, followed by the seven structural patterns, and finishing with the 11 behavioral patterns as defined by the GoF. Each chapter will introduce the pattern by defining its role, which common problems the pattern should be used for, its generic UML representation, how each objects presented in the class diagram participate in the pattern, and what the role of each of these objects is. The book then presents you with a concrete case as an illustration that will be used to implement the pattern using Swift.Style and approach A step-by-step tutorial completed with screenshots and code highlights wherever necessary. Each chapter discusses one or more patterns with its definitions and a simple-to-follow illustration case using a playground or XCText project to implement it with Swift.
目录展开

Swift 2 Design Patterns

Table of Contents

Swift 2 Design Patterns

Credits

About the Author

About the Reviewers

www.PacktPub.com

Support files, eBooks, discount offers, and more

Why subscribe?

Free access for Packt account holders

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

eBooks, discount offers, and more

Questions

1. Creational Patterns

The prototype pattern

Roles

Design

Participants

Collaborations

Illustration

Implementation

Usage

The factory method pattern

Roles

Design

Participants

Illustration

Implementation

Usage

The singleton pattern

Roles

Design

Participants

Collaborations

Illustration

Implementation

Usage

The abstract factory pattern

Roles

Design

Participants

Collaborations

Illustration

Implementation

Usage

The builder pattern

Roles

Design

Participants

Collaborations

Illustration

Implementation

Usage

Implementation using closures

Summary

2. Structural Patterns – Decorator, Proxy, and Bridge

Static and dynamic composition

The decorator pattern

Roles

Design

Participants

Collaboration

Sample

Implementation

Usage

The proxy pattern

Roles

Design

Participants

Collaboration

Illustration

Implementation

Usage

The bridge pattern

Roles

Design

Participants

Collaboration

Illustration

Implementation

Usage

Summary

3. Structural Patterns – Composite and Flyweight

The composite pattern

Roles

Design

Participants

Collaboration

Illustration

Implementation

Implementation of the VODComponent

Implementation of the VODItem leaf

Implementation of the VODCategory composite

Usage

The flyweight pattern

Roles

Design

Participants

Collaboration

Illustration

Implementation

Usage

Performance results

Summary

4. Structural Patterns – Adapter and Facade

The adapter pattern

Roles

Design

Participants

Collaboration

Illustration

Implementing our first prototype

Implementation

Implementation of our adaptees

Implementation of the SamSingAdapter class

Implementation of the PearAdapter class

The facade pattern

Roles

Design

Participants

Collaboration

Illustration

Implementation of the facade

Summary

5. Behavioral Patterns – Strategy, State, and Template Method

The strategy pattern

Roles

Design

Participants

Collaboration

Illustration

Implementation

The state pattern

Role

Design

Participants

Collaboration

Illustration

Implementation

The template method

Role

Design

Participants

Collaboration

Illustration

Implementation

Summary

6. Behavioral Patterns – Chain of Responsibility and Command

The chain of responsibility pattern

Roles

Design

Participants

Collaboration

Illustration

Implementation

The command pattern

Roles

Design

Participants

Collaboration

Illustration

Implementation

Comparison between the chain of responsibility and command patterns

Summary

7. Behavioral Patterns – Iterator, Mediator, and Observer

The iterator pattern

Roles

Design

Participants

Collaboration

Illustration

Implementation

The mediator pattern

Roles

Design

Participants

Collaboration

Illustration

Implementation

The observer pattern

Roles

Design

Participants

Collaboration

Illustration

Implementation

Summary

8. Behavioral Patterns – Visitor, Interpreter, and Memento

The visitor pattern

Roles

Design

Participants

Collaboration

Illustration

Implementation

The interpreter pattern

Roles

Design

Participants

Collaboration

Illustration

Implementation

The memento pattern

Roles

Design

Participants

Collaboration

Illustration

Implementation

Comparing the three patterns

Summary

Index

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

发表评论

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

买过这本书的人还买过

读了这本书的人还在读

回顶部