© The Author(s), under exclusive license to APress Media, LLC , part of Springer Nature 2021
D. TangPro Ember Datahttps://doi.org/10.1007/978-1-4842-6561-1_13

13. Polymorphic Relationships

David Tang1  
(1)
Playa Vista, CA, USA
 

In this chapter, we will look at polymorphism and how it relates to Ember Data. If we look up the definition of polymorphism as it relates to programming, we’ll see it described as “the ability of an object to take on many forms.” For example, a product could come in the form of a book or a course. In an Ember application, we would have a book model and a course model that extend from a base product model. If we extend the definition of polymorphism to relationships in our Ember Data models, it means our relationships can hold ...

Get Pro Ember Data: Getting Ember Data to Work with Your API 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.