Framework discoverability

I answered a question on recently and I’d like to expand a little on my answer here.

Up until mid 2010 I used my own framework for all my freelance and personal development work, it had served me admirably over the years and in fact to this day it is still being used by one of my previous employers. I was part way through rewriting it to serve me for another few years.

Even though I had plenty of experience with other frameworks, Zend, Yii etc I still tended to use my own because it was so rapid and had never got in my way or not been fit for purpose.

One of the main reasons behind the full rewrite was Dlayer, my framework/library was very suited to building websites/shops etc but it wasn’t really suitable for Dlayer, Dlayer doesn’t really have a structure similar to traditional sites or apps.

I was rebuilding some of the core classes one evening and said to myself “what are you doing Dlayer isn’t going to use this class for months, if ever.”

I decided to prioritise, rather than rebuild my framework I was going to use an existing framework and build Dlayer, I was effectively just ‘wasting’ time.

As I stated at the start this came up because I answered a question on about Zend being difficult and it got me thinking.

When I started using the Zend Framework the biggest issue for me was lack of discoverability, far too many of the methods/classes rely on data array to set their options. You end up spending ages either trawling through the code or even worse the online manual attempting to work out what keys you need in the array. The Yii framework takes this concept to the extreme, almost everything is driven by magic arrays.

There is nothing wrong with named params and setter methods, in fact from my point of view if a class needs a large array to set it up something is wrong.

Of all the options out there I still think the Zend Framework is generally the best fit, for me anyway but there is quite a steep learning curve.