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 into the object-oriented nature of Dart, and find some new techniques and insights.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset