• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Models vs. Libraries (what goes where?)

What goes in a library that doesn't go in a model? Are libraries just classes that are easily reused? I just can't figure out what to put in custom libraries vs. what to put in my models.

Just give me some tips on how to organize that.


Libraries are used for common tasks, eg handling sessions or form validation. Models are used to handle FilIO, 99% of the time it would contain all your database calls, although if you're reading/writing directly to files then this should go in your model as well.

Models are optional, although not using them detracts from the MVC programming approach.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.