Chapter 4. Object Orientation

In this chapter, we will cover the following recipes:

  • Testing and converting types
  • Comparing two objects
  • Using a factory constructor
  • Building a singleton
  • Using reflection
  • Using mixins
  • Using annotations
  • Using the call method
  • Using noSuchMethod
  • Creating toJSON and fromJSON methods in your class
  • Creating common classes for client and server apps

Introduction

Dart, although optionally typed, is an object-oriented language like Ruby, so it is an object. This is in contrast to JavaScript, where object orientation is not inherent in the language and was added later in different ad hoc ways. We can expect huge benefits from working with a real object-oriented language to build our client web applications. So, let's delve a bit deeper ...

Get Dart: Scalable Application Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.