SlideShare une entreprise Scribd logo
1  sur  31
Climbing Kilimanjaro
eZ Publish 5: Introduction & Architecture
About the speakers


       André Rømcke, eZ Systems, @andrerom
       Petar Spanja, NetGen, @periklo




!   Presenter: André Rømcke   !   09/04/12    2
Agenda


 Wednesday
    eZ Publish 5: Introduction & Architecture
               −   Using eZ Publish 5: Public API
               −   Extending eZ Publish 5: SPI’s
               −   Hacking eZ Publish 5: Core
               −   Public API Code Workshop
    Extending eZ Publish 5: Deep dive into Datatypes
 Thursday
    Symfony
    eZ Publish 5 & Symfony
 Friday
    REST API
    Hackaton

!   Presenter: André Rømcke              !          09/04/12   3
Architecture of eZ Publish 5.x




Why a new architecture?




!   Presenter: André Rømcke   !   09/04/12   4
Why a new architecture?
Code speaks better then words?

                                     * NOTE: you have to provide the following attributes:
                                     * contentobject_id
                                     * contentobject_attribute_id
                                     *
                                     * @param array $row
                                     * @return object
                                     */
                                     static function create( $row = array() )
                                     {
                                        if ( !isset( $row['contentobject_id'] ) )
                                            eZDebug::writeError( 'Missing 'contentobject_id' parameter!', __METHOD__ );




!   Presenter: André Rømcke      !          09/04/12                                                                 5
Architecture of eZ Publish 5.x




Before we begin..




!   Presenter: André Rømcke   !   09/04/12   6
First: A warning!


eZ Publish 5.0 is still in heavy development
 until October, so:
       Concepts might still change somewhat
       Code examples will break
       Several unit tests are still failing, and lots are still skipped/
        incomplete
       Documentation is not by any means polished or complete yet


       Note: Come by eZ Conference, Köln in October for an updated and refined deep
        dive into 5.0



!   Presenter: André Rømcke       !        09/04/12                                    7
Second: A small 4.x -> 5.x glossary


           (Content) object                    Content


           (Content) class                     Content Type


           (Content) attribute                 Field


           (Content) class attribute           Field Definition


           Data type                           Field Type


           Node                                Location


           (Content) class group               Content Type Group

!   Presenter: André Rømcke            !   09/04/12                 8
Architecture of eZ Publish 5.x




From top to down




!   Presenter: André Rømcke   !   09/04/12   9
Architecture of eZ Publish 5.x: Bird-eye view




!   Presenter: André Rømcke   !   09/04/12      10
Architecture of eZ Publish 5.x: GIT organization


       eZ Publish 5.x meta repository:
          − https://github.com/ezsystems/ezpublish5

               − eZ Publish 5.x Core:
                              https://github.com/ezsystems/ezp-next

               − eZ Publish 4.x “LS” repository:
                              https://github.com/ezsystems/ezpublish




!   Presenter: André Rømcke                      !         09/04/12    11
Architecture of eZ Publish 5.x: ezsystems/ezpublish5


app
src
vendor
       composer
       doctrine
       ezsystems
          − ezpublish         <- This is “ezp-next“ at them moment
       symfony
       twig
       zetacomponents
web
!   Presenter: André Rømcke             !         09/04/12           12
Architecture of eZ Publish 5.x: ezsystems/ezp-next


doc
eZ
       Publish
          − API
          − Core
          − SPI

settings
vendor

!   Presenter: André Rømcke   !   09/04/12           13
Architecture of eZ Publish 5.x




Using eZ Publish 5




!   Presenter: André Rømcke   !   09/04/12   14
Using eZ Publish 5.x: Public API


Interfaces & abstracts
       Documents the API
       Makes it possible to “hide” Implementation




Tested with “integration tests”
       Code examples generated based on these
Long life cycle
       Conservative deprecation -> removal process


!   Presenter: André Rømcke   !    09/04/12           15
Using eZ Publish 5.x: Public API <Concepts>


Separation of concern
       Layered architecture
       Implies use of Dependency injection
Domain driven design
       API gives you a repository consistent of:
          − Domain Services, with:
               − Methods for all operations you can perform on a domain (Section, Location,
                 Content, Language, ... )
               − Loaded Domain objects are Value objects, hence immutable
               − Factory methods to create new create/ update “structs” for changing data




!   Presenter: André Rømcke            !        09/04/12                                      16
Using eZ Publish 5.x: Public API <Concepts>
 By code example #1


Instead of:

public function viewLocation( $locationId, $viewType )
{
  // Permission check (usually w/o limitations)
  if ( !$this->user->hasAccessTO( ... ) )
  { .... }

    // Fetch using hard coupling on the “Service” to get a node
    $location = eZContentObjectTreeNode::fetch( $locationId );

    // if $location is null handle error { ... }

    // Trigger workflow { ... }

    // Generate view and view cache { ... }
}



!   Presenter: André Rømcke                  !     09/04/12       17
Using eZ Publish 5.x: Public API <Concepts>
 By code example #2


It would become:

public function viewLocation( $locationId, $viewType )
{
  // Get location (checks permissions, service proxies can optionally handle cache/events/workflow)
  $location = $this->repository->getLocationService()->loadLocation( $locationId );

    // Execute View, which generates Response, which is cached by Symfony / Varnish
}




!   Presenter: André Rømcke          !          09/04/12                                         18
Architecture of eZ Publish 5.x




Extending eZ Publish 5




!   Presenter: André Rømcke   !   09/04/12   19
Extending eZ Publish 5.x: SPI’s
 Service Provider Interface



 Just like the API a bunch of   Interfaces & abstracts
       Documents the SPI’s
       A contract for how the handlers should be implemented

The “Handlers” of eZ Publish 5.x
         Persistence
         IO
         Limitations
         FieldTypes
         ...


!   Presenter: André Rømcke       !    09/04/12                 20
Architecture of eZ Publish 5.x




Hacking eZ Publish 5




!   Presenter: André Rømcke   !   09/04/12   21
Hacking eZ Publish 5: Core


“Kernel” implementation of API and SPI’s
To be considered private
       Classes should not be used directly from this namespace if
        outside
       Methods exposed here but not in API or SPI’s are by
        definition private
       Can be re-factored at any given time
Uses dependency injection so it is possible
 to inject alternative implementations of
 almost anything
!   Presenter: André Rømcke   !    09/04/12                          22
Hacking eZ Publish 5: Core Contains #1


FieldType (SPI)
IO (SPI)
       Legacy (4.x compatibility, uses eZClusterHandler)
       InMemory (unit testing)
Limitation (SPI)
MVC
       Legacy (Wrapper for 4.x kernel and functionality)
       Symfony (“5.x” kernel, extensions for Symfony Framework)




!   Presenter: André Rømcke   !    09/04/12                        23
Hacking eZ Publish 5: Core Contains #2


Persistence (SPI)
       Legacy (4.x compatibility, uses 4.x DB schema)
       InMemory (unit testing)
       Solr (future Search handler)
Repository (APIRepository)
REST
       Client
       Server
settings

!   Presenter: André Rømcke   !    09/04/12              24
Hacking eZ Publish 5: CorePersistenceLegacy


Uses Zeta Database Component
       In the future it could use Doctrine DBAL
Consists of 3 parts in all handlers
       The Domain specific handler
       Gateway which deals with the SQL
       Mapper which maps sql data to SPI value objects, & back




!   Presenter: André Rømcke   !     09/04/12                      25
Hacking eZ Publish 5: CoreMVC


“HMVC”
       Using Symfony’s http centric request & response framework
A Legacy implementation that wraps
 around 4.x
(More on this Thursday)




!   Presenter: André Rømcke   !   09/04/12                          26
Architecture of eZ Publish 5.x




Last words..




!   Presenter: André Rømcke   !   09/04/12   27
Missing features in 5.x stack in 5.0


Info collectors
Workflow
Notifications
GUI’s
       Admin & Front end editing (available via LS though)
Performance (as of 5.0-alpha1)
       Full potential not reached, but comparable to 4.x
Scalability (as of 5.0)
       New Persistence & IO handlers needed to reach full potential

!   Presenter: André Rømcke   !     09/04/12                       28
Use cases 5.0 can be used for


Possible with pure 5.x stack:
       Content repository via REST/Public API
       Websites w/o user generated content
With use of LegacyStack fallback:
         Websites with user generated content
         Info collector
         ...
         anything




!   Presenter: André Rømcke   !     09/04/12     29
Coding example

<?php
/**
 * Get a Container pre configured with settings (script should be executed from “ezp-next” root)
 * @var eZPublishAPIContainer $container This is all you need to get code completion
 */
$container = require('bootstrap.php');

// Get Repository & log in as admin (for permissions to create content)
$repository = $container->getRepository();
$repository->setCurrentUser( $repository->getUserService()->loadUser( 14 ) );

// Get Blog ContentType (aka content class)
$contentTypeService = $repo->getContentTypeService();
$blogContentType = $contentTypeService->loadContentTypeByIdentifier( "blog" );

// Create Content struct & Location (node) struct with parent id = 2
$contentService = $repository->getContentService();
$contentCreateStruct = $contentService->newContentCreateStruct( $blogContentType, "eng-GB" );
$contentCreateStruct->setField( "name", "Hello world" );
$locationCreateStruct = $repository->getLocationService()->newLocationCreateStruct( 2 );

// Create both structs in db with createContent()
$content = $contentService->createContent( $contentCreateStruct, array( $locationCreateStruct ) );




 !   Presenter: André Rømcke           !          09/04/12                                           30
Links for getting started on Coding


Some resources:
       http://confluence.ez.no/display/EZP
       https://github.com/ezsystems/ezp-next/wiki/codingstandards
Code examples
       By Petar: https://gist.github.com/pspanja
       By Gaetano: https://gist.github.com/gggeek
       Generated from all integration tests: http://t.co/mHTqC8bA
Follow up talk on FieldTypes:
       http://t.co/zSpdVwdH
Getting started on Symfony stack:
       See GETTING_STARTED in ezpublish5 repo & confluence
!   Presenter: André Rømcke   !    09/04/12                          31

Contenu connexe

Similaire à eZ publish 5[-alpha1] Introduction & Architecture

Learnings from Real eZ Publish 5 Projects
Learnings from Real eZ Publish 5 ProjectsLearnings from Real eZ Publish 5 Projects
Learnings from Real eZ Publish 5 ProjectsDonat Fritschy
 
Unleash your Symfony projects with eZ Platform
Unleash your Symfony projects with eZ PlatformUnleash your Symfony projects with eZ Platform
Unleash your Symfony projects with eZ PlatformSébastien Morel
 
eZ Publish 5, Re architecture, pitfalls and opportunities
eZ Publish 5, Re architecture, pitfalls and opportunitieseZ Publish 5, Re architecture, pitfalls and opportunities
eZ Publish 5, Re architecture, pitfalls and opportunitiesAndré Rømcke
 
Environment isolation with Docker (Alex Medvedev, Alpari)
Environment isolation with Docker (Alex Medvedev, Alpari)Environment isolation with Docker (Alex Medvedev, Alpari)
Environment isolation with Docker (Alex Medvedev, Alpari)Symfoniacs
 
PyCon UK - iCE: Interactive cloud experimentation
PyCon UK - iCE: Interactive cloud experimentationPyCon UK - iCE: Interactive cloud experimentation
PyCon UK - iCE: Interactive cloud experimentationGeorge Lestaris
 
Eclipse Overview
Eclipse Overview Eclipse Overview
Eclipse Overview Lars Vogel
 
Hithhiker guide to eclipse presentation frameworks galaxy
Hithhiker guide to eclipse presentation frameworks galaxyHithhiker guide to eclipse presentation frameworks galaxy
Hithhiker guide to eclipse presentation frameworks galaxyglefur
 
Migrating extensions to eZ Publish 5
Migrating extensions to eZ Publish 5Migrating extensions to eZ Publish 5
Migrating extensions to eZ Publish 5lserwatka
 
DEEP: a user success story
DEEP: a user success storyDEEP: a user success story
DEEP: a user success storyEOSC-hub project
 
Docker Multi-arch All The Things
Docker Multi-arch All The ThingsDocker Multi-arch All The Things
Docker Multi-arch All The ThingsDocker, Inc.
 
2015 11-04 HEADS at EclipseCon: Modelling Things for IoT
2015 11-04 HEADS at EclipseCon: Modelling Things for IoT2015 11-04 HEADS at EclipseCon: Modelling Things for IoT
2015 11-04 HEADS at EclipseCon: Modelling Things for IoTUdoHafermann
 
Multi Lingual Websites In Umbraco
Multi Lingual Websites In UmbracoMulti Lingual Websites In Umbraco
Multi Lingual Websites In UmbracoPaul Marden
 
Ruby on Rails (RoR) as a back-end processor for Apex
Ruby on Rails (RoR) as a back-end processor for Apex Ruby on Rails (RoR) as a back-end processor for Apex
Ruby on Rails (RoR) as a back-end processor for Apex Espen Brækken
 
Office OpenXML: a technical approach for OOo.
Office OpenXML: a technical approach for OOo.Office OpenXML: a technical approach for OOo.
Office OpenXML: a technical approach for OOo.Alexandro Colorado
 
iOS Swift application architecture
iOS Swift application architectureiOS Swift application architecture
iOS Swift application architectureRomain Rochegude
 
Extending DevOps to Big Data Applications with Kubernetes
Extending DevOps to Big Data Applications with KubernetesExtending DevOps to Big Data Applications with Kubernetes
Extending DevOps to Big Data Applications with KubernetesNicola Ferraro
 

Similaire à eZ publish 5[-alpha1] Introduction & Architecture (20)

eZ Publish 5 in depth inspection
eZ Publish 5 in depth inspectioneZ Publish 5 in depth inspection
eZ Publish 5 in depth inspection
 
Learnings from Real eZ Publish 5 Projects
Learnings from Real eZ Publish 5 ProjectsLearnings from Real eZ Publish 5 Projects
Learnings from Real eZ Publish 5 Projects
 
eZ Publish nextgen
eZ Publish nextgeneZ Publish nextgen
eZ Publish nextgen
 
Unleash your Symfony projects with eZ Platform
Unleash your Symfony projects with eZ PlatformUnleash your Symfony projects with eZ Platform
Unleash your Symfony projects with eZ Platform
 
eZ Publish 5, Re architecture, pitfalls and opportunities
eZ Publish 5, Re architecture, pitfalls and opportunitieseZ Publish 5, Re architecture, pitfalls and opportunities
eZ Publish 5, Re architecture, pitfalls and opportunities
 
Environment isolation with Docker (Alex Medvedev, Alpari)
Environment isolation with Docker (Alex Medvedev, Alpari)Environment isolation with Docker (Alex Medvedev, Alpari)
Environment isolation with Docker (Alex Medvedev, Alpari)
 
PyCon UK - iCE: Interactive cloud experimentation
PyCon UK - iCE: Interactive cloud experimentationPyCon UK - iCE: Interactive cloud experimentation
PyCon UK - iCE: Interactive cloud experimentation
 
Eclipse Overview
Eclipse Overview Eclipse Overview
Eclipse Overview
 
Discovering OpenBSD on AWS
Discovering OpenBSD on AWSDiscovering OpenBSD on AWS
Discovering OpenBSD on AWS
 
Hithhiker guide to eclipse presentation frameworks galaxy
Hithhiker guide to eclipse presentation frameworks galaxyHithhiker guide to eclipse presentation frameworks galaxy
Hithhiker guide to eclipse presentation frameworks galaxy
 
Terrific Composer Workshop
Terrific Composer WorkshopTerrific Composer Workshop
Terrific Composer Workshop
 
Migrating extensions to eZ Publish 5
Migrating extensions to eZ Publish 5Migrating extensions to eZ Publish 5
Migrating extensions to eZ Publish 5
 
DEEP: a user success story
DEEP: a user success storyDEEP: a user success story
DEEP: a user success story
 
Docker Multi-arch All The Things
Docker Multi-arch All The ThingsDocker Multi-arch All The Things
Docker Multi-arch All The Things
 
2015 11-04 HEADS at EclipseCon: Modelling Things for IoT
2015 11-04 HEADS at EclipseCon: Modelling Things for IoT2015 11-04 HEADS at EclipseCon: Modelling Things for IoT
2015 11-04 HEADS at EclipseCon: Modelling Things for IoT
 
Multi Lingual Websites In Umbraco
Multi Lingual Websites In UmbracoMulti Lingual Websites In Umbraco
Multi Lingual Websites In Umbraco
 
Ruby on Rails (RoR) as a back-end processor for Apex
Ruby on Rails (RoR) as a back-end processor for Apex Ruby on Rails (RoR) as a back-end processor for Apex
Ruby on Rails (RoR) as a back-end processor for Apex
 
Office OpenXML: a technical approach for OOo.
Office OpenXML: a technical approach for OOo.Office OpenXML: a technical approach for OOo.
Office OpenXML: a technical approach for OOo.
 
iOS Swift application architecture
iOS Swift application architectureiOS Swift application architecture
iOS Swift application architecture
 
Extending DevOps to Big Data Applications with Kubernetes
Extending DevOps to Big Data Applications with KubernetesExtending DevOps to Big Data Applications with Kubernetes
Extending DevOps to Big Data Applications with Kubernetes
 

Plus de André Rømcke

SymfonyCon 2019: Head first into Symfony Cache, Redis & Redis Cluster
SymfonyCon 2019:   Head first into Symfony Cache, Redis & Redis ClusterSymfonyCon 2019:   Head first into Symfony Cache, Redis & Redis Cluster
SymfonyCon 2019: Head first into Symfony Cache, Redis & Redis ClusterAndré Rømcke
 
SfDay 2019: Head first into Symfony Cache, Redis & Redis Cluster
SfDay 2019: Head first into Symfony Cache, Redis & Redis ClusterSfDay 2019: Head first into Symfony Cache, Redis & Redis Cluster
SfDay 2019: Head first into Symfony Cache, Redis & Redis ClusterAndré Rømcke
 
Symfony live London 2018 - Take your http caching to the next level with xke...
Symfony live London 2018 -  Take your http caching to the next level with xke...Symfony live London 2018 -  Take your http caching to the next level with xke...
Symfony live London 2018 - Take your http caching to the next level with xke...André Rømcke
 
PHP Benelux 2017 - Caching The Right Way
PHP Benelux 2017 -  Caching The Right WayPHP Benelux 2017 -  Caching The Right Way
PHP Benelux 2017 - Caching The Right WayAndré Rømcke
 
Look Towards 2.0 and Beyond - eZ Conference 2016
Look Towards 2.0 and Beyond -   eZ Conference 2016Look Towards 2.0 and Beyond -   eZ Conference 2016
Look Towards 2.0 and Beyond - eZ Conference 2016André Rømcke
 
Getting instantly up and running with Docker and Symfony
Getting instantly up and running with Docker and SymfonyGetting instantly up and running with Docker and Symfony
Getting instantly up and running with Docker and SymfonyAndré Rømcke
 
Dockerize your Symfony application - Symfony Live NYC 2014
Dockerize your Symfony application - Symfony Live NYC 2014Dockerize your Symfony application - Symfony Live NYC 2014
Dockerize your Symfony application - Symfony Live NYC 2014André Rømcke
 
PhpTour Lyon 2014 - Transparent caching & context aware http cache
PhpTour Lyon 2014 - Transparent caching & context aware http cachePhpTour Lyon 2014 - Transparent caching & context aware http cache
PhpTour Lyon 2014 - Transparent caching & context aware http cacheAndré Rømcke
 

Plus de André Rømcke (8)

SymfonyCon 2019: Head first into Symfony Cache, Redis & Redis Cluster
SymfonyCon 2019:   Head first into Symfony Cache, Redis & Redis ClusterSymfonyCon 2019:   Head first into Symfony Cache, Redis & Redis Cluster
SymfonyCon 2019: Head first into Symfony Cache, Redis & Redis Cluster
 
SfDay 2019: Head first into Symfony Cache, Redis & Redis Cluster
SfDay 2019: Head first into Symfony Cache, Redis & Redis ClusterSfDay 2019: Head first into Symfony Cache, Redis & Redis Cluster
SfDay 2019: Head first into Symfony Cache, Redis & Redis Cluster
 
Symfony live London 2018 - Take your http caching to the next level with xke...
Symfony live London 2018 -  Take your http caching to the next level with xke...Symfony live London 2018 -  Take your http caching to the next level with xke...
Symfony live London 2018 - Take your http caching to the next level with xke...
 
PHP Benelux 2017 - Caching The Right Way
PHP Benelux 2017 -  Caching The Right WayPHP Benelux 2017 -  Caching The Right Way
PHP Benelux 2017 - Caching The Right Way
 
Look Towards 2.0 and Beyond - eZ Conference 2016
Look Towards 2.0 and Beyond -   eZ Conference 2016Look Towards 2.0 and Beyond -   eZ Conference 2016
Look Towards 2.0 and Beyond - eZ Conference 2016
 
Getting instantly up and running with Docker and Symfony
Getting instantly up and running with Docker and SymfonyGetting instantly up and running with Docker and Symfony
Getting instantly up and running with Docker and Symfony
 
Dockerize your Symfony application - Symfony Live NYC 2014
Dockerize your Symfony application - Symfony Live NYC 2014Dockerize your Symfony application - Symfony Live NYC 2014
Dockerize your Symfony application - Symfony Live NYC 2014
 
PhpTour Lyon 2014 - Transparent caching & context aware http cache
PhpTour Lyon 2014 - Transparent caching & context aware http cachePhpTour Lyon 2014 - Transparent caching & context aware http cache
PhpTour Lyon 2014 - Transparent caching & context aware http cache
 

Dernier

Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Scott Andery
 
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
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
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
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
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
 
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
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesThousandEyes
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
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
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
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
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 

Dernier (20)

Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
 
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
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
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
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
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
 
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
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
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
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
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
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 

eZ publish 5[-alpha1] Introduction & Architecture

  • 1. Climbing Kilimanjaro eZ Publish 5: Introduction & Architecture
  • 2. About the speakers  André Rømcke, eZ Systems, @andrerom  Petar Spanja, NetGen, @periklo ! Presenter: André Rømcke ! 09/04/12 2
  • 3. Agenda  Wednesday  eZ Publish 5: Introduction & Architecture − Using eZ Publish 5: Public API − Extending eZ Publish 5: SPI’s − Hacking eZ Publish 5: Core − Public API Code Workshop  Extending eZ Publish 5: Deep dive into Datatypes  Thursday  Symfony  eZ Publish 5 & Symfony  Friday  REST API  Hackaton ! Presenter: André Rømcke ! 09/04/12 3
  • 4. Architecture of eZ Publish 5.x Why a new architecture? ! Presenter: André Rømcke ! 09/04/12 4
  • 5. Why a new architecture? Code speaks better then words? * NOTE: you have to provide the following attributes: * contentobject_id * contentobject_attribute_id * * @param array $row * @return object */ static function create( $row = array() ) { if ( !isset( $row['contentobject_id'] ) ) eZDebug::writeError( 'Missing 'contentobject_id' parameter!', __METHOD__ ); ! Presenter: André Rømcke ! 09/04/12 5
  • 6. Architecture of eZ Publish 5.x Before we begin.. ! Presenter: André Rømcke ! 09/04/12 6
  • 7. First: A warning! eZ Publish 5.0 is still in heavy development until October, so:  Concepts might still change somewhat  Code examples will break  Several unit tests are still failing, and lots are still skipped/ incomplete  Documentation is not by any means polished or complete yet  Note: Come by eZ Conference, Köln in October for an updated and refined deep dive into 5.0 ! Presenter: André Rømcke ! 09/04/12 7
  • 8. Second: A small 4.x -> 5.x glossary (Content) object Content (Content) class Content Type (Content) attribute Field (Content) class attribute Field Definition Data type Field Type Node Location (Content) class group Content Type Group ! Presenter: André Rømcke ! 09/04/12 8
  • 9. Architecture of eZ Publish 5.x From top to down ! Presenter: André Rømcke ! 09/04/12 9
  • 10. Architecture of eZ Publish 5.x: Bird-eye view ! Presenter: André Rømcke ! 09/04/12 10
  • 11. Architecture of eZ Publish 5.x: GIT organization  eZ Publish 5.x meta repository: − https://github.com/ezsystems/ezpublish5 − eZ Publish 5.x Core: https://github.com/ezsystems/ezp-next − eZ Publish 4.x “LS” repository: https://github.com/ezsystems/ezpublish ! Presenter: André Rømcke ! 09/04/12 11
  • 12. Architecture of eZ Publish 5.x: ezsystems/ezpublish5 app src vendor  composer  doctrine  ezsystems − ezpublish <- This is “ezp-next“ at them moment  symfony  twig  zetacomponents web ! Presenter: André Rømcke ! 09/04/12 12
  • 13. Architecture of eZ Publish 5.x: ezsystems/ezp-next doc eZ  Publish − API − Core − SPI settings vendor ! Presenter: André Rømcke ! 09/04/12 13
  • 14. Architecture of eZ Publish 5.x Using eZ Publish 5 ! Presenter: André Rømcke ! 09/04/12 14
  • 15. Using eZ Publish 5.x: Public API Interfaces & abstracts  Documents the API  Makes it possible to “hide” Implementation Tested with “integration tests”  Code examples generated based on these Long life cycle  Conservative deprecation -> removal process ! Presenter: André Rømcke ! 09/04/12 15
  • 16. Using eZ Publish 5.x: Public API <Concepts> Separation of concern  Layered architecture  Implies use of Dependency injection Domain driven design  API gives you a repository consistent of: − Domain Services, with: − Methods for all operations you can perform on a domain (Section, Location, Content, Language, ... ) − Loaded Domain objects are Value objects, hence immutable − Factory methods to create new create/ update “structs” for changing data ! Presenter: André Rømcke ! 09/04/12 16
  • 17. Using eZ Publish 5.x: Public API <Concepts>  By code example #1 Instead of: public function viewLocation( $locationId, $viewType ) { // Permission check (usually w/o limitations) if ( !$this->user->hasAccessTO( ... ) ) { .... } // Fetch using hard coupling on the “Service” to get a node $location = eZContentObjectTreeNode::fetch( $locationId ); // if $location is null handle error { ... } // Trigger workflow { ... } // Generate view and view cache { ... } } ! Presenter: André Rømcke ! 09/04/12 17
  • 18. Using eZ Publish 5.x: Public API <Concepts>  By code example #2 It would become: public function viewLocation( $locationId, $viewType ) { // Get location (checks permissions, service proxies can optionally handle cache/events/workflow) $location = $this->repository->getLocationService()->loadLocation( $locationId ); // Execute View, which generates Response, which is cached by Symfony / Varnish } ! Presenter: André Rømcke ! 09/04/12 18
  • 19. Architecture of eZ Publish 5.x Extending eZ Publish 5 ! Presenter: André Rømcke ! 09/04/12 19
  • 20. Extending eZ Publish 5.x: SPI’s  Service Provider Interface  Just like the API a bunch of Interfaces & abstracts  Documents the SPI’s  A contract for how the handlers should be implemented The “Handlers” of eZ Publish 5.x  Persistence  IO  Limitations  FieldTypes  ... ! Presenter: André Rømcke ! 09/04/12 20
  • 21. Architecture of eZ Publish 5.x Hacking eZ Publish 5 ! Presenter: André Rømcke ! 09/04/12 21
  • 22. Hacking eZ Publish 5: Core “Kernel” implementation of API and SPI’s To be considered private  Classes should not be used directly from this namespace if outside  Methods exposed here but not in API or SPI’s are by definition private  Can be re-factored at any given time Uses dependency injection so it is possible to inject alternative implementations of almost anything ! Presenter: André Rømcke ! 09/04/12 22
  • 23. Hacking eZ Publish 5: Core Contains #1 FieldType (SPI) IO (SPI)  Legacy (4.x compatibility, uses eZClusterHandler)  InMemory (unit testing) Limitation (SPI) MVC  Legacy (Wrapper for 4.x kernel and functionality)  Symfony (“5.x” kernel, extensions for Symfony Framework) ! Presenter: André Rømcke ! 09/04/12 23
  • 24. Hacking eZ Publish 5: Core Contains #2 Persistence (SPI)  Legacy (4.x compatibility, uses 4.x DB schema)  InMemory (unit testing)  Solr (future Search handler) Repository (APIRepository) REST  Client  Server settings ! Presenter: André Rømcke ! 09/04/12 24
  • 25. Hacking eZ Publish 5: CorePersistenceLegacy Uses Zeta Database Component  In the future it could use Doctrine DBAL Consists of 3 parts in all handlers  The Domain specific handler  Gateway which deals with the SQL  Mapper which maps sql data to SPI value objects, & back ! Presenter: André Rømcke ! 09/04/12 25
  • 26. Hacking eZ Publish 5: CoreMVC “HMVC”  Using Symfony’s http centric request & response framework A Legacy implementation that wraps around 4.x (More on this Thursday) ! Presenter: André Rømcke ! 09/04/12 26
  • 27. Architecture of eZ Publish 5.x Last words.. ! Presenter: André Rømcke ! 09/04/12 27
  • 28. Missing features in 5.x stack in 5.0 Info collectors Workflow Notifications GUI’s  Admin & Front end editing (available via LS though) Performance (as of 5.0-alpha1)  Full potential not reached, but comparable to 4.x Scalability (as of 5.0)  New Persistence & IO handlers needed to reach full potential ! Presenter: André Rømcke ! 09/04/12 28
  • 29. Use cases 5.0 can be used for Possible with pure 5.x stack:  Content repository via REST/Public API  Websites w/o user generated content With use of LegacyStack fallback:  Websites with user generated content  Info collector  ...  anything ! Presenter: André Rømcke ! 09/04/12 29
  • 30. Coding example <?php /** * Get a Container pre configured with settings (script should be executed from “ezp-next” root) * @var eZPublishAPIContainer $container This is all you need to get code completion */ $container = require('bootstrap.php'); // Get Repository & log in as admin (for permissions to create content) $repository = $container->getRepository(); $repository->setCurrentUser( $repository->getUserService()->loadUser( 14 ) ); // Get Blog ContentType (aka content class) $contentTypeService = $repo->getContentTypeService(); $blogContentType = $contentTypeService->loadContentTypeByIdentifier( "blog" ); // Create Content struct & Location (node) struct with parent id = 2 $contentService = $repository->getContentService(); $contentCreateStruct = $contentService->newContentCreateStruct( $blogContentType, "eng-GB" ); $contentCreateStruct->setField( "name", "Hello world" ); $locationCreateStruct = $repository->getLocationService()->newLocationCreateStruct( 2 ); // Create both structs in db with createContent() $content = $contentService->createContent( $contentCreateStruct, array( $locationCreateStruct ) ); ! Presenter: André Rømcke ! 09/04/12 30
  • 31. Links for getting started on Coding Some resources:  http://confluence.ez.no/display/EZP  https://github.com/ezsystems/ezp-next/wiki/codingstandards Code examples  By Petar: https://gist.github.com/pspanja  By Gaetano: https://gist.github.com/gggeek  Generated from all integration tests: http://t.co/mHTqC8bA Follow up talk on FieldTypes:  http://t.co/zSpdVwdH Getting started on Symfony stack:  See GETTING_STARTED in ezpublish5 repo & confluence ! Presenter: André Rømcke ! 09/04/12 31

Notes de l'éditeur

  1. \n
  2. \n
  3. This session is the first and will cover eZ Publish Architecture and Public API specifically.Presentation of the why&amp;#x2019;s and the how&amp;#x2019;s by Andr&amp;#xE9; first for about 60 minutes, then introduction and help on setting things up by Petar and in the end a code workshop.\n
  4. \n
  5. overdue: Also worth nothing that despite the PHP founder&amp;#x2019;s view that PHP is a view language, PHP ecosystem has catched up on 15 years of knowledge of how to build software. ref concepts introduced by Fowler and others are now getting a grip on how people develop in PHP. In other words PHP has become more mature, especially in regards to Enterprise development, which is an alias for &amp;#x201C;Proper product development&amp;#x201D; imo.\n* Reverse: See Google trends.\n** To be able to refactor a product you at least need to have 1 layer: an api, something you can have so many unit tests for that you can guarantee it still works after the change\n\n
  6. top: Errors don&amp;#x2019;t throw, they give errors often ignored which causes often big [performance|consistency] problems later for implementers, or in worst case the customer.\nleft: Business, persistence and db layer is one and the same causing lots of duplicated code and 0 possibility of NoSQL migration\nbottom: This is considered a &amp;#x201C;clean template&amp;#x201D; in eZ Publish terms, but templates have much more business logic then they should, this leads to issues long term, much more template code to maintain, is difficult to test and impossible to get html knowledgeable designers/hackers to help out on.\n\nAdditional:[Business/Market]\n- As eZ is and has for some year been focusing on the Enterprise market, re factor the product to better serve this market today and in the future\n- Use PHP 5 and 5.3 features from day one, also being able to removing features that can now be handled by PHP or other parts of the stack\n- Start to use industry patterns and technologies that have been getting foothold in PHP over the last 3+ years\n- Much higher focus on testing up front in form of Unit tests, integration tests and function testing, + layered architecture with separation of concern; reducing code duplication dramatically\n- Adoption of some PSR standards, use of composer, use of Symfony Framework\n\n
  7. It might look like a difficult climb, but in comparison 4.x would be mt. Everest, which has a much higher death rate each year &amp;#xF04A;\n
  8. \n
  9. Documentation is something that won&amp;#x2019;t receive full attention before October even as most engineers that will work on it is currently busy on implementation, it will be possible for community to help out on this and more by then.\nUser Domain and Location Domain might see some changes as we start to review api and make sure it can:\n 1. Work with NoSQL\n 2. Be possible to add identity map for Content\n 3. Make sure Permission works and can be used w/o circular reference issues between User and Content\n
  10. As one of the first things we defined slightly new names for existing concepts in eZ Publish to move closer to what end users, and what other systems out there where using\nMainly to make sure we can introduce less technical terms at high level as well as low level to make sure everyone eventually speaks the same simplified domain language\nAlso this was done to lower the barrier of entry for new users and developers\n
  11. \n
  12. orange+blue color signals re-implementation of existing logic from Legacy Stack, aka 4.x\n\n[High level]\nPublic API that is fully documented, and related to earlier remark on giving errors, gives you exceptions early if you do something wrong, handles permissions for you and deals with sql dialects deep down in the storage engine (PDO)\nGreen arrow shows the currently aimed migration / integrations between &amp;#x201C;legacy kernel&amp;#x201D; and new architecture.\n\nThe next slide will show where which git repositories contains these different parts of eZ Publish 5.x\n
  13. The meta is purely to pull in all dependencies to create a full eZ Publish 5 installation\nNext slide will drill down eZ Publish 5.x meta repository\n
  14. app is project config, cache and logs\n Currently contains eZ Publish 4.x, but this will handled by composer soon\nsrc is project code files\n Currently contains eZ Demo Design bundle, but this will be moved out\nvendor is a folder created by composer when executed as mentioned in Readme.md, will contain all project dependencies\nweb is folder for everything that should be reachable from the web, aka public folder\n\nNext slide will drill down into ezp-next repository\n
  15. settings is something you can create to override public API settings at the moment, this is done by creating file settings/override/service.ini\nvendor is a folder created by composer when executed as mentioned in Readme.md\nAPI is what you will use when coding against eZ Publish 5\nCore is internal implementation, and only interesting if you want to hack on the kernel and help out on development of it\nSPI are the interfaces you can use when you want to extend eZ Publish, the handlers to use 4.x terms\n\nNext slide will drill down into the [Public] API\n
  16. \n
  17. This is mostly what you need to learn for coding against eZ Publish 5\n
  18. \n
  19. Examples above does not even mention use of inline SQL which sometimes would be the case in eZ Publish 4.x &amp;#x201C;views&amp;#x201D; (aka &amp;#x201C;actions&amp;#x201D; in MVC applications)\n
  20. Permissions and input validation are handled by api (Services)\nObject cache aka identity map, and workflows is in the future handled by proxy services\nProxy Services are basically services that encapsulate API services and adds features transparently, think of them as thin layers doing a dedicated tasks\nVarnish/Symfony/.. reverse proxy takes care of view cache, so use of proper http headers for caching is what is needed\n
  21. \n
  22. See Edi&amp;#x2019;s Presentation and code workshop for a deep dive into how to deal with SPI&amp;#x2019;s, specifically FieldTypes, aka Datatypes.\n
  23. \n
  24. For API/SPI&amp;#x2019;s it is the interfaces &amp; abstracts combined with Integration tests that provide the &amp;#x201C;contract&amp;#x201D; for how eZ Publish 5 will behave, despite how the implementation is done.\n
  25. All SPI&amp;#x2019;s are plural, there can be many implementations, for instance there is currently 22 FieldType implementations, xmltext, author, int, float, ...\n
  26. - The settings are stock settings for the Core implantation, can be overridden as defined in config.php.\n- Repository is THE API for 5.0, but in the future there might be others as well.\n- All API and SPI implementations should contain own tests, ultimately these should be mock based tests testing the implementations only, currently some of them are more or less integrations tests (loads whole stack and executes tests agains methods on API / SPI implementations)\n
  27. - Doctrine DBAL which is a successor to Zeta DB\n- Handlers refer to the SPI\\Persistence equivalent of Repository Services, they are Domain specific, examples: Content handler, Section handler, Search Handler\n- The reason for having a separation here was to be able to inject optimized Gateways for specific Databases in the future\n
  28. \n
  29. \n
  30. Info collectors will most likely be solved in a completely different way in the future\nWorkflows and Notifications will most likely be part of 5.1 and will depend on events / signals triggered by Kernel, or be done as Proxy Services\nGUI: 5.1 will receive first version of new editorial interface, this will open the possibility of creating a simplified admin GUI on 5.x stack in the future\nPerformance: Is already better in the case of view cache, but Public API needs further tuning in form of identity map and reduce number of backend calls pr API call before it can really shine compared to 4.x\n
  31. So despite missing feature in 5.x stack, thanks to 4.x being bundled, all of the features are accessible using misc methods of Legacy fallback( to be covered during eZ Conference in K&amp;#xF6;ln)\n
  32. \n
  33. \n