Welcome Guest, Not a member yet? Register   Sign In
To use Library or to use Model
#2

[eluser]Colin Williams[/eluser]
It's purely organizational, so think of it with your organizing cap on. Typically, though, a model is going to deal with saving and retrieving data. If that is it's primary goal, then it's a model. If the role becomes fuzzy and it isn't worth it to split the class into two, then I tend to make it a library.

I think the best example is a user system. Sure, you need to save and retrieve user data, but there are a number of other tasks, like maintaining session variables, authenticating, authorizing, etc. For that reason I make it a library. I could just as well make it a model, and all I would really need to do is change how I load it, and get rid of the need to get_instance()


Messages In This Thread
To use Library or to use Model - by El Forum - 11-18-2008, 09:04 PM
To use Library or to use Model - by El Forum - 11-18-2008, 10:44 PM



Theme © iAndrew 2016 - Forum software by © MyBB