Assuming there is a ZF 1.0 and I am a developer totally onboard with the
MVC mantra, where can I go to understand how to start THINKING in the
right frame of mind about my project? What I mean is, in the framework
world, the design patterns library explains to us how to speak about
problems and their solutions, but how does that relate to my project?
In the current php world, if people are new to frameworks in general,
there is a good chance they are coming from a procedural frame of mind
(this .php page handles this task in these steps). I will be mailing
out these questions to the zf-general (subject: Understanding Web MVC
Applications / __ ) every so often to get community feedback on
approaching new developers (perhaps tutorials) with the framework,
especially geared towards the non-OOP developer that needs to get
his/her head around the framework idea.
In this mailing, I want to tackle the question of controller/action
organization. While I can get all the technical information on
controllers and actions I need to get from the manual, I need to
understand how they relate to my project.
My Simple University Project:
Members are:
Students
Professors
Classes
Organizations
There exist a database that has been designed to handle these members
(its schema is not relevant to this discussion).
The important thing to know is that this project needs to accomplish 2
things currently:
1. data entry of all members
2. creating reports:
* Organizational Roll Call
* Class Role Call
* All Professors
* All Students
* all male students / all female
* etc.
Knowing the problem, how do I go about organizing my code into
controllers and actions that can handle this application? Do I have a
"DataEntryController"? Do I have a controller per Member, eg:
StudentController, ClassController, etc.. Do I have a ReportController,
or do I have a controller per report? If I have a controller per
Member, is it safe to say that each controller would have the actions
save, delete, new, view? Or something similar to round out the CRUD'ness
of these memebers?
All input are welcome, the idea is simply to start understanding how to
present the MVC OO idea to non OO people.
(Also, I often question these things myself.. like, what does everyone
else do, and which is the best way to make the code most clear for the
next guy when/if I get hit by a bus).
-Ralph