CodeIgniter Forums
which is better approch? More Traditional MVC or Creating libraries for code. - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: which is better approch? More Traditional MVC or Creating libraries for code. (/thread-18387.html)



which is better approch? More Traditional MVC or Creating libraries for code. - El Forum - 05-04-2009

[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.


which is better approch? More Traditional MVC or Creating libraries for code. - El Forum - 05-04-2009

[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


which is better approch? More Traditional MVC or Creating libraries for code. - El Forum - 05-04-2009

[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...


which is better approch? More Traditional MVC or Creating libraries for code. - El Forum - 05-04-2009

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

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


which is better approch? More Traditional MVC or Creating libraries for code. - El Forum - 05-05-2009

[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.


which is better approch? More Traditional MVC or Creating libraries for code. - El Forum - 05-05-2009

[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.