• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Refactoring:- Fat controller fat library

#1
[eluser]charlie656[/eluser]
Hi all,

Im working on a fairly large and developed codebase for an elearning platform that uses codeigniter. Each time a web page is viewed by a logged in user a lot of different functionality may be invoked, this has grown steadily over time.

I am thinking about how to approach refactoring the code.

At the moment each page view is handled by one controller function which has a fair amount of code in it before it calls a library method which also has a lot of code in it. Both make calls to models to do db queries.

I want to refactor the functionality and break it into meaningfull classes that each carry out one task.

Should I refactor into a set of libraries, a set of models or can I use plain old PHP classes.

All suggestions welcome.

#2
[eluser]Mauricio de Abreu Antunes[/eluser]
My refactoring code is about MY_Model and MY_Controller.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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