Welcome Guest, Not a member yet? Register   Sign In
Model as both a database and data abstraction layer
#1

[eluser]Unknown[/eluser]
I was having issues working with MVC as I was under the impression that Models should only be used for manipulating the database. I really don't know if MVC wants it that way or we, as programmers, decides what's best.

User guide(not sure if I read it there) hints that we may do away without a Model. So I'm thinking, no official guideline(use of models) exists for the community in contrast to CI dedicating a whole page for Coding style guidelines.

I just confirmed that most, even those who has written books for CI, use their models for both manipulating database and the 'session'.

Now I wonder, is this really how MVC is supposed to be done?

I'm thinking, what about the db mappers? I just tried PHP-ActiveRecord through sparks and realized the class can work as your Model.

What do you do. Do you create a separate model class or you just manipulate your session in the controller?





Theme © iAndrew 2016 - Forum software by © MyBB