Welcome Guest, Not a member yet? Register   Sign In
Code Organization
#2

[eluser]jcavard[/eluser]
[quote author="m40" date="1250031075"]I have a function, lets call it validate_user, that takes two values - username and password, and matches them against a database.

Where should that function reside?

a) in a Model, because it communicates with a database;
b) in a Controller;
c) in a Library;
d) other...;[/quote]
I guess you could have validate_user() in a Authentication library and another function to query the db that would be called by the library, the latter would be in a model.

imho


Messages In This Thread
Code Organization - by El Forum - 08-11-2009, 11:51 AM
Code Organization - by El Forum - 08-11-2009, 12:01 PM
Code Organization - by El Forum - 08-11-2009, 05:38 PM
Code Organization - by El Forum - 08-11-2009, 05:47 PM
Code Organization - by El Forum - 08-11-2009, 06:00 PM
Code Organization - by El Forum - 08-11-2009, 06:41 PM
Code Organization - by El Forum - 08-12-2009, 02:33 AM
Code Organization - by El Forum - 08-12-2009, 05:00 AM
Code Organization - by El Forum - 08-12-2009, 05:53 AM



Theme © iAndrew 2016 - Forum software by © MyBB