Group Group Group Group Group Group Group Group Group

Use Memento | raywenderlich.com


This is a companion discussion topic for the original entry at https://www.raywenderlich.com/1941154-fundamental-ios-design-patterns/lessons/19

why do we use public final classes for care takers?

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

Strictly speaking, they aren’t required. :wink:

The keywords themselves mean:

  • public – the type is accessible within this module and outside it (the “module” is the app here)

  • final - the type is NOT subclassable, either within or without this module (without this keyword, public normally is subclassable, within the current module).

This is the behavior you want for this particular type.

… With that said, none of the above is “super critical” for this type. :sweat_smile:

In the next version of the book, I’ll propose dropping these keywords for simplicity and to avoid confusion like this. :smiley: