Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
An author critiquing static methods
  • In this article an author mentions a critique about static methods, actively used in fuelphp as far as I've seen...
    http://blog.webspecies.co.uk/2011-05-23/the-new-era-of-php-frameworks.html
    What do you think about the critique?
  • I read through it and couldn't find anything that really applied to us, quote something if you think it's relevant. In general I'd suggest you read this blogpost I wrote a while back, it goes a little into the whole static thing. Dan also wrote a bit about it in his "Why did you do that?" blogpost. On the whole I'd say that there's nothing wrong with using static methods instead of function for utility methods that don't need an object state to work, the reason for that is that it groups them and makes them autoloadable - thus saving you from having to import everything you (might) need. But far more important: anyone who says we're mostly static is ignorant or simply lying. We offer static access to many things, but almost everything even remotely complex works with instantiated objects. That we made access to them easier through static means in some cases doens't mean you have to - just create the object and work with it if that's what you prefer.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion