LogoPhly, boy, phly
the weblog and site of Matthew Weier O'Phinney

Wednesday, February 17. 2010

Symfony Live 2010

This week, I've been attending Symfony Live in Paris, speaking on integrating Zend Framework with Symfony. The experience has been quite rewarding, and certainly eye-opening for many.

To be honest, I was a little worried about the conference -- many see Symfony and ZF as being in competition, and that there would be no cross-pollination. I'm hoping that between Fabien, Stefan, and myself, we helped dispel that myth this week.

The fact of the matter is that no single project can be fully comprehensive, and do everything perfectly. In my examinations of different frameworks, PHP and otherwise, the places where they most differ and which generates the most loyalty amongst users are the MVC approaches and tooling support. In good frameworks, this is just a portion of the code, and the remainder is in support libraries or plugins that extend that functionality.

This is true of both Symfony and Zend Framework. Symfony's development team has chosen to focus on a very specific core of functionality related to the MVC approach, which makes their maintenance job easier, and leads to a stable product. Zend Framework's MVC implementation is offered as a group of separate components, with components such as Zend_Application and Zend_Tool helping to bring cohesion and structure to them.

What this means is that once you've developed the basic infrastructure of your application, the scaffolding, you're now left with decisions about how to implement the actual functionality of the application itself. The problem as I see it is: how do you do that development? Many developers are myopic and will not look beyond the framework they have chosen for for development. This can lead to multiple implementations of the same code, and often leads to incomplete implementations as well.

My feeling is that whenever you find yourself about to write new code, look to see if somebody else has written the code already. Anybody -- don't limit yourself to your framework of choice. If I want to do serious HTML sniffing, validation, and cleanup, I go to HTMLPurifier; if I want a workflow component, I check out eZ Components Workflow; I always check PEAR.

This week, I tried to spread this message within the Symfony community, showing them how easy it is to integrate ZF components within Symfony projects. The integration itself is simple: instantiate the Zend autoloader, and start using ZF classes. This same technique can be used to load PEAR, or eZComponents, or Doctrine 2, etc. The trick is getting out of the "Not Invented Here" syndrome, letting go of your ego, and using other people's code.

(Yes, I know we have code in ZF duplicating functionality in other libraries; in most cases, we try and offer at least a new approach to the problem -- but we could do better.)

Fabien also made an interesting announcement. During a Q&A session with the Symfony core team, he said that Symfony 2 will not write re-invent the wheel when it doesn't need to -- and announced that Symfony 2 will be using Zend_Log and Zend_Cache instead of rewriting the current Symfony components. I find this admirable -- and it's something I'm hoping to do in a few places with Zend Framework 2.0 as well, as I know there are features and code that others have, quite simply, written better.

One last note in this ramble: With the various "2.0" versions of frameworks, most projects are learning from both mistakes made as well as from the usage patters of the developers adopting them. One of those lessons, to my mind, is that no one framework can do it all well and by themselves. I fully expect to see the next generation of frameworks making it trivial to pull features from other frameworks and libraries in order to fill out functionality.

Posted by Matthew Weier O'Phinney in PHP at 11:39 | Comments (9) | Trackbacks (0)
Defined tags for this entry: php, sflive2010, symfony, zend framework
Related entries by tags:
Autoloading Benchmarks
Applying FilterIterator to Directory Iteration
Running mod_php and FastCGI side-by-side
Creating Zend_Tool Providers
State of Zend Framework 2.0

Trackbacks
Trackback specific URI for this entry

No Trackbacks

Comments
Display comments as (Linear | Threaded)

Hey Matthew, I couldn't agree more. :-)

Integrating external libraries and frameworks is one of the core design philosophies in Lithium, and we've had guides on integrating other frameworks (and vice versa) almost since day 1: http://rad-dev.org/lithium/wiki/guides

We also have a team who have been dedicated to an officially-supported plugin that integrates Doctrine 2 as an ORM option: http://rad-dev.org/li3_doctrine/

While on a surface level, we do 'duplicate' some lower-level functionality (such as caching and logging) this is largely because Lithium is the first major framework to adopt PHP 5.3, and the types of interactions we're aiming for simply aren't possible in existing tools, so we have a little bit of a unique spin on things.

We hope people will agree when they see the code.
#1 Nate Abele (Link) on 2010-02-17 12:17 (Reply)
if you're so keen on re-using existing components, why did you tweet earlier that Lithium will *not* contain Zend Framework components ;-)
#1.1 Stefan (Link) on 2010-02-19 04:13 (Reply)
All I said was we wouldn't be using Zend Framework components, not that we wouldn't be using *any* external components. ZF isn't the only game in town, you know. ;-)
#1.1.1 Nate Abele (Link) on 2010-02-21 18:53 (Reply)
Hi Matthew,


So, as I understand it, Zend Framework is going to use other frameworks to do specific tasks (like PHPUnit, Dojo, etc… are included at this point). So we can actually say that ZF has more to offer then just a framework. This looks very promessing, and a huge advantage to say the least.

I'm looking forward to what's comming.
#2 Michelangelo van Dam (Link) on 2010-02-17 12:18 (Reply)
Hey Matthew,

Good to hear ZF will not reinvent too. With more frameworks and libraries adhering to PSR-0, we will see a great boost in innovation in PHP projects, spending less time redoing the wheel.

Fabien is very smart. The idea of spliting some sf componentes (like the YAML component) and the related projects he maintains (Twig, Swift Mailer) was a clear sign that he was already thinking in the future.

Cool! :-)
#3 Eriksen Costa (Link) on 2010-02-17 16:39 (Reply)
Hi Matthew,

As usual, this post is extremely interesting. The part I like most is the "letting go of your ego" one. Not only in PHP, but if in every aspect of our lives we would be able to let go of our oversized ego and start collaborating instead of competing... we would all go further beyond... Keep the good work!
#4 Carlos Aguado on 2010-02-17 18:41 (Reply)
Matthew: Great post, great message. I've been trying to get it across for a long time now, and I've had a blast trying to get it across together with you in the past days. See you in Montreal :-)
#5 Stefan (Link) on 2010-02-19 04:16 (Reply)
How about integrating Doctrine 2 with ZF 2.0? Would be far more straight forward than creating a fully functional mapper for ZF.
#6 Steve (Link) on 2010-02-19 11:04 (Reply)
As far I am concerned, Benjamin Beberlei is developing the integration of Doctrine with ZF. He started authoring a new component but discontinued in favor of integrating both projects.

http://www.doctrine-project.org/contributor/beberlei
#6.1 Eriksen Costa on 2010-02-19 12:08 (Reply)

Add Comment

Standard emoticons like :-) and ;-) are converted to images.
E-Mail addresses will not be displayed and will only be used for E-Mail notifications

To prevent automated Bots from commentspamming, please enter the string you see in the image below in the appropriate input box. Your comment will only be submitted if the strings match. Please ensure that your browser supports and accepts cookies, or your comment cannot be verified correctly.
CAPTCHA

 
 
  • Home
  • Resume
  • Blog
  • Phly PEAR Channel
  • Twitter
  • Contact Me
  • About this site

ZCE

Zend Education Advisory Board Member

Add to Technorati Favorites

Calendar

Back September '10
Mon Tue Wed Thu Fri Sat Sun
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30      

Quicksearch

Links

  • PHLY - PHp LibrarY
  • Planet PHP
  • Zend Framework, where I'm project lead
  • Sebastian Bergmann
  • Cal Evans
  • Shahar Evron
  • Paul M. Jones
  • Bill Karwin
  • Mike Naberezny
  • Fabien Potencier
  • Ben Ramsey
  • Derick Rethans
  • Ralph Schindler
  • Marco Tabini

Archives

September 2010
August 2010
July 2010
Recent...
Older...

Categories

XML Linux
XML Personal
XML Aikido
XML Family
XML Programming
XML Dojo
XML Perl
XML PHP

All categories

Syndicate This Blog

XML RSS 0.91 feed
XML RSS 1.0 feed
XML RSS 2.0 feed
ATOM/XML ATOM 0.3 feed
ATOM/XML ATOM 1.0 feed
XML RSS 2.0 Comments

Show tagged entries

xml apache
xml best practices
xml books
xml conferences
xml cw09
xml decorators
xml dojo
xml dpc08
xml file_fortune
xml git
xml linux
xml mvc
xml oop
xml pear
xml perl
xml personal
xml php
xml phpworks08
xml programming
xml rest
xml ubuntu
xml vim
xml webinar
xml zendcon
xml zendcon08
xml zendcon09
xml zend framework
© 2004 - present, Matthew Weier O'Phinney
matthew-web <at> weierophinney.net