Welcome Guest, Not a member yet? Register   Sign In
Just what is a "Model" supposed to be in CI?
#6

[eluser]sl3dg3hamm3r[/eluser]
I often observed here that the term model is missunderstood with a simple DAL (data access layer). Also what Dam1an mentioned, I completely disagree. The classical MVC-Pattern states to keep the controller as light and slim as possible. In the controller, developers also often use Command, but in terms of CI, I never tried to do anything that way. For small, straight-forward projects it might become too complex I'd say, benefits are too little.

Nobody keeps you from using the Model-Layer for your business-objects, which could be completely unaware of the persistence layer. If you use an ORM, or self written Data Access Objects / Data Transfer Objects / whatever is up to you. If the business-cases become really complex, I highly recommend to go that way. I just recently finished a project with CI, which had some complex data assembling going on. I solved that with complex nested associative arrays and regretted it later on that I didn't do it the proper OOP-way with some ORM or DAOs. For me, this goes everything into the model.


Messages In This Thread
Just what is a "Model" supposed to be in CI? - by El Forum - 05-01-2009, 03:02 PM
Just what is a "Model" supposed to be in CI? - by El Forum - 05-03-2009, 05:22 AM
Just what is a "Model" supposed to be in CI? - by El Forum - 05-03-2009, 07:11 AM
Just what is a "Model" supposed to be in CI? - by El Forum - 05-03-2009, 07:17 AM
Just what is a "Model" supposed to be in CI? - by El Forum - 08-19-2009, 07:53 PM
Just what is a "Model" supposed to be in CI? - by El Forum - 08-20-2009, 05:47 AM
Just what is a "Model" supposed to be in CI? - by El Forum - 08-20-2009, 06:25 AM
Just what is a "Model" supposed to be in CI? - by El Forum - 09-29-2009, 07:42 AM
Just what is a "Model" supposed to be in CI? - by El Forum - 09-29-2009, 07:46 AM
Just what is a "Model" supposed to be in CI? - by El Forum - 09-29-2009, 07:53 AM
Just what is a "Model" supposed to be in CI? - by El Forum - 09-29-2009, 09:12 AM
Just what is a "Model" supposed to be in CI? - by El Forum - 09-29-2009, 09:45 AM
Just what is a "Model" supposed to be in CI? - by El Forum - 09-29-2009, 09:56 AM
Just what is a "Model" supposed to be in CI? - by El Forum - 09-29-2009, 10:07 AM
Just what is a "Model" supposed to be in CI? - by El Forum - 09-29-2009, 11:55 AM



Theme © iAndrew 2016 - Forum software by © MyBB