Saturday, August 23, 2008

Northeast Pools & Spas Website Launch

See Northeast Pools & Spas Website Launch at its new home on bradley-holt.com.

We just launched the new Northeast Pools & Spas website. I think Dave and Jason did a great job on the visual design and Liz did a fabulous job on organizing and helping to write the content! I worked primarily on the functionality for the construction and portfolio pages. The site is implemented using semantic XHTML, CSS, jQuery, and Zend Framework.

The cool thing about the construction and portfolio pages is that they use progressive enhancement. What this means is that users without JavaScript (i.e. search engine robots & screen readers) can navigate the content by fully reloading the page on each click. You can try this out yourself by disabling JavaScript in your browser. For users with JavaScript, each click on "next" or "previous" (on the construction page) or each portfolio feature (on the portfolio page) will cause their browsers to load the appropriate content dynamically into the right spot on the page without needing a full page reload.

One of the common problems with this type of JavaScript navigation is that you often break the browser's back and forward navigation capabilities. Another common problem is that you can't bookmark the page or send the link to a friend and have the same content loaded. Because these pages update the browser's "hash" we get the browser's back and forward capabilities as well as bookmarkability. The "hash" is the part of the URL that starts with the "#" character. For example, assuming you have JavaScript enabled you should be able to navigate right to the waterfall photo using the following link:

http://www.northeastpools.net/portfolio/#feature/waterfall/

Critiques are welcome!

Friday, August 22, 2008

PHP Users Group Meeting

See PHP Users Group Meeting at its new home on bradley-holt.com.

The next meeting of the Burlington, VT PHP Users Group will be Thursday, August 28th, 2008 at 6pm. Special guest Lee Brimelow, a Platform Evangelist with Adobe and an award-winning interactive designer, will discuss the various ways in which you can integrate PHP with Flash and Flex to create Rich Internet Applications. We will start by covering simple XML exchange and then move on to more high-performance options like AMFPHP. The new proposed support for Adobe's AMF in the Zend Framework will also be discussed. Free software will also be raffled off.

Tuesday, August 12, 2008

Social Media Manifesto

See Social Media Manifesto at its new home on bradley-holt.com.

At Found Line, we often have people ask us about using social media as a marketing tool. Unfortunately many try to approach social media as just another marketing avenue or, even worse, as a form of advertising. Here are a few key rules you must follow or you will fail miserably.

It's not about you. It's about your users/ customers/ readers/ viewers. What are you providing that's valuable? Where is the overlap between your users' needs and wants and what you have to say?

You are not the center of your network. You are just part of a larger network. Be a good citizen. Provide something of value. Connect with other networks; grow your network.

Whatever you do, do not try to control how or what is communicated. For employees, set clear boundaries as to what is OK to publish and what isn't and don't punish employees if they say something you don't like within those boundaries. Encourage everyone (inside and out) to speak their minds. If they have something bad to say, it's an opportunity to improve your product/service. If they have something good to say then great!

Social media is not one-way. It is a conversation, not a broadcast. Don't start a conversation if you're not willing to listen. No one will listen to you if you don't listen to them.

For some interesting reading on how companies are using social media, see The New Robert Scobles: Seven Leading Corporate Social Media Evangelists Today and Zappos Shows How Social Media Is Done.

Sunday, August 3, 2008

Draft Zend_Container Proposal

See Draft Zend_Container Proposal at its new home on bradley-holt.com.

Wow, my draft Zend_Container proposal got a lot more interest than I expected. I want to clarify a few things about this proposal. First, this proposal is still very much a draft. I've made a few updates this weekend, so I'd love to hear any feedback you have but keep in mind the proposal is certainly not complete. Second, this proposal is in no way endorsed by anyone at Zend although I've gotten a small amount of feedback from some Zenders in public blog comments. Third, I'm not entirely convinced that a dependency injection component fits in with Zend Framework's balance of simplicity and power. However, I believe that if Zend Framework is to have a dependency injection component that this component should be as simple as possible and designed to solve a limited set of use cases. This is why I'm working on this proposal, to provide the option of a dead-simple dependency injection component in Zend Framework.

Thanks again for all the feedback I've gotten so far!

Thursday, July 31, 2008

Development/Integration/Staging/Production

See Development/Integration/Staging/Production at its new home on bradley-holt.com.

I am surprised by how many developers think it's OK to do work directly in a production environment or to deploy to production directly from their development environment. I found a good article today that explains the traditional Development/Integration/Staging/Production practice. The specific setup may be different depending on your environment, but the basic ideas are the same.

Wednesday, July 30, 2008

Social Capital in Free/Open Source Software Projects

See Social Capital in Free/Open Source Software Projects at its new home on bradley-holt.com.

A colleague of mine recently introduced me to the concept of social capital. Many organizations these days value human capital but I'm not sure how many value the social contacts between people involved in the organization. This raised the following question for me: I wonder how much of the success around free/open source software projects can be attributed to the generation of social capital? There are all sorts of technical reasons people will give as to why free/open source software is "better" than proprietary software but has anyone looked at it from a social perspective? I wonder if this is the real importance of Stallman's four freedoms - that they provide the opportunity for the creation of social capital?

I did some Googling and discovered an academic paper called The Influence of Structural Social Capital on Open Source Project Success. It was very interesting but I must admit I didn't read all of it as it gets rather technical towards the end. Here is a summary of the results:

Our main results are (1) teams with greater internal cohesion are more successful, (2) external cohesion (cohesion among the external contacts of a team) has an inverse U-shaped relationship with the project's success; moderate levels of external cohesion are the best for a project's success, rather than very low or very high levels of this variable, (3) the technological diversity of a contact also has the greatest benefit when it is neither too low nor too high, and (4) the number of direct and indirect external contacts are positively correlated with a project's success with the effect of the number of direct contacts being moderated by the number of indirect contacts.

Monday, July 28, 2008

Dependency Injection in Zend Framework

See Dependency Injection in Zend Framework at its new home on bradley-holt.com.

Ibuildings has an article on Dependency Injection and Zend Framework Controllers. In the comments, the Zend_Di proposal is mentioned. I had posted several comments when the Zend_Di component was proposed. Most of my comments were ideas on how to make a dead-simple dependency injection container for Zend Framework. Zend Framework prides itself on simplicity and, in my humble opinion, if Zend Framework is going to have a dependency injection component this component needs to be as simple as possible - something along the lines of PicoContainer. So, I'd like to summarize my thoughts here. I should probably just write a proposal, but I'd like to start here and see what kind of feedback I get.

For the purposes of this blog entry, I'll call this component Zend_Container (I apologize if this name has been proposed for any other components). First, some basic assumptions:

  • The component's primary purpose is to replace the use of class-managed singletons and Zend_Registry.
  • The component will only manage singleton items within a container, it will not act as a factory (except for creating the single instance).
  • A container can have zero or one parent container and have access to items in its parent, but a parent cannot have access to items in its children.
  • The component uses reflection to determine dependencies.
Below is an example of a class that will have its dependent items injected:
class Zoo {

/**
* @var Feline
*/
protected $_feline;

/**
* @var Canine
*/
protected $_canine;

/**
* Sets the Feline for the Zoo to have.
*
* @param Feline $feline
* @return void
*/
public function setFeline(Feline $feline) {
$this->_feline = $feline;
}

/**
* Sets the Canine for the Zoo to have.
*
* @param Canine $canine
* @return void
*/
public function setCanine(Canine $canine) {
$this->_canine = $canine;
}

}
Here is an example of wiring up dependencies:
$container = new Zend_Container();
//note the ability to specify class or interface and class
$container->addComponent('Zoo')
->addComponent('Feline', 'Tiger')
->addComponent('Canine', 'Wolf');
$zoo = $container->getComponent('Zoo');

//the above is equivalent to (assuming setter injection)
$feline = new Tiger();
$canine = new Wolf();
$zoo = new Zoo();
$zoo->setFeline($feline);
$zoo->setCanine($canine);
An example of parent/child relationships:
$rootContainer = new Zend_Container();
//passing in the root container so the child is aware of its parent
$childContainer = new Zend_Container($rootContainer);
//note again that we can add either class or class and interface
$rootContainer->addComponent('SomeClass');
$childContainer->addComponent('SomeClass');
$instanceA = $rootContainer->getComponent('SomeClass');
/*
Child containers should have access to their parent's components (but not the other
way round) so if we hadn't added the component specifically to the child container
this next line would have given us instanceA.
*/
$instanceB = $childContainer->getComponent('SomeClass');
echo (int) ($instanceA === $instanceB); // echoes "0" (false)
There is one major problem that I have not figured out. Reflection is used to determine potential dependencies. The container then would look to see if it (or its parent) contains the dependency and if it does, wire it up, otherwise ignore it. In other words, there's no way to assert that a component is a required dependency. Perhaps this could be solved through the use of an @required DocBlock tag if this can be read using PHP's reflection mechanism. There could also be a configuration option that would simply make your addComponent calls for you.