SlideShare ist ein Scribd-Unternehmen logo
1 von 163
Downloaden Sie, um offline zu lesen
Beyond Frameworks
Using Frameworks Without
Becoming A Hostage To Them




                                                    Stuart Herbert
           stuart@stuartherbert.com - http://blog.stuartherbert.com/php/
About Stuart
                    • Head of Engineering,
                      Gradwell.com

                    • Co-author, Zend Certification
                      Study Guide for PHP 4

                    • Open-source Contributor
                      Since 1994




Beyond Frameworks      Stuart Herbert - http://blog.stuartherbert.com/php/
About Stuart
                    • Head of Engineering,
                      Gradwell.com

                    • Co-author, Zend Certification
                      Study Guide for PHP 4

                    • Open-source Contributor
                      Since 1994




Beyond Frameworks      Stuart Herbert - http://blog.stuartherbert.com/php/
About Stuart
                    • Head of Engineering,
                      Gradwell.com

                    • Co-author, Zend Certification
                      Study Guide for PHP 4

                    • Open-source Contributor
                      Since 1994




Beyond Frameworks      Stuart Herbert - http://blog.stuartherbert.com/php/
Contents

                    How
                    Frameworks
         1
                    Have Held Us
                    Hostage

Beyond Frameworks    Stuart Herbert - http://blog.stuartherbert.com/php/
Contents

                    Our Layered
                    Architecture
         2
                    For PHP
                    Applications

Beyond Frameworks    Stuart Herbert - http://blog.stuartherbert.com/php/
Contents


                    What Makes
         3          A Good
                    Component?


Beyond Frameworks    Stuart Herbert - http://blog.stuartherbert.com/php/
Contents

                    How
                    Components
         4
                    Are Helping
                    Gradwell

Beyond Frameworks    Stuart Herbert - http://blog.stuartherbert.com/php/
Questions
           At The End, Please



Beyond Frameworks         Stuart Herbert - http://blog.stuartherbert.com/php/
Questions
          For The Audience ...



Beyond Frameworks         Stuart Herbert - http://blog.stuartherbert.com/php/
http://flic.kr/p/R33dr




          Who Uses A Framework?

Beyond Frameworks      Stuart Herbert - http://blog.stuartherbert.com/php/
http://flic.kr/p/qq6F1




    Who Develops Software Products?

Beyond Frameworks     Stuart Herbert - http://blog.stuartherbert.com/php/
1: Hostages
         To Frameworks


Beyond Frameworks   Stuart Herbert - http://blog.stuartherbert.com/php/
Stop Me If You’ve Heard
      This One Before ...



Beyond Frameworks   Stuart Herbert - http://blog.stuartherbert.com/php/
First generation apps are
                          highly-coupled

                          Neat until you attempt to
                          untangle them!




 http://flic.kr/p/7MmEiv


Beyond Frameworks             Stuart Herbert - http://blog.stuartherbert.com/php/
First generation apps are
                          highly-coupled

                          Neat until you attempt to
                          untangle them!




 http://flic.kr/p/7MmEiv


Beyond Frameworks             Stuart Herbert - http://blog.stuartherbert.com/php/
Second generation app
                          built on top of own
                          framework

                          Developers enjoyed
                          building it

                          But they hated completing
                          it or maintaining it


 http://flic.kr/p/4sK29V


Beyond Frameworks             Stuart Herbert - http://blog.stuartherbert.com/php/
Second generation app
                          built on top of own
                          framework

                          Developers enjoyed
                          building it

                          But they hated completing
                          it or maintaining it


 http://flic.kr/p/4sK29V


Beyond Frameworks             Stuart Herbert - http://blog.stuartherbert.com/php/
Second generation app
                          built on top of own
                          framework

                          Developers enjoyed
                          building it

                          But they hated completing
                          it or maintaining it


 http://flic.kr/p/4sK29V


Beyond Frameworks             Stuart Herbert - http://blog.stuartherbert.com/php/
So We Used
   A Popular Framework ...



Beyond Frameworks   Stuart Herbert - http://blog.stuartherbert.com/php/
... Or Two ...




Beyond Frameworks      Stuart Herbert - http://blog.stuartherbert.com/php/
Third generation app easy
                          to extend

                          ... after the steep learning
                          curve




 http://flic.kr/p/2k87DM


Beyond Frameworks             Stuart Herbert - http://blog.stuartherbert.com/php/
Third generation app easy
                          to extend

                          ... after the steep learning
                          curve




 http://flic.kr/p/2k87DM


Beyond Frameworks             Stuart Herbert - http://blog.stuartherbert.com/php/
We couldn’t get the code
                          out to re-use in other apps

                                                 :(




 http://flic.kr/p/7132Wm


Beyond Frameworks             Stuart Herbert - http://blog.stuartherbert.com/php/
What The Architecture Should Look Like




                        Framework




            Your Code                      Plugins




Beyond Frameworks                   Stuart Herbert - http://blog.stuartherbert.com/php/
What Happened In Reality :(




                    Framework

            Your Code                  Plugins




Beyond Frameworks               Stuart Herbert - http://blog.stuartherbert.com/php/
What Practical Challenges
    Does This Create?



Beyond Frameworks   Stuart Herbert - http://blog.stuartherbert.com/php/
How long would it take to
                          upgrade your app to the
                          next major version of the
                          framework?

                          Would you do the upgrade,
                          or stick with the current
                          framework version?



 http://flic.kr/p/5Z6Arf


Beyond Frameworks             Stuart Herbert - http://blog.stuartherbert.com/php/
How long would it take to
                          upgrade your app to the
                          next major version of the
                          framework?

                          Would you do the upgrade,
                          or stick with the current
                          framework version?



 http://flic.kr/p/5Z6Arf


Beyond Frameworks             Stuart Herbert - http://blog.stuartherbert.com/php/
What would it take to
                          switch your app to a
                          different framework?

                          Could you port your code,
                          or would you be forced to
                          rewrite all or most of it?



 http://flic.kr/p/4Z8oZE


Beyond Frameworks             Stuart Herbert - http://blog.stuartherbert.com/php/
What would it take to
                          switch your app to a
                          different framework?

                          Could you port your code,
                          or would you be forced to
                          rewrite all or most of it?



 http://flic.kr/p/4Z8oZE


Beyond Frameworks             Stuart Herbert - http://blog.stuartherbert.com/php/
How would you re-use
                          some of your app’s code in
                          a different app?

                          Especially if the other app
                          doesn’t use the same
                          framework?



 http://flic.kr/p/85jzRA


Beyond Frameworks             Stuart Herbert - http://blog.stuartherbert.com/php/
How would you re-use
                          some of your app’s code in
                          a different app?

                          Especially if the other app
                          doesn’t use the same
                          framework?



 http://flic.kr/p/85jzRA


Beyond Frameworks             Stuart Herbert - http://blog.stuartherbert.com/php/
How would you outsource
                          some of your app
                          development to teams
                          around the world?

                          How would you accept the
                          work delivered back to
                          you?



 http://flic.kr/p/6GMfQc


Beyond Frameworks            Stuart Herbert - http://blog.stuartherbert.com/php/
How would you outsource
                          some of your app
                          development to teams
                          around the world?

                          How would you accept the
                          work delivered back to
                          you?



 http://flic.kr/p/6GMfQc


Beyond Frameworks            Stuart Herbert - http://blog.stuartherbert.com/php/
We Need To Change This ...




                    Framework

            Your Code                  Plugins




Beyond Frameworks               Stuart Herbert - http://blog.stuartherbert.com/php/
To What ...?




Beyond Frameworks      Stuart Herbert - http://blog.stuartherbert.com/php/
2: Layered Approach



Beyond Frameworks   Stuart Herbert - http://blog.stuartherbert.com/php/
Let’s Take The Original Architecture ...




      Application

       Frameworks         Your Code                     Plugins




Beyond Frameworks                     Stuart Herbert - http://blog.stuartherbert.com/php/
... And Make The App As Thin As Possible




      Application

       Frameworks        App Code                     Plugins




Beyond Frameworks                   Stuart Herbert - http://blog.stuartherbert.com/php/
By Extracting Out ...


      Application

       Frameworks             App Code                    Plugins




       Business Logic




Beyond Frameworks                        Stuart Herbert - http://blog.stuartherbert.com/php/
By Extracting Out ...


      Application

       Frameworks             App Code                     Plugins




       Business Logic        Data Model




Beyond Frameworks                         Stuart Herbert - http://blog.stuartherbert.com/php/
By Extracting Out ...


      Application

       Frameworks             App Code                     Plugins




       Business Logic        Data Model                    Utilities




Beyond Frameworks                         Stuart Herbert - http://blog.stuartherbert.com/php/
... Into Independent Libraries Of Code


      Application

       Frameworks         App Code                      Plugins




      Components

       Business Logic     Data Model                    Utilities




Beyond Frameworks                      Stuart Herbert - http://blog.stuartherbert.com/php/
Use An Autoloader To Pull In These New Components


      Application

       Frameworks       App Code                      Plugins




                        Autoloader

      Components

       Business Logic   Data Model                    Utilities




Beyond Frameworks                    Stuart Herbert - http://blog.stuartherbert.com/php/
This Gives You A Larger Set Of Reusable Code


      Application

       Frameworks        App Code                     Plugins




                        Autoloader

      Components

       Business Logic   Data Model                    Utilities




Beyond Frameworks                    Stuart Herbert - http://blog.stuartherbert.com/php/
The Frameworked App
       Becomes A Thin Layer
             On Top Of
        Framework-agnostic
       Reusable Components


Beyond Frameworks   Stuart Herbert - http://blog.stuartherbert.com/php/
Layered Architecture
      Application

       Frameworks       App Code                      Plugins




                        Autoloader

      Components

       Business Logic   Data Model                    Utilities




Beyond Frameworks                    Stuart Herbert - http://blog.stuartherbert.com/php/
Layered Architecture
      Application




     Components




Beyond Frameworks   Stuart Herbert - http://blog.stuartherbert.com/php/
Why Components?
                        • Completely independent of
       Business Logic     the framework

                        • Built & tested in isolation of
                          your app code

        Data Model
                        • Can be built by different
                          teams

                        • Don’t have to change when
          Utilities
                          the framework changes



Beyond Frameworks          Stuart Herbert - http://blog.stuartherbert.com/php/
Why Components?
                        • Completely independent of
       Business Logic     the framework

                        • Built & tested in isolation of
                          your app code

        Data Model
                        • Can be built by different
                          teams

                        • Don’t have to change when
          Utilities
                          the framework changes



Beyond Frameworks          Stuart Herbert - http://blog.stuartherbert.com/php/
Why Components?
                        • Completely independent of
       Business Logic     the framework

                        • Built & tested in isolation of
                          your app code

        Data Model
                        • Can be built by different
                          teams

                        • Don’t have to change when
          Utilities
                          the framework changes



Beyond Frameworks          Stuart Herbert - http://blog.stuartherbert.com/php/
Why Components?
                        • Completely independent of
       Business Logic     the framework

                        • Built & tested in isolation of
                          your app code

        Data Model
                        • Can be built by different
                          teams

                        • Don’t have to change when
          Utilities
                          the framework changes



Beyond Frameworks          Stuart Herbert - http://blog.stuartherbert.com/php/
Why Components?
                        • Reduces the Big Ball of
       Business Logic     String Syndrome

                        • Mindset change to light apps
                          on top of rich service layer

        Data Model
                        • Improves development in
                          parallel of apps & services

                        • Injects additional discipline
          Utilities
                          into development teams



Beyond Frameworks          Stuart Herbert - http://blog.stuartherbert.com/php/
Why Components?
                        • Reduces the Big Ball of
       Business Logic     String Syndrome

                        • Mindset change to light apps
                          on top of rich service layer

        Data Model
                        • Improves development in
                          parallel of apps & services

                        • Injects additional discipline
          Utilities
                          into development teams



Beyond Frameworks          Stuart Herbert - http://blog.stuartherbert.com/php/
Why Components?
                        • Reduces the Big Ball of
       Business Logic     String Syndrome

                        • Mindset change to light apps
                          on top of rich service layer

        Data Model
                        • Improves development in
                          parallel of apps & services

                        • Injects additional discipline
          Utilities
                          into development teams



Beyond Frameworks          Stuart Herbert - http://blog.stuartherbert.com/php/
Why Components?
                        • Reduces the Big Ball of
       Business Logic     String Syndrome

                        • Mindset change to light apps
                          on top of rich service layer

        Data Model
                        • Improves development in
                          parallel of apps & services

                        • Injects additional discipline
          Utilities
                          into development teams



Beyond Frameworks          Stuart Herbert - http://blog.stuartherbert.com/php/
Others Already Do This




Beyond Frameworks   Stuart Herbert - http://blog.stuartherbert.com/php/
http://flic.kr/p/5oewwy




           Perl Has CPAN Modules

Beyond Frameworks       Stuart Herbert - http://blog.stuartherbert.com/php/
http://flic.kr/p/uyMuU




                Ruby Has Gems

Beyond Frameworks        Stuart Herbert - http://blog.stuartherbert.com/php/
What Makes
       A Good Component?



Beyond Frameworks   Stuart Herbert - http://blog.stuartherbert.com/php/
3: Good Components



Beyond Frameworks   Stuart Herbert - http://blog.stuartherbert.com/php/
Component Standards


 • Common standards
 • Reusable by many
 • Interoperable
 • Trustable



Beyond Frameworks     Stuart Herbert - http://blog.stuartherbert.com/php/
Component Standards


 • Common standards
 • Reusable by many
 • Interoperable
 • Trustable



Beyond Frameworks     Stuart Herbert - http://blog.stuartherbert.com/php/
Component Standards


 • Common standards
 • Reusable by many
 • Interoperable
 • Trustable



Beyond Frameworks     Stuart Herbert - http://blog.stuartherbert.com/php/
Component Standards


 • Common standards
 • Reusable by many
 • Interoperable
 • Trustable



Beyond Frameworks     Stuart Herbert - http://blog.stuartherbert.com/php/
Good Components ...

 • Autoload
 • Are well tested
 • Are well documented
 • Are easy to install
 • Don’t break backwards compatibility by
   surprise


Beyond Frameworks          Stuart Herbert - http://blog.stuartherbert.com/php/
Good Components ...

 • Autoload
 • Are well tested
 • Are well documented
 • Are easy to install
 • Don’t break backwards compatibility by
   surprise


Beyond Frameworks          Stuart Herbert - http://blog.stuartherbert.com/php/
Good Components ...

 • Autoload
 • Are well tested
 • Are well documented
 • Are easy to install
 • Don’t break backwards compatibility by
   surprise


Beyond Frameworks          Stuart Herbert - http://blog.stuartherbert.com/php/
Good Components ...

 • Autoload
 • Are well tested
 • Are well documented
 • Are easy to install
 • Don’t break backwards compatibility by
   surprise


Beyond Frameworks          Stuart Herbert - http://blog.stuartherbert.com/php/
Good Components ...

 • Autoload
 • Are well tested
 • Are well documented
 • Are easy to install
 • Don’t break backwards compatibility by
   surprise


Beyond Frameworks          Stuart Herbert - http://blog.stuartherbert.com/php/
Keep Components Outside Of Your App


      Application

       Frameworks       App Code                      Plugins




      Components

       Business Logic   Data Model                    Utilities




Beyond Frameworks                    Stuart Herbert - http://blog.stuartherbert.com/php/
Use An Autoloader To Pull In Components


      Application

       Frameworks       App Code                      Plugins




                        Autoloader

      Components

       Business Logic   Data Model                    Utilities




Beyond Frameworks                    Stuart Herbert - http://blog.stuartherbert.com/php/
Why Use An Autoloader?


      Application

       Frameworks          App Code                      Plugins




                           Autoloader

      Components

       Business Logic     Data Model                     Utilities




Beyond Frameworks                       Stuart Herbert - http://blog.stuartherbert.com/php/
Autoloading Makes Life Easy!


      Application

       Frameworks          App Code                     Plugins




                          Autoloader

      Components

       Business Logic     Data Model                    Utilities




Beyond Frameworks                      Stuart Herbert - http://blog.stuartherbert.com/php/
One True Autoloader

 • Who has heard of PSR0?
 • http://groups.google.com/group/php-
   standards/web/psr-0-final-proposal
 • Backed by leading names in the community
 • Perfect for a component approach



Beyond Frameworks           Stuart Herbert - http://blog.stuartherbert.com/php/
One True Autoloader

 • Who has heard of PSR0?
 • http://groups.google.com/group/php-
   standards/web/psr-0-final-proposal
 • Backed by leading names in the community
 • Perfect for a component approach



Beyond Frameworks           Stuart Herbert - http://blog.stuartherbert.com/php/
One True Autoloader

 • Who has heard of PSR0?
 • http://groups.google.com/group/php-
   standards/web/psr-0-final-proposal
 • Backed by leading names in the community
 • Perfect for a component approach



Beyond Frameworks           Stuart Herbert - http://blog.stuartherbert.com/php/
One True Autoloader

 • Who has heard of PSR0?
 • http://groups.google.com/group/php-
   standards/web/psr-0-final-proposal
 • Backed by leading names in the community
 • Perfect for a component approach



Beyond Frameworks           Stuart Herbert - http://blog.stuartherbert.com/php/
PSR0 Autoloader
 • Namespace separators ‘’ become
   DIRECTORY_SEPARATOR
 • Underscore in class names ‘_’ become
   DIRECTORY_SEPARATOR
 • Top namespace is your organisation
 • Achieves 1:1 mapping from classname to
   filename on disk


Beyond Frameworks          Stuart Herbert - http://blog.stuartherbert.com/php/
PSR0 Autoloader
 • Namespace separators ‘’ become
   DIRECTORY_SEPARATOR
 • Underscore in class names ‘_’ become
   DIRECTORY_SEPARATOR
 • Top namespace is your organisation
 • Achieves 1:1 mapping from classname to
   filename on disk


Beyond Frameworks          Stuart Herbert - http://blog.stuartherbert.com/php/
PSR0 Autoloader
 • Namespace separators ‘’ become
   DIRECTORY_SEPARATOR
 • Underscore in class names ‘_’ become
   DIRECTORY_SEPARATOR
 • Top namespace is your organisation
 • Achieves 1:1 mapping from classname to
   filename on disk


Beyond Frameworks          Stuart Herbert - http://blog.stuartherbert.com/php/
PSR0 Autoloader
 • Namespace separators ‘’ become
   DIRECTORY_SEPARATOR
 • Underscore in class names ‘_’ become
   DIRECTORY_SEPARATOR
 • Top namespace is your organisation
 • Achieves 1:1 mapping from classname to
   filename on disk


Beyond Frameworks          Stuart Herbert - http://blog.stuartherbert.com/php/
Autoloader Examples


 • Phin_ProjectExtenderLibFileLoader ->
   Phin_Project/ExtenderLib/FileLoader.php
 • Phin_ProjectConsoleStd_Out ->
   Phin_Project/Console/Std/Out.php




Beyond Frameworks          Stuart Herbert - http://blog.stuartherbert.com/php/
Autoloader Examples


 • Phin_ProjectExtenderLibFileLoader ->
   Phin_Project/ExtenderLib/FileLoader.php
 • Phin_ProjectConsoleStd_Out ->
   Phin_Project/Console/Std/Out.php




Beyond Frameworks          Stuart Herbert - http://blog.stuartherbert.com/php/
Autoloader Component


 • pear channel-discover pear.gradwell.com
 • pear install Gradwell/Autoloader




Beyond Frameworks           Stuart Herbert - http://blog.stuartherbert.com/php/
Autoloader Component


 • pear channel-discover pear.gradwell.com
 • pear install Gradwell/Autoloader




Beyond Frameworks           Stuart Herbert - http://blog.stuartherbert.com/php/
Testing




                                    http://flic.kr/p/3c2W8q

Beyond Frameworks   Stuart Herbert - http://blog.stuartherbert.com/php/
PHPUnit

 • De-facto standard for unit-testing PHP code
 • Supported by leading IDEs
 • Supported by CI environments
 • Perfect for use with components



Beyond Frameworks           Stuart Herbert - http://blog.stuartherbert.com/php/
PHPUnit

 • De-facto standard for unit-testing PHP code
 • Supported by leading IDEs
 • Supported by CI environments
 • Perfect for use with components



Beyond Frameworks           Stuart Herbert - http://blog.stuartherbert.com/php/
PHPUnit

 • De-facto standard for unit-testing PHP code
 • Supported by leading IDEs
 • Supported by CI environments
 • Perfect for use with components



Beyond Frameworks           Stuart Herbert - http://blog.stuartherbert.com/php/
PHPUnit

 • De-facto standard for unit-testing PHP code
 • Supported by leading IDEs
 • Supported by CI environments
 • Perfect for use with components



Beyond Frameworks           Stuart Herbert - http://blog.stuartherbert.com/php/
Good Tests ...

 • Document supported behaviour
 • Have separate tests for reported bugs
 • Cover 100% of the component’s code
 • Ship with the component



Beyond Frameworks            Stuart Herbert - http://blog.stuartherbert.com/php/
Good Tests ...

 • Document supported behaviour
 • Have separate tests for reported bugs
 • Cover 100% of the component’s code
 • Ship with the component



Beyond Frameworks            Stuart Herbert - http://blog.stuartherbert.com/php/
Good Tests ...

 • Document supported behaviour
 • Have separate tests for reported bugs
 • Cover 100% of the component’s code
 • Ship with the component



Beyond Frameworks            Stuart Herbert - http://blog.stuartherbert.com/php/
Good Tests ...

 • Document supported behaviour
 • Have separate tests for reported bugs
 • Cover 100% of the component’s code
 • Ship with the component



Beyond Frameworks            Stuart Herbert - http://blog.stuartherbert.com/php/
Getting PHPUnit



 • Visit www.phpunit.de




Beyond Frameworks         Stuart Herbert - http://blog.stuartherbert.com/php/
Documentation




                                    http://flic.kr/p/6wuB99

Beyond Frameworks   Stuart Herbert - http://blog.stuartherbert.com/php/
The PHP Manual
           Is One Of
      PHP’s Killer Features


Beyond Frameworks   Stuart Herbert - http://blog.stuartherbert.com/php/
Make Your Documentation
   At Least As Good!



Beyond Frameworks   Stuart Herbert - http://blog.stuartherbert.com/php/
Good Documentation

 • Explain how to load the component
 • Describe how you intend it to be used
 • Give several (non-trivial!) examples
 • Capture notes / FAQs



Beyond Frameworks            Stuart Herbert - http://blog.stuartherbert.com/php/
Good Documentation

 • Explain how to load the component
 • Describe how you intend it to be used
 • Give several (non-trivial!) examples
 • Capture notes / FAQs



Beyond Frameworks            Stuart Herbert - http://blog.stuartherbert.com/php/
Good Documentation

 • Explain how to load the component
 • Describe how you intend it to be used
 • Give several (non-trivial!) examples
 • Capture notes / FAQs



Beyond Frameworks            Stuart Herbert - http://blog.stuartherbert.com/php/
Good Documentation

 • Explain how to load the component
 • Describe how you intend it to be used
 • Give several (non-trivial!) examples
 • Capture notes / FAQs



Beyond Frameworks            Stuart Herbert - http://blog.stuartherbert.com/php/
Write It Down ...

 • ... so you don’t have to remember
 • ... so you don’t have to keep explaining it to
   others
 • ... so you don’t have to read the source
 • ... so that others are more likely to reuse your
   efforts


Beyond Frameworks             Stuart Herbert - http://blog.stuartherbert.com/php/
Write It Down ...

 • ... so you don’t have to remember
 • ... so you don’t have to keep explaining it to
   others
 • ... so you don’t have to read the source
 • ... so that others are more likely to reuse your
   efforts


Beyond Frameworks             Stuart Herbert - http://blog.stuartherbert.com/php/
Write It Down ...

 • ... so you don’t have to remember
 • ... so you don’t have to keep explaining it to
   others
 • ... so you don’t have to read the source
 • ... so that others are more likely to reuse your
   efforts


Beyond Frameworks             Stuart Herbert - http://blog.stuartherbert.com/php/
Write It Down ...

 • ... so you don’t have to remember
 • ... so you don’t have to keep explaining it to
   others
 • ... so you don’t have to read the source
 • ... so that others are more likely to reuse your
   efforts


Beyond Frameworks             Stuart Herbert - http://blog.stuartherbert.com/php/
Docbook a la PHPUnit




                      www.phpunit.de/manual/3.5/en/

Beyond Frameworks   Stuart Herbert - http://blog.stuartherbert.com/php/
What About phpDoc?


 • Useful for IDE code auto-completion
 • Useful as a summary of a method’s purpose
 • Reference documentation, not a manual




Beyond Frameworks          Stuart Herbert - http://blog.stuartherbert.com/php/
What About phpDoc?


 • Useful for IDE code auto-completion
 • Useful as a summary of a method’s purpose
 • Reference documentation, not a manual




Beyond Frameworks          Stuart Herbert - http://blog.stuartherbert.com/php/
What About phpDoc?


 • Useful for IDE code auto-completion
 • Useful as a summary of a method’s purpose
 • Reference documentation, not a manual




Beyond Frameworks          Stuart Herbert - http://blog.stuartherbert.com/php/
Packaging & Installation




                                    http://flic.kr/p/41vMUJ

Beyond Frameworks   Stuart Herbert - http://blog.stuartherbert.com/php/
PEAR Installer

 • Love it or hate it, PEAR package format
   is a community-created solution
 • PEAR installer found on most computers
 • Supports installing both system-wide and
   into a sandbox
 • Simple to publish your own package repo


Beyond Frameworks           Stuart Herbert - http://blog.stuartherbert.com/php/
PEAR Installer

 • Love it or hate it, PEAR package format
   is a community-created solution
 • PEAR installer found on most computers
 • Supports installing both system-wide and
   into a sandbox
 • Simple to publish your own package repo


Beyond Frameworks           Stuart Herbert - http://blog.stuartherbert.com/php/
PEAR Installer

 • Love it or hate it, PEAR package format
   is a community-created solution
 • PEAR installer found on most computers
 • Supports installing both system-wide and
   into a sandbox
 • Simple to publish your own package repo


Beyond Frameworks           Stuart Herbert - http://blog.stuartherbert.com/php/
PEAR Installer

 • Love it or hate it, PEAR package format
   is a community-created solution
 • PEAR installer found on most computers
 • Supports installing both system-wide and
   into a sandbox
 • Simple to publish your own package repo


Beyond Frameworks           Stuart Herbert - http://blog.stuartherbert.com/php/
Pirum




                         http://www.pirum-project.org/

Beyond Frameworks   Stuart Herbert - http://blog.stuartherbert.com/php/
Your Own PEAR Channel




                    pear channel-discover pear.gradwell.com

Beyond Frameworks          Stuart Herbert - http://blog.stuartherbert.com/php/
Phix For Making Components




                               github.com/Gradwell/phix

Beyond Frameworks   Stuart Herbert - http://blog.stuartherbert.com/php/
Backwards Compatible




                                      http://flic.kr/p/5aK8jA

Beyond Frameworks   Stuart Herbert - http://blog.stuartherbert.com/php/
Why It Matters

 • Isolating code into components reduces
   amount of code that is affected by change
 • Backwards-compatibility breaks immediately
   negate that advantage
 • The more apps use a component, the worse
   the b/c breakage cost scales



Beyond Frameworks           Stuart Herbert - http://blog.stuartherbert.com/php/
Why It Matters

 • Isolating code into components reduces
   amount of code that is affected by change
 • Backwards-compatibility breaks immediately
   negate that advantage
 • The more apps use a component, the worse
   the b/c breakage cost scales



Beyond Frameworks           Stuart Herbert - http://blog.stuartherbert.com/php/
Why It Matters

 • Isolating code into components reduces
   amount of code that is affected by change
 • Backwards-compatibility breaks immediately
   negate that advantage
 • The more apps use a component, the worse
   the b/c breakage cost scales



Beyond Frameworks           Stuart Herbert - http://blog.stuartherbert.com/php/
Transparent Versions

 • X.Y.Z scheme
 • X == Major version / API / ABI version
 • Y == Minor new features
 • Z == Bug fixes



Beyond Frameworks            Stuart Herbert - http://blog.stuartherbert.com/php/
Transparent Versions

 • X.Y.Z scheme
 • X == Major version / API / ABI version
 • Y == Minor new features
 • Z == Bug fixes



Beyond Frameworks            Stuart Herbert - http://blog.stuartherbert.com/php/
Transparent Versions

 • X.Y.Z scheme
 • X == Major version / API / ABI version
 • Y == Minor new features
 • Z == Bug fixes



Beyond Frameworks            Stuart Herbert - http://blog.stuartherbert.com/php/
Transparent Versions

 • X.Y.Z scheme
 • X == Major version / API / ABI version
 • Y == Minor new features
 • Z == Bug fixes



Beyond Frameworks            Stuart Herbert - http://blog.stuartherbert.com/php/
You Can Break B/C

 • Just don’t do it by surprise!
 • Don’t be afraid to increment X in X.Y.Z
 • Google Chrome is already on 10.y.z ...
 • ... and it hasn’t done it any harm



Beyond Frameworks             Stuart Herbert - http://blog.stuartherbert.com/php/
You Can Break B/C

 • Just don’t do it by surprise!
 • Don’t be afraid to increment X in X.Y.Z
 • Google Chrome is already on 10.y.z ...
 • ... and it hasn’t done it any harm



Beyond Frameworks             Stuart Herbert - http://blog.stuartherbert.com/php/
You Can Break B/C

 • Just don’t do it by surprise!
 • Don’t be afraid to increment X in X.Y.Z
 • Google Chrome is already on 10.y.z ...
 • ... and it hasn’t done it any harm



Beyond Frameworks             Stuart Herbert - http://blog.stuartherbert.com/php/
You Can Break B/C

 • Just don’t do it by surprise!
 • Don’t be afraid to increment X in X.Y.Z
 • Google Chrome is already on 10.y.z ...
 • ... and it hasn’t done it any harm



Beyond Frameworks             Stuart Herbert - http://blog.stuartherbert.com/php/
To Recap ...




Beyond Frameworks      Stuart Herbert - http://blog.stuartherbert.com/php/
Good Components ...

 • Autoload
 • Are well tested
 • Are well documented
 • Are easy to install
 • Don’t break backwards compatibility by
   surprise


Beyond Frameworks          Stuart Herbert - http://blog.stuartherbert.com/php/
Good Components ...

 • Autoload
 • Are well tested
 • Are well documented
 • Are easy to install
 • Don’t break backwards compatibility by
   surprise


Beyond Frameworks          Stuart Herbert - http://blog.stuartherbert.com/php/
Good Components ...

 • Autoload
 • Are well tested
 • Are well documented
 • Are easy to install
 • Don’t break backwards compatibility by
   surprise


Beyond Frameworks          Stuart Herbert - http://blog.stuartherbert.com/php/
Good Components ...

 • Autoload
 • Are well tested
 • Are well documented
 • Are easy to install
 • Don’t break backwards compatibility by
   surprise


Beyond Frameworks          Stuart Herbert - http://blog.stuartherbert.com/php/
Good Components ...

 • Autoload
 • Are well tested
 • Are well documented
 • Are easy to install
 • Don’t break backwards compatibility by
   surprise


Beyond Frameworks          Stuart Herbert - http://blog.stuartherbert.com/php/
... If They ...

 • PSR0 - compliant autoloading
 • PHPUnit tests
 • Docbook manual
 • Packages installed via PEAR installer
 • Transparent version numbers


Beyond Frameworks           Stuart Herbert - http://blog.stuartherbert.com/php/
... If They ...

 • PSR0 - compliant autoloading
 • PHPUnit tests
 • Docbook manual
 • Packages installed via PEAR installer
 • Transparent version numbers


Beyond Frameworks           Stuart Herbert - http://blog.stuartherbert.com/php/
... If They ...

 • PSR0 - compliant autoloading
 • PHPUnit tests
 • Docbook manual
 • Packages installed via PEAR installer
 • Transparent version numbers


Beyond Frameworks           Stuart Herbert - http://blog.stuartherbert.com/php/
... If They ...

 • PSR0 - compliant autoloading
 • PHPUnit tests
 • Docbook manual
 • Packages installed via PEAR installer
 • Transparent version numbers


Beyond Frameworks           Stuart Herbert - http://blog.stuartherbert.com/php/
... If They ...

 • PSR0 - compliant autoloading
 • PHPUnit tests
 • Docbook manual
 • Packages installed via PEAR installer
 • Transparent version numbers


Beyond Frameworks           Stuart Herbert - http://blog.stuartherbert.com/php/
4: An Example



Beyond Frameworks   Stuart Herbert - http://blog.stuartherbert.com/php/
We Sell Broadband Via Our Sales Website ...



     Sales Website

        Sales Pitch



       Product Specs



        Availability
         Checker




Beyond Frameworks                 Stuart Herbert - http://blog.stuartherbert.com/php/
And Our Customer Control Panel



     Sales Website                          Control Panel

                                                   Customer
        Sales Pitch
                                                   Account



       Product Specs                                Invoicing



        Availability                              Availability
         Checker                                   Checker




Beyond Frameworks                 Stuart Herbert - http://blog.stuartherbert.com/php/
The Control Panel Holds The Code Hostage
            The Sales Site Relies On An iFrame


     Sales Website                          Control Panel

                                                   Customer
        Sales Pitch
                                                   Account



       Product Specs                                Invoicing


                         iFrame
        Availability                              Availability
         Checker                                   Checker




Beyond Frameworks                 Stuart Herbert - http://blog.stuartherbert.com/php/
... And The Control Panel Talks
        To The Third Party Who Provides Our Broadband


Sales Website              Control Panel                         Third Party

                              Customer
   Sales Pitch                                                        Provisioning
                              Account



  Product Specs                Invoicing                                  Faults



   Availability   iFrame      Availability         SOAP                Availability
    Checker                    Checker                                  Checker




Beyond Frameworks                            Stuart Herbert - http://blog.stuartherbert.com/php/
We Wanted To Sell Exciting New Broadband Products
          From An Alternative Third Party As Well


Sales Website              Control Panel                         Third Party

                              Customer
   Sales Pitch                                                        Provisioning
                              Account



  Product Specs                Invoicing                                  Faults



   Availability   iFrame      Availability         SOAP                Availability
    Checker                    Checker                                  Checker




Beyond Frameworks                            Stuart Herbert - http://blog.stuartherbert.com/php/
Changing The Control Panel
                  Was Going To Be Expensive ...


Sales Website              Control Panel                         Third Party

                              Customer
   Sales Pitch                                                        Provisioning
                              Account



  Product Specs                Invoicing                                  Faults



   Availability   iFrame      Availability         SOAP                Availability
    Checker                    Checker                                  Checker




Beyond Frameworks                            Stuart Herbert - http://blog.stuartherbert.com/php/
... But Was The Only Way
                  To Change The Sales Website


Sales Website              Control Panel                         Third Party

                              Customer
   Sales Pitch                                                        Provisioning
                              Account



  Product Specs                Invoicing                                  Faults



   Availability   iFrame      Availability         SOAP                Availability
    Checker                    Checker                                  Checker




Beyond Frameworks                            Stuart Herbert - http://blog.stuartherbert.com/php/
Problem Is ...
              We Are Due To Retire This Control Panel


Sales Website             Control Panel                         Third Party

                             Customer
   Sales Pitch                                                       Provisioning
                             Account



  Product Specs               Invoicing                                  Faults



   Availability              Availability                             Availability
    Checker                   Checker                                  Checker




Beyond Frameworks                           Stuart Herbert - http://blog.stuartherbert.com/php/
We Separated Out The Business Logic
                       Of The Availability Checker


Sales Website                                                     Third Party

   Sales Pitch                                                         Provisioning



  Product Specs                                                            Faults



   Availability                Availability         SOAP                Availability
    Checker                     Checker                                  Checker




Beyond Frameworks                             Stuart Herbert - http://blog.stuartherbert.com/php/
Sales Can Now Improve Their Website
     Without Having To Rely On Control Panel’s Roadmap


Sales Website         Control Panel                         Third Party

                         Customer
   Sales Pitch                                                   Provisioning
                         Account



  Product Specs           Invoicing                                  Faults



   Availability          Availability         SOAP                Availability
    Checker               Checker                                  Checker




Beyond Frameworks                       Stuart Herbert - http://blog.stuartherbert.com/php/
Allowing Engineering To Retire
                  This Version Of The Control Panel


Sales Website              Control Panel                         Third Party

                              Customer
   Sales Pitch                                                        Provisioning
                              Account



  Product Specs                Invoicing                                  Faults



   Availability               Availability                             Availability
    Checker                    Checker                                  Checker




Beyond Frameworks                            Stuart Herbert - http://blog.stuartherbert.com/php/
And The New Control Panel
      Will Simply Re-use The Component Before Launch


Sales Website         Control Panel 2                       Third Party

                         Customer
   Sales Pitch                                                   Provisioning
                         Account



  Product Specs           Invoicing                                  Faults



   Availability          Availability                             Availability
    Checker               Checker                                  Checker




Beyond Frameworks                       Stuart Herbert - http://blog.stuartherbert.com/php/
Moving To Components
 • Our customer profile has changed
 • We have outgrown our old applications
 • We are refactoring all of the needed logic from
   our old applications
 • Allows Sales and Engineering roadmaps to
   move without major log jams
 • Allows more features (especially internal ones)
   to be shared across more of our apps

Beyond Frameworks            Stuart Herbert - http://blog.stuartherbert.com/php/
Moving To Components
 • Our customer profile has changed
 • We have outgrown our old applications
 • We are refactoring all of the needed logic from
   our old applications
 • Allows Sales and Engineering roadmaps to
   move without major log jams
 • Allows more features (especially internal ones)
   to be shared across more of our apps

Beyond Frameworks            Stuart Herbert - http://blog.stuartherbert.com/php/
Moving To Components
 • Our customer profile has changed
 • We have outgrown our old applications
 • We are refactoring all of the needed logic from
   our old applications
 • Allows Sales and Engineering roadmaps to
   move without major log jams
 • Allows more features (especially internal ones)
   to be shared across more of our apps

Beyond Frameworks            Stuart Herbert - http://blog.stuartherbert.com/php/
Moving To Components
 • Our customer profile has changed
 • We have outgrown our old applications
 • We are refactoring all of the needed logic from
   our old applications
 • Allows Sales and Engineering roadmaps to
   move without major log jams
 • Allows more features (especially internal ones)
   to be shared across more of our apps

Beyond Frameworks            Stuart Herbert - http://blog.stuartherbert.com/php/
Moving To Components
 • Our customer profile has changed
 • We have outgrown our old applications
 • We are refactoring all of the needed logic from
   our old applications
 • Allows Sales and Engineering roadmaps to
   move without major log jams
 • Allows more features (especially internal ones)
   to be shared across more of our apps

Beyond Frameworks            Stuart Herbert - http://blog.stuartherbert.com/php/
Thanks For Your Time
Feedback welcome!

I’d love to hear your stories




                                                       Stuart Herbert
              stuart@stuartherbert.com - http://blog.stuartherbert.com/php/
This photo: http://flic.kr/p/3PU451




                                         Stuart Herbert
stuart@stuartherbert.com - http://blog.stuartherbert.com/php/

Weitere ähnliche Inhalte

Ähnlich wie Beyond Frameworks

Return Of The Browser Wars Ajax World West2007
Return Of The Browser Wars Ajax World West2007Return Of The Browser Wars Ajax World West2007
Return Of The Browser Wars Ajax World West2007John Eckman
 
20091112 - Mars Jug - Apache Maven
20091112 - Mars Jug - Apache Maven20091112 - Mars Jug - Apache Maven
20091112 - Mars Jug - Apache MavenArnaud Héritier
 
2014-11-11 Multiple Approaches to Managing Puppet Modules @ Puppet Camp Seattle
2014-11-11 Multiple Approaches to Managing Puppet Modules @ Puppet Camp Seattle2014-11-11 Multiple Approaches to Managing Puppet Modules @ Puppet Camp Seattle
2014-11-11 Multiple Approaches to Managing Puppet Modules @ Puppet Camp Seattlegarrett honeycutt
 
Getting started with coding for Jolla Sailfish OS. 22 Feb 2014, Tampere, Finland
Getting started with coding for Jolla Sailfish OS. 22 Feb 2014, Tampere, FinlandGetting started with coding for Jolla Sailfish OS. 22 Feb 2014, Tampere, Finland
Getting started with coding for Jolla Sailfish OS. 22 Feb 2014, Tampere, FinlandArtem Marchenko
 
Demystifying versioning in spfx solutions
Demystifying versioning in spfx solutionsDemystifying versioning in spfx solutions
Demystifying versioning in spfx solutionsJasjit Chopra
 
Introduction, deployment and hybrid clouds
Introduction, deployment and hybrid cloudsIntroduction, deployment and hybrid clouds
Introduction, deployment and hybrid cloudsFlavio Percoco Premoli
 
Apache Maven - eXo VN office presentation
Apache Maven - eXo VN office presentationApache Maven - eXo VN office presentation
Apache Maven - eXo VN office presentationArnaud Héritier
 
Around the PHP Community
Around the PHP CommunityAround the PHP Community
Around the PHP CommunityBen Ramsey
 
Managing and Monitoring Application Performance
Managing and Monitoring Application PerformanceManaging and Monitoring Application Performance
Managing and Monitoring Application PerformanceSebastian Marek
 
Composer - The missing package manager for PHP
Composer - The missing package manager for PHPComposer - The missing package manager for PHP
Composer - The missing package manager for PHPTareq Hasan
 
WordPress Plugin Development 201
WordPress Plugin Development 201WordPress Plugin Development 201
WordPress Plugin Development 201ylefebvre
 
[Rakuten TechConf2014] [E-4] Rakuten Front-end Framework Project
[Rakuten TechConf2014] [E-4] Rakuten Front-end Framework Project[Rakuten TechConf2014] [E-4] Rakuten Front-end Framework Project
[Rakuten TechConf2014] [E-4] Rakuten Front-end Framework ProjectRakuten Group, Inc.
 
5 年後還是新手 - WordPress Plugin 開發大冒險 - GOTY
5 年後還是新手 - WordPress Plugin 開發大冒險 - GOTY5 年後還是新手 - WordPress Plugin 開發大冒險 - GOTY
5 年後還是新手 - WordPress Plugin 開發大冒險 - GOTYWilliam Chong
 
Spring Integration Done Bootifully
Spring Integration Done BootifullySpring Integration Done Bootifully
Spring Integration Done BootifullyGlenn Renfro
 
An Introduction to Xdebug for WordPress
An Introduction to Xdebug for WordPressAn Introduction to Xdebug for WordPress
An Introduction to Xdebug for WordPressKayleigh Thorpe
 
Codeigniter : The Introduction
Codeigniter  : The IntroductionCodeigniter  : The Introduction
Codeigniter : The IntroductionAbdul Malik Ikhsan
 
Advanced deployment scenarios (netcoreconf)
Advanced deployment scenarios (netcoreconf)Advanced deployment scenarios (netcoreconf)
Advanced deployment scenarios (netcoreconf)Sergio Navarro Pino
 

Ähnlich wie Beyond Frameworks (20)

Return Of The Browser Wars Ajax World West2007
Return Of The Browser Wars Ajax World West2007Return Of The Browser Wars Ajax World West2007
Return Of The Browser Wars Ajax World West2007
 
20091112 - Mars Jug - Apache Maven
20091112 - Mars Jug - Apache Maven20091112 - Mars Jug - Apache Maven
20091112 - Mars Jug - Apache Maven
 
2014-11-11 Multiple Approaches to Managing Puppet Modules @ Puppet Camp Seattle
2014-11-11 Multiple Approaches to Managing Puppet Modules @ Puppet Camp Seattle2014-11-11 Multiple Approaches to Managing Puppet Modules @ Puppet Camp Seattle
2014-11-11 Multiple Approaches to Managing Puppet Modules @ Puppet Camp Seattle
 
Don't screw it up! How to build durable API
Don't screw it up! How to build durable API Don't screw it up! How to build durable API
Don't screw it up! How to build durable API
 
Getting started with coding for Jolla Sailfish OS. 22 Feb 2014, Tampere, Finland
Getting started with coding for Jolla Sailfish OS. 22 Feb 2014, Tampere, FinlandGetting started with coding for Jolla Sailfish OS. 22 Feb 2014, Tampere, Finland
Getting started with coding for Jolla Sailfish OS. 22 Feb 2014, Tampere, Finland
 
Demystifying versioning in spfx solutions
Demystifying versioning in spfx solutionsDemystifying versioning in spfx solutions
Demystifying versioning in spfx solutions
 
Introduction, deployment and hybrid clouds
Introduction, deployment and hybrid cloudsIntroduction, deployment and hybrid clouds
Introduction, deployment and hybrid clouds
 
Apache Maven - eXo VN office presentation
Apache Maven - eXo VN office presentationApache Maven - eXo VN office presentation
Apache Maven - eXo VN office presentation
 
Around the PHP Community
Around the PHP CommunityAround the PHP Community
Around the PHP Community
 
Managing and Monitoring Application Performance
Managing and Monitoring Application PerformanceManaging and Monitoring Application Performance
Managing and Monitoring Application Performance
 
Composer - The missing package manager for PHP
Composer - The missing package manager for PHPComposer - The missing package manager for PHP
Composer - The missing package manager for PHP
 
Java User Group Cologne
Java User Group CologneJava User Group Cologne
Java User Group Cologne
 
WordPress Plugin Development 201
WordPress Plugin Development 201WordPress Plugin Development 201
WordPress Plugin Development 201
 
[Rakuten TechConf2014] [E-4] Rakuten Front-end Framework Project
[Rakuten TechConf2014] [E-4] Rakuten Front-end Framework Project[Rakuten TechConf2014] [E-4] Rakuten Front-end Framework Project
[Rakuten TechConf2014] [E-4] Rakuten Front-end Framework Project
 
5 年後還是新手 - WordPress Plugin 開發大冒險 - GOTY
5 年後還是新手 - WordPress Plugin 開發大冒險 - GOTY5 年後還是新手 - WordPress Plugin 開發大冒險 - GOTY
5 年後還是新手 - WordPress Plugin 開發大冒險 - GOTY
 
Spring Integration Done Bootifully
Spring Integration Done BootifullySpring Integration Done Bootifully
Spring Integration Done Bootifully
 
An Introduction to Xdebug for WordPress
An Introduction to Xdebug for WordPressAn Introduction to Xdebug for WordPress
An Introduction to Xdebug for WordPress
 
Php
PhpPhp
Php
 
Codeigniter : The Introduction
Codeigniter  : The IntroductionCodeigniter  : The Introduction
Codeigniter : The Introduction
 
Advanced deployment scenarios (netcoreconf)
Advanced deployment scenarios (netcoreconf)Advanced deployment scenarios (netcoreconf)
Advanced deployment scenarios (netcoreconf)
 

Kürzlich hochgeladen

TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 

Kürzlich hochgeladen (20)

TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 

Beyond Frameworks

  • 1. Beyond Frameworks Using Frameworks Without Becoming A Hostage To Them Stuart Herbert stuart@stuartherbert.com - http://blog.stuartherbert.com/php/
  • 2. About Stuart • Head of Engineering, Gradwell.com • Co-author, Zend Certification Study Guide for PHP 4 • Open-source Contributor Since 1994 Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 3. About Stuart • Head of Engineering, Gradwell.com • Co-author, Zend Certification Study Guide for PHP 4 • Open-source Contributor Since 1994 Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 4. About Stuart • Head of Engineering, Gradwell.com • Co-author, Zend Certification Study Guide for PHP 4 • Open-source Contributor Since 1994 Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 5. Contents How Frameworks 1 Have Held Us Hostage Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 6. Contents Our Layered Architecture 2 For PHP Applications Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 7. Contents What Makes 3 A Good Component? Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 8. Contents How Components 4 Are Helping Gradwell Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 9. Questions At The End, Please Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 10. Questions For The Audience ... Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 11. http://flic.kr/p/R33dr Who Uses A Framework? Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 12. http://flic.kr/p/qq6F1 Who Develops Software Products? Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 13. 1: Hostages To Frameworks Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 14. Stop Me If You’ve Heard This One Before ... Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 15. First generation apps are highly-coupled Neat until you attempt to untangle them! http://flic.kr/p/7MmEiv Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 16. First generation apps are highly-coupled Neat until you attempt to untangle them! http://flic.kr/p/7MmEiv Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 17. Second generation app built on top of own framework Developers enjoyed building it But they hated completing it or maintaining it http://flic.kr/p/4sK29V Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 18. Second generation app built on top of own framework Developers enjoyed building it But they hated completing it or maintaining it http://flic.kr/p/4sK29V Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 19. Second generation app built on top of own framework Developers enjoyed building it But they hated completing it or maintaining it http://flic.kr/p/4sK29V Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 20. So We Used A Popular Framework ... Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 21. ... Or Two ... Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 22. Third generation app easy to extend ... after the steep learning curve http://flic.kr/p/2k87DM Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 23. Third generation app easy to extend ... after the steep learning curve http://flic.kr/p/2k87DM Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 24. We couldn’t get the code out to re-use in other apps :( http://flic.kr/p/7132Wm Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 25. What The Architecture Should Look Like Framework Your Code Plugins Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 26. What Happened In Reality :( Framework Your Code Plugins Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 27. What Practical Challenges Does This Create? Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 28. How long would it take to upgrade your app to the next major version of the framework? Would you do the upgrade, or stick with the current framework version? http://flic.kr/p/5Z6Arf Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 29. How long would it take to upgrade your app to the next major version of the framework? Would you do the upgrade, or stick with the current framework version? http://flic.kr/p/5Z6Arf Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 30. What would it take to switch your app to a different framework? Could you port your code, or would you be forced to rewrite all or most of it? http://flic.kr/p/4Z8oZE Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 31. What would it take to switch your app to a different framework? Could you port your code, or would you be forced to rewrite all or most of it? http://flic.kr/p/4Z8oZE Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 32. How would you re-use some of your app’s code in a different app? Especially if the other app doesn’t use the same framework? http://flic.kr/p/85jzRA Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 33. How would you re-use some of your app’s code in a different app? Especially if the other app doesn’t use the same framework? http://flic.kr/p/85jzRA Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 34. How would you outsource some of your app development to teams around the world? How would you accept the work delivered back to you? http://flic.kr/p/6GMfQc Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 35. How would you outsource some of your app development to teams around the world? How would you accept the work delivered back to you? http://flic.kr/p/6GMfQc Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 36. We Need To Change This ... Framework Your Code Plugins Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 37. To What ...? Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 38. 2: Layered Approach Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 39. Let’s Take The Original Architecture ... Application Frameworks Your Code Plugins Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 40. ... And Make The App As Thin As Possible Application Frameworks App Code Plugins Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 41. By Extracting Out ... Application Frameworks App Code Plugins Business Logic Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 42. By Extracting Out ... Application Frameworks App Code Plugins Business Logic Data Model Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 43. By Extracting Out ... Application Frameworks App Code Plugins Business Logic Data Model Utilities Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 44. ... Into Independent Libraries Of Code Application Frameworks App Code Plugins Components Business Logic Data Model Utilities Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 45. Use An Autoloader To Pull In These New Components Application Frameworks App Code Plugins Autoloader Components Business Logic Data Model Utilities Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 46. This Gives You A Larger Set Of Reusable Code Application Frameworks App Code Plugins Autoloader Components Business Logic Data Model Utilities Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 47. The Frameworked App Becomes A Thin Layer On Top Of Framework-agnostic Reusable Components Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 48. Layered Architecture Application Frameworks App Code Plugins Autoloader Components Business Logic Data Model Utilities Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 49. Layered Architecture Application Components Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 50. Why Components? • Completely independent of Business Logic the framework • Built & tested in isolation of your app code Data Model • Can be built by different teams • Don’t have to change when Utilities the framework changes Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 51. Why Components? • Completely independent of Business Logic the framework • Built & tested in isolation of your app code Data Model • Can be built by different teams • Don’t have to change when Utilities the framework changes Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 52. Why Components? • Completely independent of Business Logic the framework • Built & tested in isolation of your app code Data Model • Can be built by different teams • Don’t have to change when Utilities the framework changes Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 53. Why Components? • Completely independent of Business Logic the framework • Built & tested in isolation of your app code Data Model • Can be built by different teams • Don’t have to change when Utilities the framework changes Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 54. Why Components? • Reduces the Big Ball of Business Logic String Syndrome • Mindset change to light apps on top of rich service layer Data Model • Improves development in parallel of apps & services • Injects additional discipline Utilities into development teams Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 55. Why Components? • Reduces the Big Ball of Business Logic String Syndrome • Mindset change to light apps on top of rich service layer Data Model • Improves development in parallel of apps & services • Injects additional discipline Utilities into development teams Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 56. Why Components? • Reduces the Big Ball of Business Logic String Syndrome • Mindset change to light apps on top of rich service layer Data Model • Improves development in parallel of apps & services • Injects additional discipline Utilities into development teams Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 57. Why Components? • Reduces the Big Ball of Business Logic String Syndrome • Mindset change to light apps on top of rich service layer Data Model • Improves development in parallel of apps & services • Injects additional discipline Utilities into development teams Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 58. Others Already Do This Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 59. http://flic.kr/p/5oewwy Perl Has CPAN Modules Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 60. http://flic.kr/p/uyMuU Ruby Has Gems Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 61. What Makes A Good Component? Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 62. 3: Good Components Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 63. Component Standards • Common standards • Reusable by many • Interoperable • Trustable Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 64. Component Standards • Common standards • Reusable by many • Interoperable • Trustable Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 65. Component Standards • Common standards • Reusable by many • Interoperable • Trustable Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 66. Component Standards • Common standards • Reusable by many • Interoperable • Trustable Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 67. Good Components ... • Autoload • Are well tested • Are well documented • Are easy to install • Don’t break backwards compatibility by surprise Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 68. Good Components ... • Autoload • Are well tested • Are well documented • Are easy to install • Don’t break backwards compatibility by surprise Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 69. Good Components ... • Autoload • Are well tested • Are well documented • Are easy to install • Don’t break backwards compatibility by surprise Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 70. Good Components ... • Autoload • Are well tested • Are well documented • Are easy to install • Don’t break backwards compatibility by surprise Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 71. Good Components ... • Autoload • Are well tested • Are well documented • Are easy to install • Don’t break backwards compatibility by surprise Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 72. Keep Components Outside Of Your App Application Frameworks App Code Plugins Components Business Logic Data Model Utilities Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 73. Use An Autoloader To Pull In Components Application Frameworks App Code Plugins Autoloader Components Business Logic Data Model Utilities Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 74. Why Use An Autoloader? Application Frameworks App Code Plugins Autoloader Components Business Logic Data Model Utilities Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 75. Autoloading Makes Life Easy! Application Frameworks App Code Plugins Autoloader Components Business Logic Data Model Utilities Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 76. One True Autoloader • Who has heard of PSR0? • http://groups.google.com/group/php- standards/web/psr-0-final-proposal • Backed by leading names in the community • Perfect for a component approach Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 77. One True Autoloader • Who has heard of PSR0? • http://groups.google.com/group/php- standards/web/psr-0-final-proposal • Backed by leading names in the community • Perfect for a component approach Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 78. One True Autoloader • Who has heard of PSR0? • http://groups.google.com/group/php- standards/web/psr-0-final-proposal • Backed by leading names in the community • Perfect for a component approach Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 79. One True Autoloader • Who has heard of PSR0? • http://groups.google.com/group/php- standards/web/psr-0-final-proposal • Backed by leading names in the community • Perfect for a component approach Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 80. PSR0 Autoloader • Namespace separators ‘’ become DIRECTORY_SEPARATOR • Underscore in class names ‘_’ become DIRECTORY_SEPARATOR • Top namespace is your organisation • Achieves 1:1 mapping from classname to filename on disk Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 81. PSR0 Autoloader • Namespace separators ‘’ become DIRECTORY_SEPARATOR • Underscore in class names ‘_’ become DIRECTORY_SEPARATOR • Top namespace is your organisation • Achieves 1:1 mapping from classname to filename on disk Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 82. PSR0 Autoloader • Namespace separators ‘’ become DIRECTORY_SEPARATOR • Underscore in class names ‘_’ become DIRECTORY_SEPARATOR • Top namespace is your organisation • Achieves 1:1 mapping from classname to filename on disk Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 83. PSR0 Autoloader • Namespace separators ‘’ become DIRECTORY_SEPARATOR • Underscore in class names ‘_’ become DIRECTORY_SEPARATOR • Top namespace is your organisation • Achieves 1:1 mapping from classname to filename on disk Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 84. Autoloader Examples • Phin_ProjectExtenderLibFileLoader -> Phin_Project/ExtenderLib/FileLoader.php • Phin_ProjectConsoleStd_Out -> Phin_Project/Console/Std/Out.php Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 85. Autoloader Examples • Phin_ProjectExtenderLibFileLoader -> Phin_Project/ExtenderLib/FileLoader.php • Phin_ProjectConsoleStd_Out -> Phin_Project/Console/Std/Out.php Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 86. Autoloader Component • pear channel-discover pear.gradwell.com • pear install Gradwell/Autoloader Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 87. Autoloader Component • pear channel-discover pear.gradwell.com • pear install Gradwell/Autoloader Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 88. Testing http://flic.kr/p/3c2W8q Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 89. PHPUnit • De-facto standard for unit-testing PHP code • Supported by leading IDEs • Supported by CI environments • Perfect for use with components Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 90. PHPUnit • De-facto standard for unit-testing PHP code • Supported by leading IDEs • Supported by CI environments • Perfect for use with components Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 91. PHPUnit • De-facto standard for unit-testing PHP code • Supported by leading IDEs • Supported by CI environments • Perfect for use with components Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 92. PHPUnit • De-facto standard for unit-testing PHP code • Supported by leading IDEs • Supported by CI environments • Perfect for use with components Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 93. Good Tests ... • Document supported behaviour • Have separate tests for reported bugs • Cover 100% of the component’s code • Ship with the component Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 94. Good Tests ... • Document supported behaviour • Have separate tests for reported bugs • Cover 100% of the component’s code • Ship with the component Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 95. Good Tests ... • Document supported behaviour • Have separate tests for reported bugs • Cover 100% of the component’s code • Ship with the component Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 96. Good Tests ... • Document supported behaviour • Have separate tests for reported bugs • Cover 100% of the component’s code • Ship with the component Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 97. Getting PHPUnit • Visit www.phpunit.de Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 98. Documentation http://flic.kr/p/6wuB99 Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 99. The PHP Manual Is One Of PHP’s Killer Features Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 100. Make Your Documentation At Least As Good! Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 101. Good Documentation • Explain how to load the component • Describe how you intend it to be used • Give several (non-trivial!) examples • Capture notes / FAQs Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 102. Good Documentation • Explain how to load the component • Describe how you intend it to be used • Give several (non-trivial!) examples • Capture notes / FAQs Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 103. Good Documentation • Explain how to load the component • Describe how you intend it to be used • Give several (non-trivial!) examples • Capture notes / FAQs Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 104. Good Documentation • Explain how to load the component • Describe how you intend it to be used • Give several (non-trivial!) examples • Capture notes / FAQs Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 105. Write It Down ... • ... so you don’t have to remember • ... so you don’t have to keep explaining it to others • ... so you don’t have to read the source • ... so that others are more likely to reuse your efforts Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 106. Write It Down ... • ... so you don’t have to remember • ... so you don’t have to keep explaining it to others • ... so you don’t have to read the source • ... so that others are more likely to reuse your efforts Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 107. Write It Down ... • ... so you don’t have to remember • ... so you don’t have to keep explaining it to others • ... so you don’t have to read the source • ... so that others are more likely to reuse your efforts Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 108. Write It Down ... • ... so you don’t have to remember • ... so you don’t have to keep explaining it to others • ... so you don’t have to read the source • ... so that others are more likely to reuse your efforts Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 109. Docbook a la PHPUnit www.phpunit.de/manual/3.5/en/ Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 110. What About phpDoc? • Useful for IDE code auto-completion • Useful as a summary of a method’s purpose • Reference documentation, not a manual Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 111. What About phpDoc? • Useful for IDE code auto-completion • Useful as a summary of a method’s purpose • Reference documentation, not a manual Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 112. What About phpDoc? • Useful for IDE code auto-completion • Useful as a summary of a method’s purpose • Reference documentation, not a manual Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 113. Packaging & Installation http://flic.kr/p/41vMUJ Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 114. PEAR Installer • Love it or hate it, PEAR package format is a community-created solution • PEAR installer found on most computers • Supports installing both system-wide and into a sandbox • Simple to publish your own package repo Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 115. PEAR Installer • Love it or hate it, PEAR package format is a community-created solution • PEAR installer found on most computers • Supports installing both system-wide and into a sandbox • Simple to publish your own package repo Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 116. PEAR Installer • Love it or hate it, PEAR package format is a community-created solution • PEAR installer found on most computers • Supports installing both system-wide and into a sandbox • Simple to publish your own package repo Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 117. PEAR Installer • Love it or hate it, PEAR package format is a community-created solution • PEAR installer found on most computers • Supports installing both system-wide and into a sandbox • Simple to publish your own package repo Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 118. Pirum http://www.pirum-project.org/ Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 119. Your Own PEAR Channel pear channel-discover pear.gradwell.com Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 120. Phix For Making Components github.com/Gradwell/phix Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 121. Backwards Compatible http://flic.kr/p/5aK8jA Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 122. Why It Matters • Isolating code into components reduces amount of code that is affected by change • Backwards-compatibility breaks immediately negate that advantage • The more apps use a component, the worse the b/c breakage cost scales Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 123. Why It Matters • Isolating code into components reduces amount of code that is affected by change • Backwards-compatibility breaks immediately negate that advantage • The more apps use a component, the worse the b/c breakage cost scales Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 124. Why It Matters • Isolating code into components reduces amount of code that is affected by change • Backwards-compatibility breaks immediately negate that advantage • The more apps use a component, the worse the b/c breakage cost scales Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 125. Transparent Versions • X.Y.Z scheme • X == Major version / API / ABI version • Y == Minor new features • Z == Bug fixes Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 126. Transparent Versions • X.Y.Z scheme • X == Major version / API / ABI version • Y == Minor new features • Z == Bug fixes Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 127. Transparent Versions • X.Y.Z scheme • X == Major version / API / ABI version • Y == Minor new features • Z == Bug fixes Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 128. Transparent Versions • X.Y.Z scheme • X == Major version / API / ABI version • Y == Minor new features • Z == Bug fixes Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 129. You Can Break B/C • Just don’t do it by surprise! • Don’t be afraid to increment X in X.Y.Z • Google Chrome is already on 10.y.z ... • ... and it hasn’t done it any harm Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 130. You Can Break B/C • Just don’t do it by surprise! • Don’t be afraid to increment X in X.Y.Z • Google Chrome is already on 10.y.z ... • ... and it hasn’t done it any harm Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 131. You Can Break B/C • Just don’t do it by surprise! • Don’t be afraid to increment X in X.Y.Z • Google Chrome is already on 10.y.z ... • ... and it hasn’t done it any harm Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 132. You Can Break B/C • Just don’t do it by surprise! • Don’t be afraid to increment X in X.Y.Z • Google Chrome is already on 10.y.z ... • ... and it hasn’t done it any harm Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 133. To Recap ... Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 134. Good Components ... • Autoload • Are well tested • Are well documented • Are easy to install • Don’t break backwards compatibility by surprise Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 135. Good Components ... • Autoload • Are well tested • Are well documented • Are easy to install • Don’t break backwards compatibility by surprise Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 136. Good Components ... • Autoload • Are well tested • Are well documented • Are easy to install • Don’t break backwards compatibility by surprise Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 137. Good Components ... • Autoload • Are well tested • Are well documented • Are easy to install • Don’t break backwards compatibility by surprise Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 138. Good Components ... • Autoload • Are well tested • Are well documented • Are easy to install • Don’t break backwards compatibility by surprise Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 139. ... If They ... • PSR0 - compliant autoloading • PHPUnit tests • Docbook manual • Packages installed via PEAR installer • Transparent version numbers Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 140. ... If They ... • PSR0 - compliant autoloading • PHPUnit tests • Docbook manual • Packages installed via PEAR installer • Transparent version numbers Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 141. ... If They ... • PSR0 - compliant autoloading • PHPUnit tests • Docbook manual • Packages installed via PEAR installer • Transparent version numbers Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 142. ... If They ... • PSR0 - compliant autoloading • PHPUnit tests • Docbook manual • Packages installed via PEAR installer • Transparent version numbers Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 143. ... If They ... • PSR0 - compliant autoloading • PHPUnit tests • Docbook manual • Packages installed via PEAR installer • Transparent version numbers Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 144. 4: An Example Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 145. We Sell Broadband Via Our Sales Website ... Sales Website Sales Pitch Product Specs Availability Checker Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 146. And Our Customer Control Panel Sales Website Control Panel Customer Sales Pitch Account Product Specs Invoicing Availability Availability Checker Checker Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 147. The Control Panel Holds The Code Hostage The Sales Site Relies On An iFrame Sales Website Control Panel Customer Sales Pitch Account Product Specs Invoicing iFrame Availability Availability Checker Checker Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 148. ... And The Control Panel Talks To The Third Party Who Provides Our Broadband Sales Website Control Panel Third Party Customer Sales Pitch Provisioning Account Product Specs Invoicing Faults Availability iFrame Availability SOAP Availability Checker Checker Checker Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 149. We Wanted To Sell Exciting New Broadband Products From An Alternative Third Party As Well Sales Website Control Panel Third Party Customer Sales Pitch Provisioning Account Product Specs Invoicing Faults Availability iFrame Availability SOAP Availability Checker Checker Checker Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 150. Changing The Control Panel Was Going To Be Expensive ... Sales Website Control Panel Third Party Customer Sales Pitch Provisioning Account Product Specs Invoicing Faults Availability iFrame Availability SOAP Availability Checker Checker Checker Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 151. ... But Was The Only Way To Change The Sales Website Sales Website Control Panel Third Party Customer Sales Pitch Provisioning Account Product Specs Invoicing Faults Availability iFrame Availability SOAP Availability Checker Checker Checker Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 152. Problem Is ... We Are Due To Retire This Control Panel Sales Website Control Panel Third Party Customer Sales Pitch Provisioning Account Product Specs Invoicing Faults Availability Availability Availability Checker Checker Checker Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 153. We Separated Out The Business Logic Of The Availability Checker Sales Website Third Party Sales Pitch Provisioning Product Specs Faults Availability Availability SOAP Availability Checker Checker Checker Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 154. Sales Can Now Improve Their Website Without Having To Rely On Control Panel’s Roadmap Sales Website Control Panel Third Party Customer Sales Pitch Provisioning Account Product Specs Invoicing Faults Availability Availability SOAP Availability Checker Checker Checker Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 155. Allowing Engineering To Retire This Version Of The Control Panel Sales Website Control Panel Third Party Customer Sales Pitch Provisioning Account Product Specs Invoicing Faults Availability Availability Availability Checker Checker Checker Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 156. And The New Control Panel Will Simply Re-use The Component Before Launch Sales Website Control Panel 2 Third Party Customer Sales Pitch Provisioning Account Product Specs Invoicing Faults Availability Availability Availability Checker Checker Checker Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 157. Moving To Components • Our customer profile has changed • We have outgrown our old applications • We are refactoring all of the needed logic from our old applications • Allows Sales and Engineering roadmaps to move without major log jams • Allows more features (especially internal ones) to be shared across more of our apps Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 158. Moving To Components • Our customer profile has changed • We have outgrown our old applications • We are refactoring all of the needed logic from our old applications • Allows Sales and Engineering roadmaps to move without major log jams • Allows more features (especially internal ones) to be shared across more of our apps Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 159. Moving To Components • Our customer profile has changed • We have outgrown our old applications • We are refactoring all of the needed logic from our old applications • Allows Sales and Engineering roadmaps to move without major log jams • Allows more features (especially internal ones) to be shared across more of our apps Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 160. Moving To Components • Our customer profile has changed • We have outgrown our old applications • We are refactoring all of the needed logic from our old applications • Allows Sales and Engineering roadmaps to move without major log jams • Allows more features (especially internal ones) to be shared across more of our apps Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 161. Moving To Components • Our customer profile has changed • We have outgrown our old applications • We are refactoring all of the needed logic from our old applications • Allows Sales and Engineering roadmaps to move without major log jams • Allows more features (especially internal ones) to be shared across more of our apps Beyond Frameworks Stuart Herbert - http://blog.stuartherbert.com/php/
  • 162. Thanks For Your Time Feedback welcome! I’d love to hear your stories Stuart Herbert stuart@stuartherbert.com - http://blog.stuartherbert.com/php/
  • 163. This photo: http://flic.kr/p/3PU451 Stuart Herbert stuart@stuartherbert.com - http://blog.stuartherbert.com/php/