iOS Design Patterns - Part 8: Composition Over | Ray Wenderlich

In this video you'll learn about "composition over inheritance," a design principle used by most design patterns.

This is a companion discussion topic for the original entry at

Hi Joshua, quick question about the ProductDetailsViewController, at 15:42min

in a MVVM design pattern, your network client should not be in the ViewModel and not in the view controller?

it will be easier to script unit test


Thank you for the video.

The duration of the video based on the topic is too long. In this long duration, only 5-6 minutes show - talk about Composition Over Inheritance. In my opinion, another video with the usage of the protocols you suggest will do better for the education purpose.

In the following video explaining the concept of this design concept and the “has a” or “is a” chooser pattern.
Fun way to learn Composition over inheritance Concept (but in javascript!)
[similare text for Comp.Ov.Inher. concept in rubby]

Hi Joshua, I don’t understand the code at 5:27, in the extension AuthTokenProvider, what does self.requestAuthToken do here? Thanks!

@jrg.developer Can you please help with this when you get a chance? Thank you - much appreciated! :]

This requests an authentication token, which is included as a header on the network request. This is a common practice for RESTful services.

For more details, please see this previous video in this series, which goes into authentication used by this app: