• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
which is better approch? More Traditional MVC or Creating libraries for code.

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.

[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

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

[eluser]Thorpe Obazee[/eluser]

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

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.

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.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.