CF.Objective Notes -- How to Pimp Out Your Model
July 20, 2012
How to Pimp Out Your Model - Scott Stroz
(Scott's talk was great! It was incredibly interactive -- he had this game we all played together, answering questions as the presentation went on. I was sitting up front with a few wise-acres who probably wish to remain anonymous, hence my minimal note-taking during this talk. :) Definitely go watch this preso if you get the chance!)
Why you need to make your model easier to play with
How to determine what goes where
There may be no "right" way to do things, but there is certainly a "wrong" way of doing things.
Don't NEED to use a framework
Can roll your own and still get the same benefits
View--
anything the user interacts with
anything that DETERMINES what the user interacts with
Controller --
ONLY calls to the model
and framework specific code (if you're using a framework)
methods should be small
Model --
Everything else
database interaction
form validation
interacting with other systems
all your "business logic", the "rules" your application must follow
So HOW do I pimp out my model?
Just make sure model code stays out of the view and controller (and vice versa)
The smaller your functions, the easier it is to debug when something goes WRONG
(Scott's talk was great! It was incredibly interactive -- he had this game we all played together, answering questions as the presentation went on. I was sitting up front with a few wise-acres who probably wish to remain anonymous, hence my minimal note-taking during this talk. :) Definitely go watch this preso if you get the chance!)
Why you need to make your model easier to play with
How to determine what goes where
There may be no "right" way to do things, but there is certainly a "wrong" way of doing things.
Don't NEED to use a framework
Can roll your own and still get the same benefits
View--
anything the user interacts with
anything that DETERMINES what the user interacts with
Controller --
ONLY calls to the model
and framework specific code (if you're using a framework)
methods should be small
Model --
Everything else
database interaction
form validation
interacting with other systems
all your "business logic", the "rules" your application must follow
So HOW do I pimp out my model?
Just make sure model code stays out of the view and controller (and vice versa)
The smaller your functions, the easier it is to debug when something goes WRONG