Welcome Guest, Not a member yet? Register   Sign In
Starting with CodeIgniter setup: suggestions & best practices
#28

[eluser]Jelmer[/eluser]
Your interpretation of MVC is a very strict one, and not neccesarily the best to use within CodeIgniter - though I have no doubt both interpretations work just as well. It's more about dividing up what you put where.

Quote:Your description of models is very similar to what an ORM is which isn’t exactly what models are supposed to be, but that’s ok.
What something is "supposed to be" is open to interpretation, MVC is a pattern and it's how a pattern is implemented that defines how it's "supposed to be used" - patterns are more like guidelines than cut-in-stone rules. In it's basic abstract form MVC has no concept of libraries, but there's also no concept of a configuration and no concept of some other things that are part of how you implement the basic idea into a workable system.
My models work with an ORM as their data access layer. The models are the rules and logic for working with the objects after the ORM has retrieved them or how & when to update, create or delete. The models work with the ORM's output, the model's aren't the ORM.

On the orignal posts: I'll think about expanding that part, but like I mentioned: it's a simplification meant to summarize but not meant to teach. That part of the post isn't meant to teach the reader what MVC is but to push the reader towards learning more about it, and no summary will satisfy every constraint. The basic premise of the sentense isn't that ALL logic should be in the controller, as all programming involves logic I would consider that to be self-evident.


Messages In This Thread
Starting with CodeIgniter setup: suggestions & best practices - by El Forum - 04-19-2010, 10:31 AM



Theme © iAndrew 2016 - Forum software by © MyBB