Welcome Guest, Not a member yet? Register   Sign In
Help me to understand models
#1

[eluser]prezet[/eluser]
Hi - I'm new to MVC, I understand the approach, but I'm getting confused with models and database interaction in general.

I understand that models act as the db interaction layer - however, how does this apply when creating your own libraries. Should db interaction within a library be abstracted out to a model, or should it encapsulate that interaction within the library itself?

Also, I've been poking through 'models' I've found on Github to get some understanding - and notice some developers have methods in their models that do no db interaction at all - such as password generation.

Please can you help me understand when/where to use a model, and when to decide with methods to put in it, and which belong in a library/alternative.

Thanks for your time.




Theme © iAndrew 2016 - Forum software by © MyBB