万本电子书0元读

万本电子书0元读

顶部广告

TypeScript Design Patterns电子书

售       价:¥

15人正在读 | 0人评论 6.2

作       者:Vilic Vane

出  版  社:Packt Publishing

出版时间:2016-08-01

字       数:253.2万

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

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

为你推荐

  • 读书简介
  • 目录
  • 累计评论(0条)
  • 读书简介
  • 目录
  • 累计评论(0条)
Boost your development efficiency by learning about design patterns in TypeScript About This Book This step-by-step guide will would demonstrate all the important design patterns in practice This book is the only documentation on the market focusing on design patterns in TypeScript This book is packed with rich examples that will improve your efficiency and encourage code reuse Who This Book Is For If you are a TypeScript developer, this book is for you. No knowledge of design patterns is required to read this book. What You Will Learn Understand the challenges and implications of developing an enterprise application Install and configure the necessary tools in order to start developing an application Identify the challenges when developing an application Apply GoF patterns in an application with a testing approach Use and utilize design patterns while developing a TypeScript application or during JavaScript application development Reference to SOLID principles and what their benefits do to your projects Apply various principles in a TypeScript application Improve code quality and development speed In Detail In programming, there are several problems that occur frequently. To solve these problems, there are various repeatable solutions that are known as design patterns. Design patterns are a great way to improve the efficiency of your programs and improve your productivity. This book is a collection of the most important patterns you need to improve your applications’ performance and your productivity. The journey starts by explaining the current challenges when designing and developing an application and how you can solve these challenges by applying the correct design pattern and best practices. Each pattern is accompanied with rich examples that demonstrate the power of patterns for a range of tasks, from building an application to code testing. We’ll introduce low-level programming concepts to help you write TypeScript code, as well as work with software architecture, best practices, and design aspects. Style and approach In this book, design patterns are explained in a step-by-step manner. All the major patterns covered will improve your understanding of TypeScript and the patterns associated with TypeScript.
目录展开

TypeScript Design Patterns

TypeScript Design Patterns

Credits

About the Author

About the Reviewer

www.PacktPub.com

eBooks, discount offers, and more

Why subscribe?

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

Errata

Piracy

Questions

1. Tools and Frameworks

Installing the prerequisites

Installing Node.js

Installing TypeScript compiler

Choosing a handy editor

Visual Studio Code

Configuring Visual Studio Code

Opening a folder as a workspace

Configuring a minimum build task

Sublime Text with TypeScript plugin

Installing Package Control

Installing the TypeScript plugin

Other editor or IDE options

Atom with the TypeScript plugin

Visual Studio

WebStorm

Getting your hands on the workflow

Configuring a TypeScript project

Introduction to tsconfig.json

Compiler options

target

module

declaration

sourceMap

jsx

noEmitOnError

noEmitHelpers

noImplicitAny

experimentalDecorators*

emitDecoratorMetadata*

outDir

outFile

rootDir

preserveConstEnums

strictNullChecks

stripInternal*

isolatedModules

Adding source map support

Downloading declarations using typings

Installing typings

Downloading declaration files

Option "save"

Testing with Mocha and Istanbul

Mocha and Chai

Writing tests in JavaScript

Writing tests in TypeScript

Getting coverage information with Istanbul

Testing in real browsers with Karma

Creating a browser project

Installing Karma

Configuring and starting Karma

Integrating commands with npm

Why not other fancy build tools?

Summary

2. The Challenge of Increasing Complexity

Implementing the basics

Creating the code base

Defining the initial structure of the data to be synchronized

Getting data by comparing timestamps

Two-way synchronizing

Things that went wrong while implementing the basics

Passing a data store from the server to the client does not make sense

Making the relationships clear

Growing features

Synchronizing multiple items

Simply replacing data type with an array

Server-centered synchronization

Synchronizing from the server to the client

Synchronizing from client to server

Synchronizing multiple types of data

Supporting multiple clients with incremental data

Updating the client side

Updating server side

Supporting more conflict merging

New data structures

Updating client side

Updating the server side

Things that go wrong while implementing everything

Piling up similar yet parallel processes

Data stores that are tremendously simplified

Getting things right

Finding abstraction

Implementing strategies

Wrapping stores

Summary

3. Creational Design Patterns

Factory method

Participants

Pattern scope

Implementation

Consequences

Abstract Factory

Participants

Pattern scope

Implementation

Consequences

Builder

Participants

Pattern scope

Implementation

Consequences

Prototype

Singleton

Basic implementations

Conditional singletons

Summary

4. Structural Design Patterns

Composite Pattern

Participants

Pattern scope

Implementation

Consequences

Decorator Pattern

Participants

Pattern scope

Implementation

Classical decorators

Decorators with ES-next syntax

Consequences

Adapter Pattern

Participants

Pattern scope

Implementation

Consequences

Bridge Pattern

Participants

Pattern scope

Implementation

Consequences

Façade Pattern

Participants

Pattern scope

Implementation

Consequences

Flyweight Pattern

Participants

Pattern scope

Implementation

Consequences

Proxy Pattern

Participants

Pattern scope

Implementation

Consequences

Summary

5. Behavioral Design Patterns

Chain of Responsibility Pattern

Participants

Pattern scope

Implementation

Consequences

Command Pattern

Participants

Pattern scope

Implementation

Consequences

Memento Pattern

Participants

Pattern scope

Implementation

Consequences

Iterator Pattern

Participants

Pattern scope

Implementation

Simple array iterator

ES6 iterator

Consequences

Mediator Pattern

Participants

Pattern scope

Implementation

Consequences

Summary

6. Behavioral Design Patterns: Continuous

Strategy Pattern

Participants

Pattern scope

Implementation

Consequences

State Pattern

Participants

Pattern scope

Implementation

Consequences

Template Method Pattern

Participants

Pattern scope

Implementation

Consequences

Observer Pattern

Participants

Pattern scope

Implementation

Consequences

Visitor Pattern

Participants

Pattern scope

Implementation

Consequences

Summary

7. Patterns and Architectures in JavaScript and TypeScript

Promise-based web architecture

Promisifying existing modules or libraries

Views and controllers in Express

Abstraction of responses

Abstraction of permissions

Expected errors

Defining and throwing expected errors

Transforming errors

Modularizing project

Asynchronous patterns

Writing predictable code

Asynchronous creational patterns

Asynchronous middleware and hooks

Event-based stream parser

Summary

8. SOLID Principles

Single responsibility principle

Example

Choosing an axis

Open-closed principle

Example

Abstraction in JavaScript and TypeScript

Refactor earlier

Liskov substitution principle

Example

The constraints of substitution

Interface segregation principle

Example

Proper granularity

Dependency inversion principle

Example

Separating layers

Summary

9. The Road to Enterprise Application

Creating an application

Decision between SPA and "normal" web applications

Taking team collaboration into consideration

Building and testing projects

Static assets packaging with webpack

Introduction to webpack

Bundling JavaScript

Loading TypeScript

Splitting code

Loading other static assets

Adding TSLint to projects

Integrating webpack and tslint command with npm scripts

Version control

Git flow

Main branches

Supporting branches

Feature branches

Release branches

Hotfix branches

Summary of Git flow

Pull request based code review

Configuring branch permissions

Comments and modifications before merge

Testing before commits

Git hooks

Adding pre-commit hook automatically

Continuous integration

Connecting GitHub repository with Travis-CI

Deployment automation

Passive deployment based on Git server side hooks

Proactive deployment based on timers or notifications

Summary

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

发表评论

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

买过这本书的人还买过

读了这本书的人还在读

回顶部