- Advanced TypeScript Programming Projects
- Peter O'Hanlon
- 217字
- 2021-06-24 13:27:10
Summary
In this chapter, we have built an application that responded to what the user was typing into a text area, and updated a label with converted text. The conversion of this text was handled by classes, each of which had a single responsibility. The reason we concentrated on producing classes that only did one thing was to learn, right from the start, how to use industry best practices to make our code cleaner and less prone to errors, since a well-designed class that only does one thing is less likely to have problems than classes that do lots of different things.
We introduced the visitor and chain-of-responsibility patterns in order to see how we could separate the text processing into deciding whether a line contained markdown and adding the appropriate HTML-encoded text. We started introducing patterns because patterns occur in so many different software development problems. Not only do they provide clear details about how to solve a problem; they also provide a clear language so that if someone says that a piece of code needs a particular pattern, there is no ambiguity for other developers about what that code needs to do.
In the next chapter, we are going to look at our first application using React.js, for when we build a personal contacts manager.
- Linux系統(tǒng)架構(gòu)與運維實戰(zhàn)
- VMware Horizon View 6 Desktop Virtualization Cookbook
- Windows Server 2012 Hyper-V Cookbook
- 構(gòu)建可擴展分布式系統(tǒng):方法與實踐
- Python基礎(chǔ)教程(第3版)
- Windows Phone 8 Application Development Essentials
- Learning Bootstrap
- 嵌入式系統(tǒng)原理及開發(fā)
- AutoCAD 2014中文版從入門到精通
- 深入淺出Node.js
- Social Data Visualization with HTML5 and JavaScript
- INSTANT Galleria Howto
- 程序員必讀經(jīng)典(算法基礎(chǔ)+計算機系統(tǒng))
- Unity AR/VR開發(fā):實戰(zhàn)高手訓(xùn)練營
- 鴻蒙應(yīng)用開發(fā)實戰(zhàn)