How extensively do you utilize library functionality?

I'm working on a new site and this time have decided to go for a huge amount of readability and smaller controllers. With this in mind I have broken the work in my head into what could be several "objects" which would translate to libraries.

For Example...

This item would have a price history and a number of functions related to the price. Some of this could just be called from a model as it's a simple query but other involves more complex computation and looping.

My question lies in whether you think it's worth it to build an "item" library to that can be used to return these values and improve readability of the controller and make the code more functional (not having multiple functions in one function)?

Well the thing to think about here is Re-usability.

Take the big problem and break it down into smaller problems.

Can I use this in another application?
Then group these Libararies and Models together that do things.

Example would be an Auth Libaray and User Model, they go together.


Fair enough, then do you do anything to improve readability or to make this more functional? Or do you blob everything into your controller? Do you use private functions within your controller? It just seems to be lacking some encapsulation.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

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