PHPucEU 2013 | Saturday, Session 01, Room 01

Topic: Split up your platform to components

Speaker(s)

Bastian Hofmann, https://github.com/bashofmann

Example based talk about how split up large sites to small components
and how this will help with development because of heavy code reuse.

Example based on ResearchGate.net

How are components build at researchgate
- php file (controller per components)
- (mustache) template
- renderd via v8js pecl extension on php side
- sometimes a javascript view
- binded just to the single component via uniqid per componentn
- sometimes component specific css
- most time it's side wide "global styling"

every component is renderable at front and backend

every component has a own endpoint

different rendering methods possible

- simple render everything on server and send it to the client
- lazy loading/reloading via ajax possible
- bigpipe of facebook
- render important/not backend heavy stuff first
- flush the generated html to client
- now do the heavy stuff and write it in a script tag to render at the frontend
- and flush again
- this ends up in the feeling of a faster page

components are self contained
- components have requirements
- because lots of components could have same requirements collecting them at firts
by a central component that injectes the requirements to the component
- the central requirement collector can batch datarequests
- multigets to memcache
- start lots of http requests in the background and do other stuff in the meantime till they are return data
- select * FROM table where id IN (list of ids)
VS.
lots of "select * FROM table where id = X"
- requiremtns of requirements will may be ugly
- generators in php 5.5 will be cool!?

components can be build up out of other components (more code reuse)

components help at A/B testing
- just replace one component with another
- use a componentn that loads different variants of it self

Link: http://phpuceu.wikidot.com/local--files/2013-sun-r3-session04/bild.jpg

Minutes

INSERT HERE

Media

INSERT HERE

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License