Another why ask why (RMDocument naming)


#1

So, now that I have a PreferenceController, and an AppController (and an AboutController in the earlier separate challenge, which I did two different ways just because I’m like that), I’m kind of wondering why RMDocument is not called RMDocumentController. It seems to serve a similar function. Although, looking at the Apple documentation, I see there is an NSDocumentController class that serves a different (but related) function. Is this just a case where the naming convention sort of ran out of space? Or am I way off base here?


#2

It’s not officially a controller. All in all, the RMDocument subclass is merely an extension of what you see on the XIB.

Remember the MVC model?

M)odel = (none really in this app)
V)iew = Document i.e. RMDocument
C)ontroller = App Controller

The reason why there isn’t an individual Document Controller is because it all revolves around one document so there is no greater need for ‘control’ of the documents. When you start talking about multiple documents (despite this app so far having the ability), it’s not complex enough to go that far. PLus don’t forget that Aaron is spoonfeeding as he goes along. If he were to dump all of the complexities on people at once, there’d be a HUGE mass confusion as to ‘what the hell is going on’.

Another analogy is: If you have a country lane, single lane, no pedestrian crossings (the document), would there be need for a streetlight or a police officer to control traffic (controller).

Hope this helped :slight_smile:

Cheers,

A