15 Add and remove custom methods
This chapter covers
- How to manage many-to-many relationships implicitly
- The benefits and drawbacks of implicit rather than explicit association
- How to use custom methods to associate resources together
- Handling issues with data integrity of associated resources
In this chapter, we’ll explore an alternative pattern for modeling many-to-many relationships that relies on custom add and remove methods to associate (and disassociate) two resources. This pattern allows consumers to manage many-to-many relationships without introducing a third association resource as a necessary requirement.
15.1 Motivation
As we learned in chapter 14, sometimes we have a need to keep track of the relationships between resources, ...
Get API Design Patterns 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.