Chapter 6. Understanding MVC groups
We touched on the subject of MVC groups in previous chapters. As a matter of fact, we covered each of the default individual members in the last three chapters. But there’s more to groups than what you’ve seen so far. At this point, you know that a group comprises model, view, and controller members, each of which follows a naming convention. But did you know you can define additional members in a group that don’t necessarily follow the MVC pattern? Or that you can define a group with only a view and a model? Also, recall from the first example in this book that you can programmatically create new group instances on the fly, not just use those initialized by default upon application startup.
In this chapter, we’ll discuss all these features and more. Our goal is to help you gain a better understanding of the inner workings of MVC groups.
Let’s begin the journey by recapping how MVC groups can be created and how they behave. Some cautionary advice: the first two sections explain in detail what the framework does when instantiating and managing groups. If you’re only interested in working with MVC groups directly, you can skim through these sections to get a basic understanding of the underlying mechanism and jump directly to section 6.3. Of course, we recommend that you visit sections 6.1 and 6.2 if you have doubts or concerns about the topics they discuss.