View Single Post
Old 01-15-2012, 05:09 AM   #2 (permalink)
tony
The Addict
 
tony's Avatar
 
Join Date: Aug 2008
Posts: 336
Thanks: 8
tony is on a distinguished road
Default

In this case I don't see a gain in making a class out of 1 function. You would gain more if for example you have a class for weeks and there are different actions that a developer can make that class have. For example a developer can make a week to be print out in different formats, to be added or substracted. Stuff like that.

I am not sure if I explained myself well, but there are various reasons to design classes and one of them is to encapsulate common actions (methods) applied to an object.
tony is offline  
Reply With Quote