I now see it's analogous to MFC's Document/View architecture...well sorta'
Anyways...I have a few questions in regards to MVC most specifically when used in web development...
First off...I really like template approach...so why then would I switch to MVC?
Remember I have very little understanding of MVC and I've been using template style techniques in web development for the last 5-6 years...so pardon my being ignorant or stubborn to change
I get the paradigm concept...separate objects to deal with:
1) Controller - User input
2) View - Output
3) Model - Data
I get why each communicates (or doesn't communicate) with each other...but template frameworks accomplish much the same thing...
In Smarty for instance...I can have a single script which loads a (view-port) template based on user input...keeping all business logic inside this script, plus a pseudo controller (ie: Action Request Handler or whatever you might call it).
So business logic and controller (ARH) reside in the same script, the visual output is kept almost entirely separate. Tada...I've accomplished separation of Interface vs Implementation...
It's no secret HTML and code when mashed together makes for a hard to read program and messy as hell...it's like coding with GOTO
Anyways, to further strengthen my case...HTTP doesn't facilitate it self nicely to MVC IMHO. The reason being - the way user input is sent to the program.
I can emulate a MVC approach by doing what I said above...having the business logic stored in a /scripts/ directory and invocation of that action/business logic script done implicitly via HTML FORM's action attribute...
This way, most business logic (adding, removing, updating members, etc...) can be stored in small nicely written scripts which do nothing more than Update, Delete, Create...and then redirect back to the index.php to regenerate the viewport...
index.php is responsible for generating a display by selecting a template based on user's request...
So I guess what i'm asking is given what i've described above...how would a MVC framework like Mojavi be any better???
From what i can tell - I have basically achieved MVC using not a PHP library (I actually don't use smarty - but bTemplate for speed and flexibility) other then a templating engine.
1) index.php is the viewport - selecting templates
2) HTML intrinsically handles business logic invocation via FORM action attribute
The model doesn't really exist in my proposed approach...seeing how each script (Update, Create, Delete, etc...) would likely just require knowledge of the same SQL table and perform a direct SQL call.
But I am quite OK with that...cuz this far over the years this technique has served me well...but regardless I"m curious...
1) Can someone explain how MVC would make my job easier when dealing with a Member (update, delete, create, etc...) type application???
2) How does MVC support a model when dealing with a SQL table???
I"m not sure if I've made complete sense...it's 12:11 here and I have to be up at 6
But if you can make half fast sense of what i'm asking and can answer me or at least offer me suggestions or comments...please do
Cheers