In my Beyond Frameworks talk, I explained how a component-based architecture can help answer some of the important (i.e. expensive!) questions you might face when creating long-lived apps that rely on a PHP framework. In this series of blog posts, I’m going to look at how to go about creating and working with components.
- Watch my talk from the PHP UK conference, where I explain the long-term costs of relying just on frameworks, and why a mixture of frameworks and components is the more pragmatic way to go.
- Read the slides that accompany the talk. Share them with your colleagues. Discuss them in your local PHP user group.
The Tools We Use
To make it much easier to work with components (and especially to work with lots of components), I’ve put together some useful tools. You’ll need to download them and install them into your dev environment:
- Phix Project website
- Introducing phix (updated September, 2011)
- Installing phix onto Apple Mac OS X
- Installing phix on Ubuntu
- Installing phix on Fedora
- Installing phix on Debian
- Installing phix on CentOS / RHEL
Here’s what has changed from release to release:
- Phix 0.14 (released 24th October, 2011)
I’ll add links to any further blog posts about the tools as and when they come up!
Working With PHP Components
You’ve watched the video, and read why a component-based architecture is the way to go. You’ve installed the tools. But now what? In these blog articles, I show you step by step how to build the components for an app, and discuss many of the subtleties that you’ll come across with this approach.
- Planning An App That Uses Components
- Decomposing An App Into Components
- Creating A Skeleton Component
- Setting Up Your Component’s Metadata, Pt 1
- Setting Up Your Component’s package.xml File
- Adding Unit Tests For Your Component
- Where To Put Your Component’s Unit Tests
- How To Run Your Component’s Unit Tests
- Dealing With PEAR Dependency Quirks
- Working With Non-Namespaced Components
- Testing Remote Web Services The Quick And Nasty Way
- Unit Test Coverage For Components
- Making A PEAR-Compatible Package
- Setting Up Your Own PEAR Channel
- 3 Tips For Publishing Your Own PEAR Channel
- Publishing Your PEAR Channel On GitHub
Anatomy Of A Component
Want to know what is inside each component, or where something is meant to go? Here’s the skinny:
- Explaining File Roles In PHP Components
- Shipping Reusable PHP Code
- Shipping A Command-Line Program
- Shipping Data Files With Your Components
- Shipping Documentation With Your Component
- Shipping Unit Tests With Your Component
- Shipping Web Pages With Your Component
Common Principles And Practices
Become a successful part of a wider community of PHP developers creating components that adopt common principles and practices.
- Introducing Common Principles Of Components (coming October 10th, 2011)
More to come 🙂