CodeIgniter Forums
Size of model? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Size of model? (/showthread.php?tid=22237)



Size of model? - El Forum - 09-02-2009

[eluser]überfuzz[/eluser]
Is there any dos and don'ts when it comes to models, regarding size. I'm coding a small site at the moment. The site only needs 4 or 5 methods to get all the sql-info needed. So do I put all methods in the same model or do I put them in separate models?


Size of model? - El Forum - 09-02-2009

[eluser]n0xie[/eluser]
Usually a model relates to a database table or a grouping of related database tables. So if the methods query the same table, then yes by all means put them in the same model. If not I would just add several different models. You never know when you might want to expand on the functionality.


Size of model? - El Forum - 09-02-2009

[eluser]überfuzz[/eluser]
OK, sounds safe and sound. thx.