Welcome Guest, Not a member yet? Register   Sign In
How extensively do you utilize library functionality?
#1

[eluser]gullah[/eluser]
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...
/Products/view/item_name

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)?
#2

[eluser]InsiteFX[/eluser]
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.

InsiteFX
#3

[eluser]gullah[/eluser]
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.




Theme © iAndrew 2016 - Forum software by © MyBB