TypeScript Design Patterns
eBook - ePub

TypeScript Design Patterns

Vilic Vane

Share book
  1. 256 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

TypeScript Design Patterns

Vilic Vane

Book details
Book preview
Table of contents
Citations

About This Book

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.

Frequently asked questions

How do I cancel my subscription?
Simply head over to the account section in settings and click on “Cancel Subscription” - it’s as simple as that. After you cancel, your membership will stay active for the remainder of the time you’ve paid for. Learn more here.
Can/how do I download books?
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
What is the difference between the pricing plans?
Both plans give you full access to the library and all of Perlego’s features. The only differences are the price and subscription period: With the annual plan you’ll save around 30% compared to 12 months on the monthly plan.
What is Perlego?
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Do you support text-to-speech?
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Is TypeScript Design Patterns an online PDF/ePUB?
Yes, you can access TypeScript Design Patterns by Vilic Vane in PDF and/or ePUB format, as well as other popular books in Computer Science & Programming. We have over one million books available in our catalogue for you to explore.

Information

Year
2016
ISBN
9781785280832
Subtopic
Programming
Edition
1

TypeScript Design Patterns


TypeScript Design Patterns

Copyright Š 2016 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: August 2016
Production reference: 1240816
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham
B3 2PB, UK.
ISBN 978-1-78528-083-2
www.packtpub.com

Credits

Author
Vilic Vane
Copy Editor
Safis Editing
Reviewer
Wander Wang
Project Coordinator
Suzanne Coutinho
Commissioning Editor
Kunal Parikh
Proofreader
Safis Editing
Acquisition Editor
Denim Pinto
Indexer
Rekha Nair
Content Development Editor
Nikhil Borkar
Graphics
Jason Monteiro
Technical Editor
Hussain Kanchwala
Production Coordinator
Aparna Bhagat

About the Author

Vilic Vane is a JavaScript engineer with over 8 years of experience in web development. He started following the TypeScript project since it went public, and he’s also a contributor of the project. He is now working at Ruff, a startup company building an IoT platform that runs JavaScript on embedded devices.
I want to thank the editors and reviewers, including Wander Wang, for their efforts that made this book possible. I also want to thank my girlfriend, Emi, for not pissing me off when she came for me from her school 1,400 km away but could only have a takeout with me in my apartment due to my always-about-to-start-writing condition.

About the Reviewer

Wander Wang is working at Egret Technology Co., Ltd. as the chief architect of Egret Engine. He also works as a part-time teacher in the School of Software Engineering at Beijing University of Technology. Wang has 7 years of experience in developing web and mobile games, and he currently focuses on the language research and extension of TypeScript. Egret Engine is a popular HTML5 game engine written in TypeScript. There are more than 80,000 developers worldwide who build their web or mobile games on the top of Egret Engine. Wang is also interested in technologies such as React, React-Native, and Electron, and so on.

www.PacktPub.com

eBooks, discount offers, and more

Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at [email protected] for more details.
At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks.
eBooks, discount offers, and more
https://www2.packtpub.com/books/subscription/packtlib
Do you need instant solutions to your IT questions? PacktLib is Packt's online digital book library. Here, you can search, access, and read Packt's entire library of books.

Why subscribe?

  • Fully searchable across every book published by Packt
  • Copy and paste, print, and bookmark content
  • On demand and accessible via a web browser

Preface

It wasn’t a long time ago that many JavaScript engineers or, most of the time, web frontend engineers, were still focusing on solving detailed technical issues, such as how to lay out specific content cross-browsers and how to send requests cross-domains.
At that time, a good web frontend engineer was usually expected to have notable experience on how detailed features can be implemented with existing APIs. Only a few people cared about how to write application-scale JavaScript because the interaction on a web page was really simple and no one wrote ASP in JavaScript.
However, the situation has changed tremendously. JavaScript has become the only language that runs everywhere, cross-platform and cross-device. In the main battlefield, interactions on the Web become more and more complex, and people are moving business logic from the backend to the frontend. With the growth of the Node.js community, JavaScript is playing a more and more important roles in our life.
I am currently working for an IoT company called Ruff that builds a platform for JavaScript to write applications run on embedded devices. You might have seen a fake book cover in the title of Writing Device Drivers in JavaScript, but that is actually a part of what we do.
The boom of JavaScript, however, makes people realize that the language itself might not be powerful enough for applications on a larger scale. While we enjoy the flexibility of the language, we suffer from its lack of static-type information; for instance, consider the following:
  • No static type checking: We have to rely on debugging or tests to get rid of simple errors that could be eliminated when the code is written.
  • Refactoring is a pain: Basically, what the IDEs or editors can do about JavaScript code is renaming local variables or exported module functions at best.
  • Understanding code is difficult: When you grasp a piece of code, you might have to look around and manually search for references just to figure out which properties an object has and what types of property they are. This happens to our own code as well.
Compared to tools such as ESLint and even Flow, which only partially solve the problems, TypeScript does a really good job while it is still sticking to the ECMAScript standard.
TypeScript is indeed an awesome tool for JavaScript. Unfortunately, intelligence is still required to write actually robust, maintainable, and reusable code. But wait, doesn’t the intelligence part involve the true value of our work?
We might all have had trouble finding clues to mysterious bugs, or squeezed our head thinking about how we can add new features to the existing code base. Some of us, with experience and intuition built over the years, may directly come up with a design that’s not bad. For these people, getting through the common design patterns can help gain knowledge of what people have already catalogued over years in the industry or be better understood when discussing software designs with others. For people who have less experience, learning common design patterns may be a more straightforward approach to creating code that’s beautifully designed.

What this book covers

Chap...

Table of contents