Principles of PHP Package Design


Yesterday I presented “Principles of PHP Package Design” at the monthly meetup of the AmsterdamPHP usergroup. This was quite an experimental presentation. I had prepared it on the same day actually, though I had been gathering the contents of it for several weeks.

Package design is a subject I’m very much interested in and you can be sure to hear more from me about it. Actually, I started writing a book about it! If you’re interested too, sign up on


By the way, these are the slides I used yesterday:

Posted in Principles of PHP Package Design | 2 Comments

2 Responses to Principles of PHP Package Design

  • Pingback: Дайджест интересных новостей и материалов из мира PHP за последние две недели (8—22 сентября 2013) | Juds

  • # October 14, 2013 at 08:58

    This was really interesting, particularly the discussion around monolog and its handlers. One of the guys in the audience made an interesting point about the handlers being dependent on mongolog via the interface, I guess it’s feasible you might want to re-use a handler outside of monolog but it seems unlikely.

    It did get me thinking about whether it’s possible to totally de-couple two bundles that are related. For instance if you were building an e-commerce site and had a shopping cart package to store the user’s shopping cart and a products package that provided CRUD operations for the products it seems like it would be a good idea for the cart package to provide an interface for anything that would like to be stored by the cart. So for example the product might implement a CartItemInterface provided by the cart package so the cart could keep track of it.

    However by doing that the product package is now dependent on the cart package just for that interface definition even if you’re not using the cart. Is there a better way of structuring those two packages so they don’t have that dependency?

    Steve Ellis


Leave a Reply

Your email address will not be published. Required fields are marked *

* *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>