This is a companion discussion topic for the original entry at https://www.raywenderlich.com/1941154-fundamental-ios-design-patterns/lessons/19
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. ![]()
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,publicnormally 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. ![]()
In the next version of the book, I’ll propose dropping these keywords for simplicity and to avoid confusion like this. ![]()