1 / 36

PHP Framework “Battle”

PHP Framework “Battle”. Zakir Hemraj. Slides and code will be posted on the meetup group Video will be posted on: achievers.com/tech Tell your friends!. About Me. Dev Team Lead @ Achievers Professional Web Framework Experience: J2EE with Spring, Hibernate PHP with CodeIgniter

gzifa
Download Presentation

PHP Framework “Battle”

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. PHP Framework “Battle” Zakir Hemraj

  2. Slides and code will be posted on the meetup group • Video will be posted on: achievers.com/tech • Tell your friends!

  3. About Me • Dev Team Lead @ Achievers • Professional Web Framework Experience: • J2EE with Spring, Hibernate • PHP with CodeIgniter • Ruby on Rails • Not an expert in Zend Framework, CakePHP or Symfony

  4. Goal • Give you “flavor” of a few frameworks • Share some scientific and subjective comparisons • Make you better equipped to compare and choose the right framework

  5. What I’m not doing… • In-depth framework code walkthrough of all features and functions • Handing you a silver bullet

  6. Agenda • Overview of frameworks • Review basic concepts • MVC, ORMs • The application • requirements, db schema • Code walkthrough • Performance and other comparisons • Final thoughts

  7. The Contenders

  8. Big Sites Sources: http://book.cakephp.org/1.2/view/510/Sites-in-the-wild http://framework.zend.com/wiki/pages/viewpage.action?pageId=14134 http://trac.symfony-project.org/wiki/ApplicationsDevelopedWithSymfony

  9. “You can write shitty code in any language, any framework”

  10. Review - MVC Business Logic & DB Access • Most web frameworks are MVC these days • Lots of inconsistencies with the “model” layer HTTP Request HTML Source: http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller

  11. Review - ORM • Object Relational Mapping • Maps database records to objects • 1-to-1 table to object class • E.g. job table -> job class • Layer of abstraction to: • Make code more maintainable • Enable stronger OO programming class TechTalk{ } ORM table: tech_talk

  12. Now What?

  13. The Application • A basic job board where people can: • Add jobs • View a listing of jobs • Look at a post in more detail • So simple, you could probably code it in your sleep

  14. The Schema

  15. Setup Download framework * Configure your app with your db Point your web server to the directory (i.e. vhost in apache) Start coding

  16. Zend Code Summary • Nice command line tools -> less typing • Hard object instantiations play nice with IDE • Good, OO separation of layers, including db access, business logic, and forms • Cons: We’ll discuss later ;)

  17. CI Code Summary • Super lightweight • Very few conventions or “magic” • Doesn’t force things on you • Very explicit • Lots of well documented tools and libraries

  18. CAKE Summary • Rails-like convention over configuration • Very powerful, with convenient tools like scaffolding and strong relational mapping • Lots of “magic” that you need to be aware of

  19. CONFIGURATION CI Zend CAKE CONVENTION

  20. Documentation • Zend: • Complete, but fragmented • hard to follow. • CI • Great • CAKE • Outstanding

  21. Other Comparisons

  22. Performance • Source: http://www.ruilog.com/blog/view/b6f0e42cf705.html • Simple MVC logic, no DB connection • See site for full hardware specs

  23. Requests per Second

  24. Memory Usage (KB)

  25. System Load Average in 1 Minute

  26. Avg. Response Time (Milliseconds)

  27. Number of Function Calls

  28. Number of Included Files

  29. AND LASTLY…

  30. My Two Cents • Too much abstraction is bad • Understand the tradeoffs • You will need to break out of the framework • Stay curious

  31. <? echo “END”; die();?>

More Related