- 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.
- Designing Purpose:Built Drones for Ardupilot Pixhawk 2.1
- Containerization with LXC
- Persistence in PHP with the Doctrine ORM
- Arch Linux Environment Setup How-to
- 嵌入式應(yīng)用程序設(shè)計綜合教程(微課版)
- Linux內(nèi)核觀測技術(shù)BPF
- 操作系統(tǒng)分析
- ElasticSearch Cookbook
- 跟老男孩學Linux運維:Shell編程實戰(zhàn)
- CentOS 6 Linux Server Cookbook
- Linux網(wǎng)絡(luò)操作系統(tǒng)項目教程(RHEL 7.4/CentOS 7.4)(第3版)(微課版)
- 完美應(yīng)用Ubuntu(第2版)
- OpenHarmony開發(fā)與實踐:基于紅莓RK2206開發(fā)板
- Azure Resource Manager Templates Quick Start Guide
- BuddyPress Theme Development