3. Wrap instantiation inside a class method
Quite often I find myself when creating report objects, wanting to do the following:
Why not cut to the chase, by creating a report class method, that returns your shiny instantiated report for you:
Now we can simply call the following, whenever we want a new instance of our report:
Much easier.
No comments:
Post a Comment