Making Frameworks Suck Less—IPC

35
Making Frameworks Suck Less terry chay International PHP Conference, Berlin 2009-05-26T09:00+200

description

The PDF version of the slides deck from my talk on "Making Frameworks Suck Less" given at International PHP Conference in Berlin, Germany on May 2009 Instead of trying to say why one framework is "the best" it's better to talk about realities that apply to all frameworks in our problem space. What are the challenges and choices in framework design? How is our choice of PHP augment those strengths and in what areas does that choice face challenges?

Transcript of Making Frameworks Suck Less—IPC

Page 1: Making Frameworks Suck Less—IPC

Making Frameworks Suck Lessterry chayInternational PHP Conference, Berlin2009-05-26T09:00+200

Page 2: Making Frameworks Suck Less—IPC

Roadmap Introduction

Page 3: Making Frameworks Suck Less—IPC

Where I’m coming from

Page 4: Making Frameworks Suck Less—IPC

Terry Chay goes to Zendcon

Not about making frameworks suck less…so much as why frameworks suck.

Page 5: Making Frameworks Suck Less—IPC

PHP Coding Web Development OOPEngine- What are differences between PHP4 and PHP5?- How does PHP4 handle objects strangely?-- How does PHP5 fix this-- Name an interesting PHP quirk you came across in your last project?- How are defines different from variables?-- Faster?-- Better?- How does the Zend Engine work (basically)? (Or explain the what a JVM is__-- How does code caching work?-- Why is Java and dotNet faster than PHP ever will be?-- how is javac different than gcc?settings- What is "safe mode"?- How do you code around "magic_quotes_gpc=on"?- What is PEAR?-- How do you install a PEAR library-- How does PEAR handle errors?- What is a PHP extension?-- Why extensions at all? what are the advantages of extensions-- what are the disadvantages of extensions?-- How do you compile extensions?-- Where repositories for extensions?…

g11n- What is the difference between i18n and l10n?- How would you solve that architecturally?- How does PHP deal with it?- What are some pitfalls to avoid in character handling?SQL injection- what is an SQL injection attack?-- How do you fix it? (three ways)-- Which one would you do?-- How do you create a security audit point?OTHER ATTACKS- what is session fixation- what is XSS- what is XSRF-- Can you give an example about XSRF to determine login state on a remote site?Philosophy- What does "filter-input escape output" mean?-- example of filter?-- example of escape?-- what is "magic quotes" and why is it bad?HTML/CSS- Example of browser rendering quirk?-- Workaround?- Box model?…

- What is a design pattern?-- why is it not an algorithm?-- why use patterns at all?-- Example-- what is a "consequence" mean?-- consequences of the pattern-- what is "is a" relationship?-- How does that relate to design patterns?- How is HTML templating MVC?-- how is not like MVC?- Name a principle of package reuse?- Strengths and weaknesses of frameworks?- In design define-- poor design example: (rigidity, fragility, immobility, viscosity, needles complexity, needless repetition, opacity)-- Single Responsibility Principle?-- Open-Close Principle?-- Liskov Substitution Principle?-- Dependency-Inversion Principle?-- Interface Segregation Principle?- Principle of Package reuse-- Release-Reuse Equivalenc?-- Common Closure Principle?-- Common Reuse Principle?-- Acyclic Dependencies Principle?-- Stable Dependencies Principle?-- Stable Abstractions Principle?- HTTP protocol- what is the difference between post and get?-- name some HTTP headers?- areas of race conditions in PHP?…

Page 6: Making Frameworks Suck Less—IPC

Roadmap Challenges and Choices

Page 7: Making Frameworks Suck Less—IPC

ChoicesWriting software is about MAKING CHOICES

?!

Page 8: Making Frameworks Suck Less—IPC

What is adesign pattern?

Has a name

Solves a problem

Independent of code that implements it

Has consequences

breadcrumbs

tabs

Page 9: Making Frameworks Suck Less—IPC

Pareto Principle

Page 10: Making Frameworks Suck Less—IPC

Pareto Principle

Page 11: Making Frameworks Suck Less—IPC

Ruby on Rails (Frameworks)

graph of rock and hard placetext: rock, hard place, “here is ruby”

Page 12: Making Frameworks Suck Less—IPC
Page 13: Making Frameworks Suck Less—IPC

The Database

Ahmdahl’s law and abstraction (Premature Optimization)

Database Scalability (“Moore’s Law” punt, vs. master-slave, vs. vertical vs. horizontal

Independence vs. Portability

Page 14: Making Frameworks Suck Less—IPC

Roadmap Where Frameworks Rock

Page 15: Making Frameworks Suck Less—IPC

Toy Sites

Page 16: Making Frameworks Suck Less—IPC

“Enterprise”

Page 17: Making Frameworks Suck Less—IPC

Standardization

Page 18: Making Frameworks Suck Less—IPC

RAD

Page 19: Making Frameworks Suck Less—IPC

Roadmap Where PHP Rocks

Page 20: Making Frameworks Suck Less—IPC

Must keep with PHP’s

easy

simple

direct

ugly

Page 21: Making Frameworks Suck Less—IPC

BrayismTim Bray of Sun on developing in PHP…

Page 22: Making Frameworks Suck Less—IPC

BrayismTim Bray

Page 23: Making Frameworks Suck Less—IPC

Glue

Originally 3 tier

Now glue: client, db, memcache, smtp (virality), http services (REST, XMLRPC, SOAP), http scraping, UDP logging, other long-lived services (search, map reduce, message q, cometd)

Page 24: Making Frameworks Suck Less—IPC
Page 25: Making Frameworks Suck Less—IPC

Roadmap Examples of Good Framework Design

Page 26: Making Frameworks Suck Less—IPC

Solves errors

Design patterns solve errors in design

Page 27: Making Frameworks Suck Less—IPC

Other stuff

configuration, registry

caching (memcache = L2)

where? readthrough, output, db

publish-subscribe (inversion of control, AQS)

i18n/l10n

A-B testing, analytics, loggin

Page 28: Making Frameworks Suck Less—IPC

Roadmap Challenges and Choices in PHP

Page 29: Making Frameworks Suck Less—IPC

graph of 40%

60%

40%

use PHP don’t use PHP

Page 30: Making Frameworks Suck Less—IPC

PHPgraph of rock and hard place

Page 31: Making Frameworks Suck Less—IPC

Bind lightly

Loose couplingLoosly coupling graph with various services

mention cometmention map-reducemntion searchmention social-graph

Page 32: Making Frameworks Suck Less—IPC

Play nice

Story of memcache

Java patterns

Java and Javascript language constructs

Even with Ruby (deployment)

Page 33: Making Frameworks Suck Less—IPC

Especially with Ruby

php strengths from shared -nothing

ruby strengths from multi-threading

cloud computing (vs. PHP hosted)

GitHub, CruiseControl, etc.

Page 34: Making Frameworks Suck Less—IPC

Roadmap Conclusion

Page 35: Making Frameworks Suck Less—IPC

Conclusion

Not “F— You!”

“Blog This!”

Appreciate Feedback…

[email protected]

http://terrychay.com/blog/

Image of me