Welcome Guest, Not a member yet? Register   Sign In
Should I use models OR libraries?
#8

[eluser]junkwax[/eluser]
models are for business logic, not just queries ( data access ).

From wikipedia:

Model
Is the domain-specific representation of the information on which the application operates. Domain logic adds meaning to raw data (for example, calculating whether today is the user's birthday, or the totals, taxes, and shipping charges for shopping cart items).
Many applications use a persistent storage mechanism (such as a database) to store data. MVC does not specifically mention the data access layer because it is understood to be underneath or encapsulated by the model.


80% of my code is in models, 15% in controllers and 5% in views.

In CI, if you use libraries, you have to call get_instance() to access CI, so I use models with autoload so I can access all without calling get_instance();


Messages In This Thread
Should I use models OR libraries? - by El Forum - 03-17-2009, 07:59 AM
Should I use models OR libraries? - by El Forum - 03-17-2009, 08:15 AM
Should I use models OR libraries? - by El Forum - 03-17-2009, 08:21 AM
Should I use models OR libraries? - by El Forum - 03-17-2009, 08:42 AM
Should I use models OR libraries? - by El Forum - 03-17-2009, 09:12 AM
Should I use models OR libraries? - by El Forum - 03-17-2009, 09:22 AM
Should I use models OR libraries? - by El Forum - 03-17-2009, 09:26 AM
Should I use models OR libraries? - by El Forum - 03-19-2009, 09:31 PM
Should I use models OR libraries? - by El Forum - 03-19-2009, 10:12 PM
Should I use models OR libraries? - by El Forum - 03-19-2009, 10:24 PM



Theme © iAndrew 2016 - Forum software by © MyBB