
TypeScript 4 Design Patterns and Best Practices
By :

TypeScript supports multiple programming paradigms. A programming paradigm is a way that a language supports and promotes language features such as immutability, abstractions, or function literals.
OOP is a programming paradigm where objects are first-class citizens. Objects are a concept that we use to describe things that contain data and ways to retrieve the data. Usually, you try to design objects that model the real world or a domain primitive. For example, if you are trying to model a real user into a type, then we create a User
class containing the data that you want to capture for that user.
The four principles of OOP are encapsulation, abstraction, inheritance, and polymorphism. We'll start explaining those principles one by one.
Abstraction is a way of having implementation details hidden from the client or the user of an object. You can implement abstract entities to provide an interface of allowed operations and then we can...