-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating
TypeScript 5 Design Patterns and Best Practices - Second Edition
By :
When developers transition to TypeScript from other languages, they often bring coding patterns and idioms that may not be ideal in TypeScript. Although many programming concepts are shared between many languages, such as control loops, classes, and functions, there are many other concepts particular to one language that cannot be used in a different language.
In the next subsections, we show some obvious cases where using some idiomatic constructs from other languages will not work well with TypeScript, starting first with the Java language.
Java developers often use Plain Old Java Objects (POJOs) or JavaBeans. Let’s look at how this pattern might be inappropriately applied in TypeScript and then how to improve it.
POJO is a naming convention for creating a class that follows some rules, especially in the context of Java EE where object serialization is crucial for some operations. The more standardized...