Welcome Guest, Not a member yet? Register   Sign In
which is better approch? More Traditional MVC or Creating libraries for code.
#1

[eluser]pankaj[/eluser]
I am using code igniter for last one year and I have started using MVC approach with codeigniter itself. in Codeigniter user guides model section they mentioned "Models are optionally available for those who want to use a more traditional MVC approach." they have mention MVC is more traditional approach. But now I am getting confuse, and have question, which approach is better, using Model or "creating libraries" which having mix code for database as well as functionality.
#2

[eluser]Thorpe Obazee[/eluser]
I don't think they are different as how I use it. I take it that libraries would mean functionality and models for data access(files, database, xml, etc). From what I understand, libraries should 'interface' with models to interact with data.

so when using libraries that has some sort of data involved I do this: Libraries->Model->data access
#3

[eluser]Dam1an[/eluser]
First of all, there's no one answer for this, its largely a matter of opinion, and will depend on the programmer and the project.
That being said, I've now seen the light of the more 'traditional MVC' approach, and havn't looked back
So unless I have a compelling reason to go another route, MVC it is...
#4

[eluser]Thorpe Obazee[/eluser]
http://forum.kohanaphp.com/comments.php?...=23&page=1

Here's a link I've read on MVC on Kohana.
#5

[eluser]pankaj[/eluser]
currently I am using MVC, where I separated my database related code in model, but I really like creating libraries lets say I am creating user authentication module. So I put all database and related code in library, like in function registration I added code for database as well as manipulating form data and in controller I am just validating the data coming from HTML Form and sending it to registration function which is written in library.

I am getting curious is it a good approach of using libraries for database as well as other code is better or using mvc is better.
#6

[eluser]PrashantKabade[/eluser]
Often you use libraries to get a certain functionality in your OWN software/infrastructre. For example printing a barcode, you would use a library to do so. A framework abstracts a whole class of problems, perhaps the problem of writing web applications. To do so the framework delivers the "frame" with all functionality and stubs you can programm against.




Theme © iAndrew 2016 - Forum software by © MyBB