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/
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/
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/