Cargando…

Swift 3 Protocol-Oriented Programming /

Annotation

Detalles Bibliográficos
Clasificación:Libro Electrónico
Autor principal: Hoffman, Jon (Autor)
Formato: Electrónico eBook
Idioma:Inglés
Publicado: Birmingham : Packt Publishing, 2016.
Edición:Second edition.
Temas:
Acceso en línea:Texto completo
Tabla de Contenidos:
  • Cover; Copyright; Credits; About the Author; About the Reviewer; www.PacktPub.com; Table of Contents; Preface; Chapter 1: Object-Oriented and Protocol-Oriented Programming; What is object-oriented programming?; Requirements for the sample code; Swift as an object-oriented programming language; Drawbacks to object-oriented design; 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 superclassesImplementing vehicle types; The winner is ... ; Summary; Chapter 2: Our Type Choices; The class; The structure; Access controls; The enumerations; The tuple; Protocols; Value and reference types; Recursive data types for reference types only; Inheritance for reference types only; Swift's built-in data types and data structures; Summary; Chapter 3: Catching Our Errors; Using the guard statement; Error handling; Error handling with return values; Error handling with do-catch; Representing errors; Throwing errors; Catching errors.
  • Using the defer statementWhen to use error handling; Summary; Chapter 4: All About 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 and developing with protocols; Summary; Chapter 5: Lets Extend Some Types; Defining an extension; Protocol extensions; Text validation; Summary; Chapter 6: Working with Generics; Generic functions.
  • Type constraints with genericsGeneric types; Associated types; Generics in a protocol-oriented design; Summary; Chapter 7: 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 patternUnderstanding 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.