Doug's Resume
OO Lexicon
Chat with Doug!
Recent Entries
You may also be interested in...

heaters
hotels boeken in 7 sec
Engagement Rings
Online Dating Australia




SURF'S UP!
You:
Your Web Site:
<< May, 2008 >>
SMTWTFS
123
45678910
11121314151617
18192021222324
25262728293031
Search Blog

ColdFusion Jobs
Recent Comments
Re: Viewing Option Text (in IE7) that's Wider than the Select List (by Dan Roberts at 5/15 2:38 PM)
Re: Viewing Option Text (in IE7) that's Wider than the Select List (by Dan Roberts at 5/15 10:06 AM)
Re: Inline CSS and Ajax Issue with IE (by Ben Nadel at 5/14 11:50 AM)
Re: The Perfect Alternative to Gas Powered Vehicles (by Thomas Messier at 5/09 12:47 PM)
Re: Promoting Family Unity: Lowering Your Utility Bills! (by Fernando Lopez at 5/07 10:12 PM)
Re: Why I Hate ORMs (a solicited rant) (by Richard at 5/06 10:56 AM)
Re: Why I Hate ORMs (a solicited rant) (by dougboude at 5/06 10:27 AM)
Re: Why I Hate ORMs (a solicited rant) (by Richard at 5/06 6:50 AM)
Re: Why I Hate ORMs (a solicited rant) (by Sean Corfield at 5/06 1:40 AM)
Re: Why I Hate ORMs (a solicited rant) (by Steve Bryant at 5/05 5:07 PM)
Categories
Archives
Photo Albums
Funnies (5)
Family (3)
RSS
Reciprocal Links

Powered by
BlogCFM v1.11

29 June 2006
CFUNITED - MVC Unraveled
I spent the first hour of my morning listening (and gladly so) to Joe Reinhart preaching the need for us all to focus on just comprehending exactly what MVC is. Personally I felt like he started the presentation a few feet over most of the audience's head, using terms that were quite comfortable for him but new to many of us. Not his fault, and to his credit he did take the time to define many of the terms for us. Despite the elevated theme, in our short one hour together he accomplished his task in a two-fold manner: by increasing the audience's vocabulary, and by creating a sample app that used the MVC pattern.

That's right, MVC (Model View Controller) IS an application design pattern used across the board with any object oriented language. It also happens to popularly be known as the king of patterns, itself being an efficient symbiotic relationship between three other patterns of lesser scope and with more focused purpose. The Strategy pattern, Observer pattern, and the Composition pattern are what allow MVC to do what it does so well: keep our application segregated (loosely coupled) while allowing each portion of the app to remain highly specialized and autonomous (encapsulated).

The M in MVC is the Model. This is the portion of the application where nearly (if not all) of the business logic and database access will live. Business rules, queries, special validation...basically, if it has nothing to do with the user interface, then more than likely it will live in the Model. Physically the model will be a collection of CFCs that contain the functionality mentioned previously.

The View is that portion of your app responsible for displaying and gathering data. It knows nothing about the Model, the database, the backend system...it only knows that it will display the data given to it, and it will deliver the data it collects. Physically the View will consist of CFM templates containing primarily just layout information, such as forms, tables, and CSS.

lastly we have the Controller. It's job within the MVC design pattern is nothing more than passing data back and forth between the Model and the View; that's it.

The last 10 minutes (that's right, 10 minutes) of the presentation were spent building an entire basic blog application from scratch. Using the Model-Glue Unity framework and some Eclipse Ant scripts, he quickly was able to add in all of the CRUD (Create, Read, Update, Delete) functionality for blog entries and comments. How was this possible? By leveraging the many hours of hard work that have gone into producing and uniting three frameworks that have been all the buzz lately: Coldspring, Reactor, and Model-Glue. By strategically editing XML configuration files and using such shortcuts as "scaffolding", it is possible to auto-generate what would otherwise take a person days to code by hand.

Witnessing the creation of an entire application in just a few minutes is both exciting and disconcerting. On the one hand, Model-Glue Unity provides the developer with shortcuts that are nothing short of amazing, allowing productivity levels that I believe are unachievable otherwise. On the other hand, I could very well empathisize with the framework opposition camp, seeing how it is they could say that the usage of advanced frameworks such as Model-Glue will lead to the de-evolution of the CF community, removing many of the "needs" that often motivate developers to learn and grow. My own opinion, however, is that although frameworks such as this will allow us developers to become more productive, the convenience of it all will never quench the insatiable curiosity that has driven us up to this point, and we will always be "peeking under the hood" regardless of how much automation we adopt.



Posted by dougboude at 5:58 PM | PRINT THIS POST! |Link | 1 comment
Subscription Options

You are not logged in, so your subscription status for this entry is unknown. You can login or register here.

Re: CFUNITED - MVC Unraveled
Actually, I think frameworks are the CF Community's saving grace. They not only make our jobs as CF coders more efficient, building better more stable code, but it forces us to delve into the world of OO. And that is not at all a bad thing. The last thing we'd want is for spaghetti CF coders to be left behind in the PHP or ASP.NET dust. Plus, an added bonus ActionScript 3 is fully OOed and Flex 2 apps are primarily MVC based, so in the grand scheme of things - CF and CF frameworks fit right in with the direction web programming in general is headed. And that direction is Object Oriented (OO).

Joe Rinehart has a presentation style all his own. I'm a fan.
Posted by Jim Pickering on June 29, 2006 at 7:09 PM

Name:   Required
Email:   Required your email address will not be publicly displayed.

Want to receive notifications when new comments are added? Login/Register for an account.

Time to take the Turing Test!!!

What letter comes four place(s) after the letter Q?
Type your answer exactly two time(s) in the designated box.

Type in the answer to the question you see above:

Your comment:

Sorry, no HTML allowed!