SlideShare une entreprise Scribd logo
1  sur  36
Télécharger pour lire hors ligne
BlockBundle	
  
Sonata	
  Project	
  
 	
  	
  	
  	
  	
  	
  	
  SONATA-­‐PROJECT:	
  BlockBundle	
  
•  Thomas	
  Rabaix	
  
– Founder	
  and	
  Lead	
  dev	
  of	
  Sonata	
  Project	
  
– Work	
  @	
  Ekino	
  
•  Official	
  sponsor	
  of	
  Sonata	
  Project	
  
•  PHP	
  Experts	
  
•  Ekino[Drupal|Wordpress]Bundle,	
  EkinoNewRelicBundle	
  	
  
Web	
  Developer’s	
  Job	
  	
  
	
  
~	
  
	
  
Let’s	
  take	
  a	
  standard	
  product	
  page	
  
hRp://demo.sonata-­‐project.org/shop/product/travel-­‐paris-­‐
tour/1037	
  
	
  
~	
  
	
  
The	
  page	
  point	
  to	
  a	
  MVC	
  ac[on:	
  
ProductController::viewProduct	
  
Get	
  the	
  product	
  and	
  check	
  validity	
  
	
  
~	
  
	
  
How	
  can	
  we	
  reuse	
  shared	
  components	
  ?	
  
Twig’s	
  extensions:	
  include,	
  use,	
  block	
  	
  
or	
  Symfony2’s	
  extension:	
  render	
  
	
  
...	
  or	
  …	
  
	
  
 	
  	
  	
  	
  	
  	
  	
  SONATA-­‐PROJECT:	
  BlockBundle	
  
What	
  ?	
  
•  BlockBundle	
  
– It	
  is	
  used	
  to	
  manage	
  fragments	
  of	
  content,	
  so-­‐
called	
  blocks,	
  	
  
– and	
  can	
  be	
  incorporated	
  into	
  any	
  page	
  layout.	
  
– Think	
  of	
  “small	
  MVC	
  ac[on”	
  
 	
  	
  	
  	
  	
  	
  	
  SONATA-­‐PROJECT:	
  BlockBundle	
  
Why	
  ?	
  
•  Rendering	
  controller	
  is	
  not	
  always	
  perfect	
  
– Crea[ng	
  subrequest	
  can	
  be	
  heavy	
  
– Not	
  everything	
  fits	
  into	
  an	
  url	
  =>	
  controller	
  
– A	
  controller	
  cannot	
  define	
  or	
  validate	
  segngs	
  
– Cannot	
  handle	
  cache	
  backends	
  (it	
  is	
  not	
  always	
  
about	
  hRp:	
  redis,	
  memcached	
  or	
  mongodb)	
  
 	
  	
  	
  	
  	
  	
  	
  SONATA-­‐PROJECT:	
  BlockBundle	
  
How	
  ?	
  
THE	
  RSS	
  BLOCK	
  SERVICE	
  
Your	
  First	
  Block	
  Service	
  
 	
  	
  	
  	
  	
  	
  	
  SONATA-­‐PROJECT:	
  BlockBundle	
  
Let’s	
  create	
  your	
  first	
  block	
  service	
  
	
  
From	
  
h3p://sonata-­‐project.org/bundles/block/master/
doc/reference/your_first_block.html	
  
	
  
~	
  
	
  
A	
  RSS	
  Live	
  Feed	
  reader	
  
composer require sonata-project/block-bundle:~2.2!
A	
  block	
  service	
  is	
  just	
  a	
  service	
  which	
  implements	
  the	
  
BlockServiceInterface	
  interface.	
  	
  
	
  
There	
  is	
  only	
  one	
  instance	
  of	
  a	
  block	
  service,	
  however	
  there	
  are	
  many	
  
block	
  instances.	
  
1/5	
  
A	
  block	
  service	
  needs	
  segngs	
  to	
  work	
  properly	
  	
  
and	
  to	
  ensure	
  consistency,	
  	
  
	
  
The	
  service	
  should	
  define	
  a	
  setDefaultSettings	
  method	
  to	
  
configure	
  the	
  default	
  op[ons	
  (like	
  a	
  FormType)	
  
2/5	
  
This	
  method	
  must	
  return	
  a	
  Response	
  object,	
  	
  
	
  
this	
  object	
  is	
  used	
  to	
  render	
  the	
  block.	
  
3/5	
  
A	
  block	
  template	
  is	
  very	
  simple.	
  	
  
	
  
We	
  are	
  looping	
  on	
  feeds	
  or	
  if	
  not	
  defined,	
  a	
  error	
  message	
  is	
  displayed.	
  
4/5	
  
We	
  just	
  need	
  to	
  declare	
  the	
  BlockService	
  as	
  Service	
  
	
  with	
  the	
  tag	
  sonata.tag!
	
  
We	
  also	
  need	
  to	
  enable	
  the	
  block	
  
	
  in	
  the	
  sonata_blocks.blocks	
  sec[on.	
  
5/5	
  
CONCEPT	
  
behind	
  the	
  scenes	
  
•  BlockInterface!
–  Contains	
  the	
  block	
  informa[on	
  
–  Can	
  have	
  children	
  and	
  parent	
  
•  BlockContextInterface!
–  Contains	
  data	
  for	
  the	
  current	
  execu[on	
  
–  Can	
  be	
  altered	
  during	
  run[me	
  
•  BlockServiceInterface!
–  Manipulate	
  the	
  BlockInterface!
–  Render	
  a	
  BlockContextInterface!
•  BlockContextManagerInterface!
–  Create	
  a	
  valid	
  BlockContext	
  from	
  any	
  provided	
  data	
  
•  BlockLoaderInterface!
–  Call	
  by	
  the	
  BlockContextManager	
  to	
  get	
  a	
  BlockInterface!
•  BlockRendererInterface!
–  Render	
  the	
  BlockContext!
–  Generates	
  a	
  valid	
  Response!
 	
  	
  	
  	
  	
  	
  	
  SONATA-­‐PROJECT:	
  BlockBundle	
  
Rendering	
  Workflow	
  
CACHE	
  
Speed	
  up	
  the	
  code	
  
 	
  	
  	
  	
  	
  	
  	
  SONATA-­‐PROJECT:	
  BlockBundle	
  
composer require sonata-project/cache-bundle:~2.1!
Cache	
  Configura[on	
  
Ttl	
  default	
  is	
  84600	
  
extra_cache_keys	
  can	
  be	
  used	
  to	
  ovewrite	
  default	
  
values,	
  like	
  ones	
  aRached	
  at	
  run[me	
  
SYMFONY2	
  INTEGRATION	
  
Small	
  nice	
  things	
  
EXTERNAL	
  INTEGRATIONS	
  
We	
  are	
  not	
  alone	
  
Symfony	
  CMF	
  
Sylius	
  
Sonata	
  Page	
  Bundle	
  
PrestaCMS	
  
 	
  	
  	
  	
  	
  	
  	
  SONATA-­‐PROJECT:	
  BlockBundle	
  
Other	
  Features	
  
•  Block	
  events	
  
•  Javascript	
  and	
  Stylesheet	
  helpers	
  
•  Excep[on	
  strategy	
  
•  Rapid	
  Prototyping	
  
 	
  	
  	
  	
  	
  	
  	
  SONATA-­‐PROJECT:	
  BlockBundle	
  
References	
  
•  hRp://sonata-­‐project.org/bundles/block/
master/doc/index.html	
  
•  hRp://symfony.com/doc/current/cmf/
bundles/block/introduc[on.html	
  
QUESTIONS?	
  
What	
  the	
  SonataBlockBundle	
  does	
  ?	
  

Contenu connexe

Tendances

Extending Foreman the easy way with foreman_hooks
Extending Foreman the easy way with foreman_hooksExtending Foreman the easy way with foreman_hooks
Extending Foreman the easy way with foreman_hooksDominic Cleal
 
Web Assembly Big Picture
Web Assembly Big PictureWeb Assembly Big Picture
Web Assembly Big PictureYousif Shalaby
 
Performance tips for Symfony2 & PHP
Performance tips for Symfony2 & PHPPerformance tips for Symfony2 & PHP
Performance tips for Symfony2 & PHPMax Romanovsky
 
#2 Hanoi Magento Meetup - Part 2: Knockout JS
#2 Hanoi Magento Meetup - Part 2: Knockout JS#2 Hanoi Magento Meetup - Part 2: Knockout JS
#2 Hanoi Magento Meetup - Part 2: Knockout JSHanoi MagentoMeetup
 
Composer | PHP Dependency Manager
Composer | PHP Dependency ManagerComposer | PHP Dependency Manager
Composer | PHP Dependency ManagerUjjwal Ojha
 
Introduction to ASP.NET Core
Introduction to ASP.NET CoreIntroduction to ASP.NET Core
Introduction to ASP.NET CoreMiroslav Popovic
 
MyCPAN (Frozen Perl 2008 Lightning Talk)
MyCPAN (Frozen Perl 2008 Lightning Talk)MyCPAN (Frozen Perl 2008 Lightning Talk)
MyCPAN (Frozen Perl 2008 Lightning Talk)brian d foy
 
CBDW2014- Intro to CommandBox; The ColdFusion CLI, Package Manager, and REPL ...
CBDW2014- Intro to CommandBox; The ColdFusion CLI, Package Manager, and REPL ...CBDW2014- Intro to CommandBox; The ColdFusion CLI, Package Manager, and REPL ...
CBDW2014- Intro to CommandBox; The ColdFusion CLI, Package Manager, and REPL ...Ortus Solutions, Corp
 
Cowboy rabbit-websockets
Cowboy rabbit-websocketsCowboy rabbit-websockets
Cowboy rabbit-websocketsWade Mealing
 
MyCPAN ( LA.pm, September 2007 )
MyCPAN ( LA.pm, September 2007 )MyCPAN ( LA.pm, September 2007 )
MyCPAN ( LA.pm, September 2007 )brian d foy
 
Zendcon magento101
Zendcon magento101Zendcon magento101
Zendcon magento101Mathew Beane
 
BackPAN Archeology
BackPAN ArcheologyBackPAN Archeology
BackPAN Archeologybrian d foy
 
Bootify your spring application
Bootify your spring applicationBootify your spring application
Bootify your spring applicationJimmy Lu
 
OpenCms Days 2016: OpenCms at the swiss seismological service
OpenCms Days 2016: OpenCms at the swiss seismological serviceOpenCms Days 2016: OpenCms at the swiss seismological service
OpenCms Days 2016: OpenCms at the swiss seismological serviceAlkacon Software GmbH & Co. KG
 

Tendances (20)

Extending Foreman the easy way with foreman_hooks
Extending Foreman the easy way with foreman_hooksExtending Foreman the easy way with foreman_hooks
Extending Foreman the easy way with foreman_hooks
 
It gilde 20150209
It gilde 20150209It gilde 20150209
It gilde 20150209
 
OpenCms Days 2016: Keynote - Introducing OpenCms 10.5
OpenCms Days 2016:   Keynote - Introducing OpenCms 10.5OpenCms Days 2016:   Keynote - Introducing OpenCms 10.5
OpenCms Days 2016: Keynote - Introducing OpenCms 10.5
 
Web Assembly Big Picture
Web Assembly Big PictureWeb Assembly Big Picture
Web Assembly Big Picture
 
OpenCms Days 2013 - Site Management Tool
OpenCms Days 2013 - Site Management ToolOpenCms Days 2013 - Site Management Tool
OpenCms Days 2013 - Site Management Tool
 
Performance tips for Symfony2 & PHP
Performance tips for Symfony2 & PHPPerformance tips for Symfony2 & PHP
Performance tips for Symfony2 & PHP
 
Beyond Puppet
Beyond PuppetBeyond Puppet
Beyond Puppet
 
#2 Hanoi Magento Meetup - Part 2: Knockout JS
#2 Hanoi Magento Meetup - Part 2: Knockout JS#2 Hanoi Magento Meetup - Part 2: Knockout JS
#2 Hanoi Magento Meetup - Part 2: Knockout JS
 
Composer
ComposerComposer
Composer
 
Composer | PHP Dependency Manager
Composer | PHP Dependency ManagerComposer | PHP Dependency Manager
Composer | PHP Dependency Manager
 
Introduction to ASP.NET Core
Introduction to ASP.NET CoreIntroduction to ASP.NET Core
Introduction to ASP.NET Core
 
MyCPAN (Frozen Perl 2008 Lightning Talk)
MyCPAN (Frozen Perl 2008 Lightning Talk)MyCPAN (Frozen Perl 2008 Lightning Talk)
MyCPAN (Frozen Perl 2008 Lightning Talk)
 
CBDW2014- Intro to CommandBox; The ColdFusion CLI, Package Manager, and REPL ...
CBDW2014- Intro to CommandBox; The ColdFusion CLI, Package Manager, and REPL ...CBDW2014- Intro to CommandBox; The ColdFusion CLI, Package Manager, and REPL ...
CBDW2014- Intro to CommandBox; The ColdFusion CLI, Package Manager, and REPL ...
 
Cowboy rabbit-websockets
Cowboy rabbit-websocketsCowboy rabbit-websockets
Cowboy rabbit-websockets
 
MyCPAN ( LA.pm, September 2007 )
MyCPAN ( LA.pm, September 2007 )MyCPAN ( LA.pm, September 2007 )
MyCPAN ( LA.pm, September 2007 )
 
Websocket 101 in Python
Websocket 101 in PythonWebsocket 101 in Python
Websocket 101 in Python
 
Zendcon magento101
Zendcon magento101Zendcon magento101
Zendcon magento101
 
BackPAN Archeology
BackPAN ArcheologyBackPAN Archeology
BackPAN Archeology
 
Bootify your spring application
Bootify your spring applicationBootify your spring application
Bootify your spring application
 
OpenCms Days 2016: OpenCms at the swiss seismological service
OpenCms Days 2016: OpenCms at the swiss seismological serviceOpenCms Days 2016: OpenCms at the swiss seismological service
OpenCms Days 2016: OpenCms at the swiss seismological service
 

En vedette

Easy backends with Symfony2 and the Sonata Admin bundle
Easy backends with Symfony2 and the Sonata Admin bundleEasy backends with Symfony2 and the Sonata Admin bundle
Easy backends with Symfony2 and the Sonata Admin bundlephpassionate
 
How Kris Writes Symfony Apps
How Kris Writes Symfony AppsHow Kris Writes Symfony Apps
How Kris Writes Symfony AppsKris Wallsmith
 
Sonata allegro presentation
Sonata allegro presentationSonata allegro presentation
Sonata allegro presentationJeremy Chesman
 
Back-end with SonataAdminBundle (and Symfony2, of course...)
Back-end with SonataAdminBundle (and Symfony2, of course...)Back-end with SonataAdminBundle (and Symfony2, of course...)
Back-end with SonataAdminBundle (and Symfony2, of course...)Andrea Delfino
 
Sonata form
Sonata formSonata form
Sonata formRSNO
 
Symfony et Sonata Project chez Canal+
Symfony et Sonata Project chez Canal+ Symfony et Sonata Project chez Canal+
Symfony et Sonata Project chez Canal+ ekino
 
Sonata presentation to Advisors
Sonata presentation to Advisors Sonata presentation to Advisors
Sonata presentation to Advisors Sonata Software
 
Microsoft Dynamics 365 - The Mordern Retail Platform
Microsoft Dynamics 365 - The Mordern Retail PlatformMicrosoft Dynamics 365 - The Mordern Retail Platform
Microsoft Dynamics 365 - The Mordern Retail PlatformSonata Software
 
Evolution - Hacking Innovation Roofcamp Philippines
Evolution - Hacking Innovation Roofcamp PhilippinesEvolution - Hacking Innovation Roofcamp Philippines
Evolution - Hacking Innovation Roofcamp PhilippinesDerek Neighbors
 
Updating Your GivingFirst.org Profile
Updating  Your  GivingFirst.org  ProfileUpdating  Your  GivingFirst.org  Profile
Updating Your GivingFirst.org ProfileBryce Wilkinson
 
Presentando a Miles
Presentando a MilesPresentando a Miles
Presentando a Milessergiodelmo
 
Laura Leichum: "Lessons from Inside the Digital Silo," for the "E-book Nuts a...
Laura Leichum: "Lessons from Inside the Digital Silo," for the "E-book Nuts a...Laura Leichum: "Lessons from Inside the Digital Silo," for the "E-book Nuts a...
Laura Leichum: "Lessons from Inside the Digital Silo," for the "E-book Nuts a...Krista Coulson
 
TEMA 1 Resum per estudiar
TEMA 1 Resum per estudiarTEMA 1 Resum per estudiar
TEMA 1 Resum per estudiarpepquetco
 
Installing oracle database 11g on windows 7
Installing oracle database 11g on windows 7Installing oracle database 11g on windows 7
Installing oracle database 11g on windows 7Ravi Kumar Lanke
 
The power of mobile advertising on Facebook
The power of mobile advertising on FacebookThe power of mobile advertising on Facebook
The power of mobile advertising on Facebookhttpool russia
 
2012100608102620111014181047 kuliah2kpt6043
2012100608102620111014181047 kuliah2kpt60432012100608102620111014181047 kuliah2kpt6043
2012100608102620111014181047 kuliah2kpt6043Ena Ros
 
E business suite 12.1.1 installation on Linux
E business suite 12.1.1 installation on LinuxE business suite 12.1.1 installation on Linux
E business suite 12.1.1 installation on LinuxRavi Kumar Lanke
 

En vedette (20)

Easy backends with Symfony2 and the Sonata Admin bundle
Easy backends with Symfony2 and the Sonata Admin bundleEasy backends with Symfony2 and the Sonata Admin bundle
Easy backends with Symfony2 and the Sonata Admin bundle
 
How Kris Writes Symfony Apps
How Kris Writes Symfony AppsHow Kris Writes Symfony Apps
How Kris Writes Symfony Apps
 
Sonata allegro presentation
Sonata allegro presentationSonata allegro presentation
Sonata allegro presentation
 
Back-end with SonataAdminBundle (and Symfony2, of course...)
Back-end with SonataAdminBundle (and Symfony2, of course...)Back-end with SonataAdminBundle (and Symfony2, of course...)
Back-end with SonataAdminBundle (and Symfony2, of course...)
 
Sonata form
Sonata formSonata form
Sonata form
 
Symfony et Sonata Project chez Canal+
Symfony et Sonata Project chez Canal+ Symfony et Sonata Project chez Canal+
Symfony et Sonata Project chez Canal+
 
Sonata presentation to Advisors
Sonata presentation to Advisors Sonata presentation to Advisors
Sonata presentation to Advisors
 
Microsoft Dynamics 365 - The Mordern Retail Platform
Microsoft Dynamics 365 - The Mordern Retail PlatformMicrosoft Dynamics 365 - The Mordern Retail Platform
Microsoft Dynamics 365 - The Mordern Retail Platform
 
Evolution - Hacking Innovation Roofcamp Philippines
Evolution - Hacking Innovation Roofcamp PhilippinesEvolution - Hacking Innovation Roofcamp Philippines
Evolution - Hacking Innovation Roofcamp Philippines
 
Updating Your GivingFirst.org Profile
Updating  Your  GivingFirst.org  ProfileUpdating  Your  GivingFirst.org  Profile
Updating Your GivingFirst.org Profile
 
Presentando a Miles
Presentando a MilesPresentando a Miles
Presentando a Miles
 
Nhom 3
Nhom 3Nhom 3
Nhom 3
 
Laura Leichum: "Lessons from Inside the Digital Silo," for the "E-book Nuts a...
Laura Leichum: "Lessons from Inside the Digital Silo," for the "E-book Nuts a...Laura Leichum: "Lessons from Inside the Digital Silo," for the "E-book Nuts a...
Laura Leichum: "Lessons from Inside the Digital Silo," for the "E-book Nuts a...
 
Duurzaam Inkopen - Rijksgebouwendienst
Duurzaam Inkopen -  RijksgebouwendienstDuurzaam Inkopen -  Rijksgebouwendienst
Duurzaam Inkopen - Rijksgebouwendienst
 
TEMA 1 Resum per estudiar
TEMA 1 Resum per estudiarTEMA 1 Resum per estudiar
TEMA 1 Resum per estudiar
 
Installing oracle database 11g on windows 7
Installing oracle database 11g on windows 7Installing oracle database 11g on windows 7
Installing oracle database 11g on windows 7
 
The power of mobile advertising on Facebook
The power of mobile advertising on FacebookThe power of mobile advertising on Facebook
The power of mobile advertising on Facebook
 
2012100608102620111014181047 kuliah2kpt6043
2012100608102620111014181047 kuliah2kpt60432012100608102620111014181047 kuliah2kpt6043
2012100608102620111014181047 kuliah2kpt6043
 
ECO - design & ECO - Energy - label
ECO - design & ECO - Energy - labelECO - design & ECO - Energy - label
ECO - design & ECO - Energy - label
 
E business suite 12.1.1 installation on Linux
E business suite 12.1.1 installation on LinuxE business suite 12.1.1 installation on Linux
E business suite 12.1.1 installation on Linux
 

Similaire à Sonata BlockBundle Explained

substrate: A framework to efficiently build blockchains
substrate: A framework to efficiently build blockchainssubstrate: A framework to efficiently build blockchains
substrate: A framework to efficiently build blockchainsservicesNitor
 
Road to sbt 1.0: Paved with server (2015 Amsterdam)
Road to sbt 1.0: Paved with server (2015 Amsterdam)Road to sbt 1.0: Paved with server (2015 Amsterdam)
Road to sbt 1.0: Paved with server (2015 Amsterdam)Eugene Yokota
 
Manage your Windows Infrastructure with Puppet Bolt - August 26 - 2020
Manage your Windows Infrastructure with Puppet Bolt - August 26 - 2020Manage your Windows Infrastructure with Puppet Bolt - August 26 - 2020
Manage your Windows Infrastructure with Puppet Bolt - August 26 - 2020Puppet
 
MySQL Cluster Asynchronous replication (2014)
MySQL Cluster Asynchronous replication (2014) MySQL Cluster Asynchronous replication (2014)
MySQL Cluster Asynchronous replication (2014) Frazer Clement
 
The Basic Concept Of IOC
The Basic Concept Of IOCThe Basic Concept Of IOC
The Basic Concept Of IOCCarl Lu
 
J&Js adventures with agency best practice & the hybrid MVC framework - Umbrac...
J&Js adventures with agency best practice & the hybrid MVC framework - Umbrac...J&Js adventures with agency best practice & the hybrid MVC framework - Umbrac...
J&Js adventures with agency best practice & the hybrid MVC framework - Umbrac...Jeavon Leopold
 
Road to sbt 1.0 paved with server
Road to sbt 1.0   paved with serverRoad to sbt 1.0   paved with server
Road to sbt 1.0 paved with serverEugene Yokota
 
Introduction to Performance APIs
Introduction to Performance APIsIntroduction to Performance APIs
Introduction to Performance APIsShogo Sensui
 
Gutenberg (WidgiLabs Training Sessions)
Gutenberg  (WidgiLabs Training Sessions)Gutenberg  (WidgiLabs Training Sessions)
Gutenberg (WidgiLabs Training Sessions)Nuno Morgadinho
 
TYPO3 Transition Tool
TYPO3 Transition ToolTYPO3 Transition Tool
TYPO3 Transition Toolcrus0e
 
Connect 2014 - AD202 - Get the best out of bootstrap with bootstrap4 x-pages
Connect 2014 - AD202 -  Get the best out of bootstrap with bootstrap4 x-pagesConnect 2014 - AD202 -  Get the best out of bootstrap with bootstrap4 x-pages
Connect 2014 - AD202 - Get the best out of bootstrap with bootstrap4 x-pagesPhilippe Riand
 
SCM Puppet: from an intro to the scaling
SCM Puppet: from an intro to the scalingSCM Puppet: from an intro to the scaling
SCM Puppet: from an intro to the scalingStanislav Osipov
 
Web Components
Web ComponentsWeb Components
Web ComponentsFITC
 
Splunk Modular Inputs / JMS Messaging Module Input
Splunk Modular Inputs / JMS Messaging Module InputSplunk Modular Inputs / JMS Messaging Module Input
Splunk Modular Inputs / JMS Messaging Module InputDamien Dallimore
 
Get the best out of Bootstrap with Bootstrap4XPages (AD202)
Get the best out of Bootstrap with Bootstrap4XPages (AD202)Get the best out of Bootstrap with Bootstrap4XPages (AD202)
Get the best out of Bootstrap with Bootstrap4XPages (AD202)Mark Leusink
 
Survey of Container Build Tools
Survey of Container Build ToolsSurvey of Container Build Tools
Survey of Container Build ToolsMichael Ducy
 
Open Source LinkedIn Analytics Pipeline - BOSS 2016 (VLDB)
Open Source LinkedIn Analytics Pipeline - BOSS 2016 (VLDB)Open Source LinkedIn Analytics Pipeline - BOSS 2016 (VLDB)
Open Source LinkedIn Analytics Pipeline - BOSS 2016 (VLDB)Issac Buenrostro
 

Similaire à Sonata BlockBundle Explained (20)

substrate: A framework to efficiently build blockchains
substrate: A framework to efficiently build blockchainssubstrate: A framework to efficiently build blockchains
substrate: A framework to efficiently build blockchains
 
Road to sbt 1.0: Paved with server (2015 Amsterdam)
Road to sbt 1.0: Paved with server (2015 Amsterdam)Road to sbt 1.0: Paved with server (2015 Amsterdam)
Road to sbt 1.0: Paved with server (2015 Amsterdam)
 
Manage your Windows Infrastructure with Puppet Bolt - August 26 - 2020
Manage your Windows Infrastructure with Puppet Bolt - August 26 - 2020Manage your Windows Infrastructure with Puppet Bolt - August 26 - 2020
Manage your Windows Infrastructure with Puppet Bolt - August 26 - 2020
 
MySQL Cluster Asynchronous replication (2014)
MySQL Cluster Asynchronous replication (2014) MySQL Cluster Asynchronous replication (2014)
MySQL Cluster Asynchronous replication (2014)
 
The Basic Concept Of IOC
The Basic Concept Of IOCThe Basic Concept Of IOC
The Basic Concept Of IOC
 
J&Js adventures with agency best practice & the hybrid MVC framework - Umbrac...
J&Js adventures with agency best practice & the hybrid MVC framework - Umbrac...J&Js adventures with agency best practice & the hybrid MVC framework - Umbrac...
J&Js adventures with agency best practice & the hybrid MVC framework - Umbrac...
 
Road to sbt 1.0 paved with server
Road to sbt 1.0   paved with serverRoad to sbt 1.0   paved with server
Road to sbt 1.0 paved with server
 
gcdtmp
gcdtmpgcdtmp
gcdtmp
 
Introduction to Performance APIs
Introduction to Performance APIsIntroduction to Performance APIs
Introduction to Performance APIs
 
Gutenberg (WidgiLabs Training Sessions)
Gutenberg  (WidgiLabs Training Sessions)Gutenberg  (WidgiLabs Training Sessions)
Gutenberg (WidgiLabs Training Sessions)
 
Kubernetes 101
Kubernetes 101Kubernetes 101
Kubernetes 101
 
TYPO3 Transition Tool
TYPO3 Transition ToolTYPO3 Transition Tool
TYPO3 Transition Tool
 
Connect 2014 - AD202 - Get the best out of bootstrap with bootstrap4 x-pages
Connect 2014 - AD202 -  Get the best out of bootstrap with bootstrap4 x-pagesConnect 2014 - AD202 -  Get the best out of bootstrap with bootstrap4 x-pages
Connect 2014 - AD202 - Get the best out of bootstrap with bootstrap4 x-pages
 
SCM Puppet: from an intro to the scaling
SCM Puppet: from an intro to the scalingSCM Puppet: from an intro to the scaling
SCM Puppet: from an intro to the scaling
 
Web Components
Web ComponentsWeb Components
Web Components
 
Splunk Modular Inputs / JMS Messaging Module Input
Splunk Modular Inputs / JMS Messaging Module InputSplunk Modular Inputs / JMS Messaging Module Input
Splunk Modular Inputs / JMS Messaging Module Input
 
Get the best out of Bootstrap with Bootstrap4XPages (AD202)
Get the best out of Bootstrap with Bootstrap4XPages (AD202)Get the best out of Bootstrap with Bootstrap4XPages (AD202)
Get the best out of Bootstrap with Bootstrap4XPages (AD202)
 
Survey of Container Build Tools
Survey of Container Build ToolsSurvey of Container Build Tools
Survey of Container Build Tools
 
Stackato v4
Stackato v4Stackato v4
Stackato v4
 
Open Source LinkedIn Analytics Pipeline - BOSS 2016 (VLDB)
Open Source LinkedIn Analytics Pipeline - BOSS 2016 (VLDB)Open Source LinkedIn Analytics Pipeline - BOSS 2016 (VLDB)
Open Source LinkedIn Analytics Pipeline - BOSS 2016 (VLDB)
 

Dernier

Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Kaya Weers
 
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructureitnewsafrica
 
Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024TopCSSGallery
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesBernd Ruecker
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Nikki Chapple
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxfnnc6jmgwh
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...itnewsafrica
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 

Dernier (20)

Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)
 
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
 
Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architectures
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 

Sonata BlockBundle Explained

  • 2.                SONATA-­‐PROJECT:  BlockBundle   •  Thomas  Rabaix   – Founder  and  Lead  dev  of  Sonata  Project   – Work  @  Ekino   •  Official  sponsor  of  Sonata  Project   •  PHP  Experts   •  Ekino[Drupal|Wordpress]Bundle,  EkinoNewRelicBundle    
  • 3.
  • 4.
  • 5. Web  Developer’s  Job       ~     Let’s  take  a  standard  product  page   hRp://demo.sonata-­‐project.org/shop/product/travel-­‐paris-­‐ tour/1037     ~     The  page  point  to  a  MVC  ac[on:   ProductController::viewProduct   Get  the  product  and  check  validity     ~     How  can  we  reuse  shared  components  ?   Twig’s  extensions:  include,  use,  block     or  Symfony2’s  extension:  render     ...  or  …    
  • 6.
  • 7.                SONATA-­‐PROJECT:  BlockBundle   What  ?   •  BlockBundle   – It  is  used  to  manage  fragments  of  content,  so-­‐ called  blocks,     – and  can  be  incorporated  into  any  page  layout.   – Think  of  “small  MVC  ac[on”  
  • 8.                SONATA-­‐PROJECT:  BlockBundle   Why  ?   •  Rendering  controller  is  not  always  perfect   – Crea[ng  subrequest  can  be  heavy   – Not  everything  fits  into  an  url  =>  controller   – A  controller  cannot  define  or  validate  segngs   – Cannot  handle  cache  backends  (it  is  not  always   about  hRp:  redis,  memcached  or  mongodb)  
  • 9.                SONATA-­‐PROJECT:  BlockBundle   How  ?  
  • 10. THE  RSS  BLOCK  SERVICE   Your  First  Block  Service  
  • 11.                SONATA-­‐PROJECT:  BlockBundle   Let’s  create  your  first  block  service     From   h3p://sonata-­‐project.org/bundles/block/master/ doc/reference/your_first_block.html     ~     A  RSS  Live  Feed  reader  
  • 13. A  block  service  is  just  a  service  which  implements  the   BlockServiceInterface  interface.       There  is  only  one  instance  of  a  block  service,  however  there  are  many   block  instances.   1/5  
  • 14. A  block  service  needs  segngs  to  work  properly     and  to  ensure  consistency,       The  service  should  define  a  setDefaultSettings  method  to   configure  the  default  op[ons  (like  a  FormType)   2/5  
  • 15. This  method  must  return  a  Response  object,       this  object  is  used  to  render  the  block.   3/5  
  • 16. A  block  template  is  very  simple.       We  are  looping  on  feeds  or  if  not  defined,  a  error  message  is  displayed.   4/5  
  • 17. We  just  need  to  declare  the  BlockService  as  Service    with  the  tag  sonata.tag!   We  also  need  to  enable  the  block    in  the  sonata_blocks.blocks  sec[on.   5/5  
  • 18.
  • 19. CONCEPT   behind  the  scenes  
  • 20. •  BlockInterface! –  Contains  the  block  informa[on   –  Can  have  children  and  parent   •  BlockContextInterface! –  Contains  data  for  the  current  execu[on   –  Can  be  altered  during  run[me   •  BlockServiceInterface! –  Manipulate  the  BlockInterface! –  Render  a  BlockContextInterface! •  BlockContextManagerInterface! –  Create  a  valid  BlockContext  from  any  provided  data   •  BlockLoaderInterface! –  Call  by  the  BlockContextManager  to  get  a  BlockInterface! •  BlockRendererInterface! –  Render  the  BlockContext! –  Generates  a  valid  Response!
  • 21.                SONATA-­‐PROJECT:  BlockBundle   Rendering  Workflow  
  • 22. CACHE   Speed  up  the  code  
  • 23.                SONATA-­‐PROJECT:  BlockBundle   composer require sonata-project/cache-bundle:~2.1!
  • 25. Ttl  default  is  84600   extra_cache_keys  can  be  used  to  ovewrite  default   values,  like  ones  aRached  at  run[me  
  • 26. SYMFONY2  INTEGRATION   Small  nice  things  
  • 27.
  • 28.
  • 29. EXTERNAL  INTEGRATIONS   We  are  not  alone  
  • 34.                SONATA-­‐PROJECT:  BlockBundle   Other  Features   •  Block  events   •  Javascript  and  Stylesheet  helpers   •  Excep[on  strategy   •  Rapid  Prototyping  
  • 35.                SONATA-­‐PROJECT:  BlockBundle   References   •  hRp://sonata-­‐project.org/bundles/block/ master/doc/index.html   •  hRp://symfony.com/doc/current/cmf/ bundles/block/introduc[on.html  
  • 36. QUESTIONS?   What  the  SonataBlockBundle  does  ?