This course dives into object-oriented TypeScript code, teaching you about object-oriented principles and how they can be applied to your TypeScript applications. Learn about objects, classes, inheritance, abstract classes, interfaces, and more.
TypeScript supports many different ways to define and create objects which can be confusing especially when you're new to the language. Should you use a constructor function, Object.create(), classes, a coding pattern, or some other technique when creating objects? In this course, Creating Object-oriented TypeScript Code, you'll learn different ways to create objects while focusing on object-oriented programming (OOP) techniques that can be used to maximize reuse and enhance productivity. First, you'll explore the core principles of object-oriented programming, such as encapsulation, polymorphism, inheritance, and abstraction, and see how they can be applied and used. Next, you'll discover how to define and instantiate classes in TypeScript, understand what members can be added to a class and the role they play. Then, you'll delve into how inheritance can be used to promote reuse, and what an abstract class is and why you'd use one. Finally, you'll learn about the role of interfaces and how they can be used to create code contracts that drive consistency across a set of objects and enable polymorphic behavior. When you're finished with this course, you'll have the skills and knowledge needed to build robust object-oriented applications using the TypeScript language and understand when and why to apply object-oriented programming principles.
Course Overview Hi there, and welcome to the Creating Object-oriented TypeScript Code course. My name's Dan Wahlin, and I'm a software developer, architect, and trainer, specializing in web development technologies. I've had the opportunity to use TypeScript extensively over the years, and I'm really excited to share more about the language with you. The overall goal of this course is to teach you about object-oriented principles, and how they can be used in your TypeScript applications. The course starts out by examining the role of objects, and the different techniques that can be used to create them. You'll also be introduced to key object- oriented principles, including abstraction, encapsulation, inheritance, and polymorphism. One of the key building blocks available in object-oriented programming is classes. You'll learn about what a class is, how to define and instantiate one, and how to add instance and static members to a class. Productivity techniques such as automatic properties will also be covered along the way. From there you'll learn about what inheritance is, and the role of abstract classes. You'll see how abstract classes can be used as the foundation for other classes, and how they can be used to add polymorphic behavior to objects. As the course progresses, you'll also learn about interfaces, and how they can be used as code contracts to drive consistency across objects, or to find the shape of an object. You'll then see how to implement an interface on a class, and how to use one to provide more flexibility for constructors and methods. Finally, you'll see how to put all of the concepts together so that you understand the role each object-oriented principle can play, and more importantly, understand when and when not to use them. So let's get started by talking about the specific modules covered in the course, and dive into the role objects can play in TypeScript applications.