Suche senden
Hochladen
Application Layer in PHP
•
2 gefällt mir
•
3,375 views
Per Bernhardt
Folgen
Vortrag über eine beispielhafte Implementierung eines Application Layers in PHP
Weniger lesen
Mehr lesen
Technologie
Melden
Teilen
Melden
Teilen
1 von 32
Jetzt herunterladen
Downloaden Sie, um offline zu lesen
Empfohlen
Microservice Teststrategie mit Symfony2
Microservice Teststrategie mit Symfony2
Per Bernhardt
What mom never told you about bundle configurations - Symfony Live Paris 2012
What mom never told you about bundle configurations - Symfony Live Paris 2012
D
Kubernetes: Wie Chefkoch.de mit Containern arbeitet
Kubernetes: Wie Chefkoch.de mit Containern arbeitet
Per Bernhardt
What happens in laravel 4 bootstraping
What happens in laravel 4 bootstraping
Jace Ju
Dance for the puppet master: G6 Tech Talk
Dance for the puppet master: G6 Tech Talk
Michael Peacock
Implementing Comet using PHP
Implementing Comet using PHP
King Foo
Intro to Silex
Intro to Silex
Joey Rivera
はじめてのSymfony2
はじめてのSymfony2
Tomohiro MITSUMUNE
Empfohlen
Microservice Teststrategie mit Symfony2
Microservice Teststrategie mit Symfony2
Per Bernhardt
What mom never told you about bundle configurations - Symfony Live Paris 2012
What mom never told you about bundle configurations - Symfony Live Paris 2012
D
Kubernetes: Wie Chefkoch.de mit Containern arbeitet
Kubernetes: Wie Chefkoch.de mit Containern arbeitet
Per Bernhardt
What happens in laravel 4 bootstraping
What happens in laravel 4 bootstraping
Jace Ju
Dance for the puppet master: G6 Tech Talk
Dance for the puppet master: G6 Tech Talk
Michael Peacock
Implementing Comet using PHP
Implementing Comet using PHP
King Foo
Intro to Silex
Intro to Silex
Joey Rivera
はじめてのSymfony2
はじめてのSymfony2
Tomohiro MITSUMUNE
AnyMQ, Hippie, and the real-time web
AnyMQ, Hippie, and the real-time web
clkao
Cool like a Frontend Developer: Grunt, RequireJS, Bower and other Tools
Cool like a Frontend Developer: Grunt, RequireJS, Bower and other Tools
Ryan Weaver
Selenium sandwich-3: Being where you aren't.
Selenium sandwich-3: Being where you aren't.
Workhorse Computing
Node.js Express
Node.js Express
Eyal Vardi
AnsibleFest 2014 - Role Tips and Tricks
AnsibleFest 2014 - Role Tips and Tricks
jimi-c
Building Web Apps with Express
Building Web Apps with Express
Aaron Stannard
Tatsumaki
Tatsumaki
Tatsuhiko Miyagawa
Speed up web APIs with Expressive and Swoole (PHP Day 2018)
Speed up web APIs with Expressive and Swoole (PHP Day 2018)
Zend by Rogue Wave Software
A reviravolta do desenvolvimento web
A reviravolta do desenvolvimento web
Wallace Reis
Composer
Composer
Tom Corrigan
Nodejs first class
Nodejs first class
Fin Chen
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Tatsuhiko Miyagawa
V2 and beyond
V2 and beyond
jimi-c
Plack - LPW 2009
Plack - LPW 2009
Tatsuhiko Miyagawa
Using Sinatra to Build REST APIs in Ruby
Using Sinatra to Build REST APIs in Ruby
LaunchAny
Building Cloud Castles
Building Cloud Castles
Ben Scofield
Wykorzystanie form request przy implementacji API w Laravelu
Wykorzystanie form request przy implementacji API w Laravelu
Laravel Poland MeetUp
Phinx talk
Phinx talk
Michael Peacock
Zend Framework Study@Tokyo #2
Zend Framework Study@Tokyo #2
Shinya Ohyanagi
Puppet and the HashiStack
Puppet and the HashiStack
Bram Vogelaar
CQRS
CQRS
Piotr Pelczar
Domain Driven Design
Domain Driven Design
Ürgo Ringo
Weitere ähnliche Inhalte
Was ist angesagt?
AnyMQ, Hippie, and the real-time web
AnyMQ, Hippie, and the real-time web
clkao
Cool like a Frontend Developer: Grunt, RequireJS, Bower and other Tools
Cool like a Frontend Developer: Grunt, RequireJS, Bower and other Tools
Ryan Weaver
Selenium sandwich-3: Being where you aren't.
Selenium sandwich-3: Being where you aren't.
Workhorse Computing
Node.js Express
Node.js Express
Eyal Vardi
AnsibleFest 2014 - Role Tips and Tricks
AnsibleFest 2014 - Role Tips and Tricks
jimi-c
Building Web Apps with Express
Building Web Apps with Express
Aaron Stannard
Tatsumaki
Tatsumaki
Tatsuhiko Miyagawa
Speed up web APIs with Expressive and Swoole (PHP Day 2018)
Speed up web APIs with Expressive and Swoole (PHP Day 2018)
Zend by Rogue Wave Software
A reviravolta do desenvolvimento web
A reviravolta do desenvolvimento web
Wallace Reis
Composer
Composer
Tom Corrigan
Nodejs first class
Nodejs first class
Fin Chen
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Tatsuhiko Miyagawa
V2 and beyond
V2 and beyond
jimi-c
Plack - LPW 2009
Plack - LPW 2009
Tatsuhiko Miyagawa
Using Sinatra to Build REST APIs in Ruby
Using Sinatra to Build REST APIs in Ruby
LaunchAny
Building Cloud Castles
Building Cloud Castles
Ben Scofield
Wykorzystanie form request przy implementacji API w Laravelu
Wykorzystanie form request przy implementacji API w Laravelu
Laravel Poland MeetUp
Phinx talk
Phinx talk
Michael Peacock
Zend Framework Study@Tokyo #2
Zend Framework Study@Tokyo #2
Shinya Ohyanagi
Puppet and the HashiStack
Puppet and the HashiStack
Bram Vogelaar
Was ist angesagt?
(20)
AnyMQ, Hippie, and the real-time web
AnyMQ, Hippie, and the real-time web
Cool like a Frontend Developer: Grunt, RequireJS, Bower and other Tools
Cool like a Frontend Developer: Grunt, RequireJS, Bower and other Tools
Selenium sandwich-3: Being where you aren't.
Selenium sandwich-3: Being where you aren't.
Node.js Express
Node.js Express
AnsibleFest 2014 - Role Tips and Tricks
AnsibleFest 2014 - Role Tips and Tricks
Building Web Apps with Express
Building Web Apps with Express
Tatsumaki
Tatsumaki
Speed up web APIs with Expressive and Swoole (PHP Day 2018)
Speed up web APIs with Expressive and Swoole (PHP Day 2018)
A reviravolta do desenvolvimento web
A reviravolta do desenvolvimento web
Composer
Composer
Nodejs first class
Nodejs first class
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
V2 and beyond
V2 and beyond
Plack - LPW 2009
Plack - LPW 2009
Using Sinatra to Build REST APIs in Ruby
Using Sinatra to Build REST APIs in Ruby
Building Cloud Castles
Building Cloud Castles
Wykorzystanie form request przy implementacji API w Laravelu
Wykorzystanie form request przy implementacji API w Laravelu
Phinx talk
Phinx talk
Zend Framework Study@Tokyo #2
Zend Framework Study@Tokyo #2
Puppet and the HashiStack
Puppet and the HashiStack
Andere mochten auch
CQRS
CQRS
Piotr Pelczar
Domain Driven Design
Domain Driven Design
Ürgo Ringo
Domain Driven Design Demonstrated
Domain Driven Design Demonstrated
Alan Christensen
Application Architecture by Lars-Erik Kindblad, Capgemini
Application Architecture by Lars-Erik Kindblad, Capgemini
Lars-Erik Kindblad
The Fluent Interface Pattern
The Fluent Interface Pattern
Lars-Erik Kindblad
Application Architecture April 2014
Application Architecture April 2014
Lars-Erik Kindblad
Middleware PHP - A simple micro-framework
Middleware PHP - A simple micro-framework
Corley S.r.l.
Rich Model And Layered Architecture in SF2 Application
Rich Model And Layered Architecture in SF2 Application
Kirill Chebunin
Hexagonal architecture - message-oriented software design (PHP Benelux 2016)
Hexagonal architecture - message-oriented software design (PHP Benelux 2016)
Matthias Noback
Models and Service Layers, Hemoglobin and Hobgoblins
Models and Service Layers, Hemoglobin and Hobgoblins
Ross Tuck
CQRS на практике. В поиске точки масштабирования и новых метафор
CQRS на практике. В поиске точки масштабирования и новых метафор
Alexander Byndyu
Lecture application layer
Lecture application layer
Hasam Panezai
Implementing DDD Concepts in PHP
Implementing DDD Concepts in PHP
Steve Rhoades
Clean architecture with ddd layering in php
Clean architecture with ddd layering in php
Leonardo Proietti
Network Layer,Computer Networks
Network Layer,Computer Networks
guesta81d4b
Andere mochten auch
(15)
CQRS
CQRS
Domain Driven Design
Domain Driven Design
Domain Driven Design Demonstrated
Domain Driven Design Demonstrated
Application Architecture by Lars-Erik Kindblad, Capgemini
Application Architecture by Lars-Erik Kindblad, Capgemini
The Fluent Interface Pattern
The Fluent Interface Pattern
Application Architecture April 2014
Application Architecture April 2014
Middleware PHP - A simple micro-framework
Middleware PHP - A simple micro-framework
Rich Model And Layered Architecture in SF2 Application
Rich Model And Layered Architecture in SF2 Application
Hexagonal architecture - message-oriented software design (PHP Benelux 2016)
Hexagonal architecture - message-oriented software design (PHP Benelux 2016)
Models and Service Layers, Hemoglobin and Hobgoblins
Models and Service Layers, Hemoglobin and Hobgoblins
CQRS на практике. В поиске точки масштабирования и новых метафор
CQRS на практике. В поиске точки масштабирования и новых метафор
Lecture application layer
Lecture application layer
Implementing DDD Concepts in PHP
Implementing DDD Concepts in PHP
Clean architecture with ddd layering in php
Clean architecture with ddd layering in php
Network Layer,Computer Networks
Network Layer,Computer Networks
Ähnlich wie Application Layer in PHP
関西PHP勉強会 php5.4つまみぐい
関西PHP勉強会 php5.4つまみぐい
Hisateru Tanaka
What's New In Laravel 5
What's New In Laravel 5
Darren Craig
And the Greatest of These Is ... Rack Support
And the Greatest of These Is ... Rack Support
Ben Scofield
symfony on action - WebTech 207
symfony on action - WebTech 207
patter
Crafting Quality PHP Applications (Bucharest Tech Week 2017)
Crafting Quality PHP Applications (Bucharest Tech Week 2017)
James Titcumb
Phpne august-2012-symfony-components-friends
Phpne august-2012-symfony-components-friends
Michael Peacock
Spring Web Services: SOAP vs. REST
Spring Web Services: SOAP vs. REST
Sam Brannen
Building Lithium Apps
Building Lithium Apps
Nate Abele
Build powerfull and smart web applications with Symfony2
Build powerfull and smart web applications with Symfony2
Hugo Hamon
Event Sourcing with php
Event Sourcing with php
Sébastien Houzé
Crafting Quality PHP Applications (PHP Benelux 2018)
Crafting Quality PHP Applications (PHP Benelux 2018)
James Titcumb
Speed up your developments with Symfony2
Speed up your developments with Symfony2
Hugo Hamon
Unit testing after Zend Framework 1.8
Unit testing after Zend Framework 1.8
Michelangelo van Dam
Crafting Quality PHP Applications (ConFoo YVR 2017)
Crafting Quality PHP Applications (ConFoo YVR 2017)
James Titcumb
Primefaces Confess 2012
Primefaces Confess 2012
cagataycivici
Crafting Quality PHP Applications (PHPkonf 2018)
Crafting Quality PHP Applications (PHPkonf 2018)
James Titcumb
Kicking off with Zend Expressive and Doctrine ORM (PHP UK 2017)
Kicking off with Zend Expressive and Doctrine ORM (PHP UK 2017)
James Titcumb
实战Ecos
实战Ecos
wanglei999
Primefaces Nextgen Lju
Primefaces Nextgen Lju
Skills Matter
Primefaces Nextgen Lju
Primefaces Nextgen Lju
Skills Matter
Ähnlich wie Application Layer in PHP
(20)
関西PHP勉強会 php5.4つまみぐい
関西PHP勉強会 php5.4つまみぐい
What's New In Laravel 5
What's New In Laravel 5
And the Greatest of These Is ... Rack Support
And the Greatest of These Is ... Rack Support
symfony on action - WebTech 207
symfony on action - WebTech 207
Crafting Quality PHP Applications (Bucharest Tech Week 2017)
Crafting Quality PHP Applications (Bucharest Tech Week 2017)
Phpne august-2012-symfony-components-friends
Phpne august-2012-symfony-components-friends
Spring Web Services: SOAP vs. REST
Spring Web Services: SOAP vs. REST
Building Lithium Apps
Building Lithium Apps
Build powerfull and smart web applications with Symfony2
Build powerfull and smart web applications with Symfony2
Event Sourcing with php
Event Sourcing with php
Crafting Quality PHP Applications (PHP Benelux 2018)
Crafting Quality PHP Applications (PHP Benelux 2018)
Speed up your developments with Symfony2
Speed up your developments with Symfony2
Unit testing after Zend Framework 1.8
Unit testing after Zend Framework 1.8
Crafting Quality PHP Applications (ConFoo YVR 2017)
Crafting Quality PHP Applications (ConFoo YVR 2017)
Primefaces Confess 2012
Primefaces Confess 2012
Crafting Quality PHP Applications (PHPkonf 2018)
Crafting Quality PHP Applications (PHPkonf 2018)
Kicking off with Zend Expressive and Doctrine ORM (PHP UK 2017)
Kicking off with Zend Expressive and Doctrine ORM (PHP UK 2017)
实战Ecos
实战Ecos
Primefaces Nextgen Lju
Primefaces Nextgen Lju
Primefaces Nextgen Lju
Primefaces Nextgen Lju
Mehr von Per Bernhardt
Die Rolle des CTO
Die Rolle des CTO
Per Bernhardt
Event Carried State Transfer @ LeanIX
Event Carried State Transfer @ LeanIX
Per Bernhardt
Communication in a Microservice Architecture (Ljubljana Backend Meetup 2021)
Communication in a Microservice Architecture (Ljubljana Backend Meetup 2021)
Per Bernhardt
Microservice Test Strategy (@Bonn Code Meetup)
Microservice Test Strategy (@Bonn Code Meetup)
Per Bernhardt
Communication in a Microservice Architecture
Communication in a Microservice Architecture
Per Bernhardt
Magazin-Relaunch bei Chefkoch
Magazin-Relaunch bei Chefkoch
Per Bernhardt
Contract Tests mit Pact
Contract Tests mit Pact
Per Bernhardt
Chefkoch goes Drupal8
Chefkoch goes Drupal8
Per Bernhardt
Umzug eines Hochlast-Dienstes
Umzug eines Hochlast-Dienstes
Per Bernhardt
kubernetes @ chefkoch.de - Kubernetes Meetup Cologne
kubernetes @ chefkoch.de - Kubernetes Meetup Cologne
Per Bernhardt
Continiuous Integration and Delivery with Bamboo
Continiuous Integration and Delivery with Bamboo
Per Bernhardt
Anwendungsintegration mit Edge Side Includes
Anwendungsintegration mit Edge Side Includes
Per Bernhardt
Mehr von Per Bernhardt
(12)
Die Rolle des CTO
Die Rolle des CTO
Event Carried State Transfer @ LeanIX
Event Carried State Transfer @ LeanIX
Communication in a Microservice Architecture (Ljubljana Backend Meetup 2021)
Communication in a Microservice Architecture (Ljubljana Backend Meetup 2021)
Microservice Test Strategy (@Bonn Code Meetup)
Microservice Test Strategy (@Bonn Code Meetup)
Communication in a Microservice Architecture
Communication in a Microservice Architecture
Magazin-Relaunch bei Chefkoch
Magazin-Relaunch bei Chefkoch
Contract Tests mit Pact
Contract Tests mit Pact
Chefkoch goes Drupal8
Chefkoch goes Drupal8
Umzug eines Hochlast-Dienstes
Umzug eines Hochlast-Dienstes
kubernetes @ chefkoch.de - Kubernetes Meetup Cologne
kubernetes @ chefkoch.de - Kubernetes Meetup Cologne
Continiuous Integration and Delivery with Bamboo
Continiuous Integration and Delivery with Bamboo
Anwendungsintegration mit Edge Side Includes
Anwendungsintegration mit Edge Side Includes
Kürzlich hochgeladen
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
soniya singh
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
HampshireHUG
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAG
Sujit Pal
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
Malak Abu Hammad
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
Anna Loughnan Colquhoun
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
Scott Keck-Warren
Slack Application Development 101 Slides
Slack Application Development 101 Slides
praypatel2
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Alan Dix
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
ThousandEyes
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
Delhi Call girls
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
2toLead Limited
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
hans926745
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
Maria Levchenko
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
The Digital Insurer
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
Safe Software
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Miguel Araújo
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Drew Madelung
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
Allon Mureinik
Kürzlich hochgeladen
(20)
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAG
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
Slack Application Development 101 Slides
Slack Application Development 101 Slides
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
Application Layer in PHP
1.
Application Layer ein Vortrag
von Per Bernhardt
2.
Agenda • Disclaimer /
Credits • Ein kleines bisschen Theorie • Ein echtes Beispiel: Chefkoch API
3.
4.
Credit goes to… •
http://martinfowler.com/ • http://domainlanguage.com/ • http://alistair.cockburn.us/ • http://www.whitewashing.de/ • und viele andere..
5.
Ein bisschen Theorie…
6.
Application Layer Presentation Layer Infrastructure
Layer Domain Layer
7.
Application Layer Presentation Layer Infrastructure
Layer Domain Layer - Controller - Template / HTML - Session / HTTP
8.
Application Layer Presentation Layer Infrastructure
Layer Domain Layer - Controller - Template / HTML - Session / HTTP - Fasade - Transaktionen - Sicherheit / Zugriffsschutz - Integration / Orchestrierung
9.
Application Layer Presentation Layer Infrastructure
Layer Domain Layer - Controller - Template / HTML - Session / HTTP - Fasade - Transaktionen - Sicherheit / Zugriffsschutz - Integration / Orchestrierung - Daten - Geschäftslogik
10.
Application Layer Presentation Layer Infrastructure
Layer Domain Layer - Controller - Template / HTML - Session / HTTP - Fasade - Transaktionen - Sicherheit / Zugriffsschutz - Integration / Orchestrierung - Daten - Geschäftslogik - Datenbank - Mailserver - Logger - …
11.
Application Layer Presentation Layer Infrastructure
Layer Domain Layer - Controller - Template / HTML - Session / HTTP - Fasade - Transaktionen - Sicherheit / Zugriffsschutz - Integration / Orchestrierung - Daten - Geschäftslogik - Datenbank - Mailserver - Logger - …
12.
Application Layer Presentation Layer Infrastructure
Layer Domain Layer - Controller - Template / HTML - Session / HTTP - Fasade - Transaktionen - Sicherheit / Zugriffsschutz - Integration / Orchestrierung - Daten - Geschäftslogik - Datenbank - Mailserver - Logger - …
13.
Chefkoch API
14.
15.
POST /cookbooks/{id}/categories
16.
<?php ! namespace ChefkochBundleApiBundleController; ! use SymfonyBundleFrameworkBundleControllerController; use
ChefkochDomainModelCookbookCookbookId use SensioBundleFrameworkExtraBundleConfigurationParamConverter; use ChefkochBundleApiBundleAnnotationApiSerialize; use ChefkochApplicationCookbookRequest; use ChefkochApplicationCookbookCommand; use PixelhouseApplicationEventDispatchingService; use PixelhouseApplicationResponse; ! class CookbookController extends Controller { ! ... ! /** * @ParamConverter("category", options={"deserialize"=true}) * @ApiSerialize * @return Response */ public function saveCategoryAction(CookbookId $cookbookId, RequestCategoryRequest $category) { return $this->getCookbookService()->execute( new CommandSaveCategoryCommand($cookbookId, $category) ); } ! ... ! /** * @return DispatchingService */ private function getCookbookService() { return $this->get('chefkoch_api.application.cookbook_service'); } }
17.
<?php ! namespace ChefkochApplicationCookbookCommand; ! use ChefkochApplicationCookbookRequestCategoryRequest; use
ChefkochApplicationCookbookSecurityCookbookWriteAccessRequired; use ChefkochDomainModelCookbookCookbookId; use PixelhouseApplicationCommand; ! class SaveCategoryCommand implements Command, CookbookWriteAccessRequired { ! /** @var CookbookId */ private $cookbookId; ! /** @var CategoryRequest */ private $categoryRequest; ! public function __construct(CookbookId $cookbookId, CategoryRequest $categoryRequest) { $this->cookbookId = $cookbookId; $this->categoryRequest = $categoryRequest; } ! public function getCookbookId() { return $this->cookbookId; } ! public function getCategoryRequest() { return $this->categoryRequest; } }
18.
<?php ! namespace PixelhouseApplicationEvent; ! use PixelhouseApplicationCommand; use
PixelhouseApplicationUseCase; use PixelhouseEventDispatcherEventDispatcher; ! class DispatchingService { ! /** @var EventDispatcher */ private $eventDispatcher; ! /** @var UseCase[] */ private $useCases = array(); ! public function __construct(EventDispatcher $eventDispatcher) { $this->eventDispatcher = $eventDispatcher; } ! public function registerCommand($commandClass, UseCase $useCase) { $this->useCases[$commandClass] = $useCase; } ! public function execute(Command $command) { ... } }
19.
<?php ! namespace PixelhouseApplicationEvent; ! class Events { const
PRE_COMMAND = 'application.pre_command'; const POST_COMMAND = 'application.post_command'; const EXCEPTION = 'application.exception'; }
20.
<?php ! namespace PixelhouseApplicationEvent; ! use PixelhouseApplicationCommand; ! class
DispatchingService { ! ... ! public function execute(Command $command) { try { $this->eventDispatcher->dispatch( Events::PRE_COMMAND, new CommandEvent($command) ); $response = $this->useCases[get_class($command)]->run($command); $this->eventDispatcher->dispatch( Events::POST_COMMAND, new PostCommandEvent($command, $response) ); ! return $response; } catch (Exception $exception) { $event = new CommandExceptionEvent($command, $exception); $this->eventDispatcher->dispatch( Events::EXCEPTION, $event ); if ($response = $event->getResponse()) { return $response; } else { throw $exception; } } } }
21.
<?php ! namespace ChefkochInfrastructureApplication; ! use PixelhouseApplicationEvent; use
PixelhouseEventDispatcherSubscriber; use DoctrineORMEntityManager; ! class DoctrineTransactionListener implements Subscriber { ! /** @var EntityManager */ private $entityManager; ! public function __construct(EntityManager $entityManager) { $this->entityManager = $entityManager; } ! public function preCommand(EventCommandEvent $event) { $this->entityManager->getConnection()->beginTransaction(); } ! public function postCommand(EventPostCommandEvent $event) { $this->entityManager->flush(); $this->entityManager->getConnection()->commit(); } ! public function onException(EventCommandExceptionEvent $event) { $this->entityManager->close(); if ($this->entityManager->getConnection()->isTransactionActive()) { $this->entityManager->getConnection()->rollBack(); } } }
22.
<?php ! namespace PixelhouseApplicationSecurity; ! use PixelhouseApplicationEvent; use
PixelhouseEventDispatcherSubscriber; ! class SecurityListener implements Subscriber { ! /** @var Context */ private $context; ! /** @var Policy[] */ private $policies = array(); ! public function __construct(Context $context) { $this->context = $context; } ! public function addPolicy(Policy $policy) { $this->policies[] = $policy; } ! /** * throws Exception */ public function preCommand(EventCommandEvent $event) { foreach ($this->policies as $policy) { $policy->check($this->securityContext, $event->getCommand()); } } }
23.
<?php ! namespace ChefkochApplicationCookbookSecurity; ! use ChefkochDomainModelCookbookCookbookRepository; use
ChefkochUserDomainModelUserRepository; use PixelhouseApplicationCommand; use PixelhouseApplicationSecurityAccessDeniedException; use PixelhouseApplicationSecurityContext; use PixelhouseApplicationSecurityPolicy; ! class CookbookAccessPolicy implements Policy { ! /** @var CookbookRepository */ private $cookbookRepository; ! /** @var UserRepository */ private $userRepository; ! public function __construct(CookbookRepository $cbRepo, UserRepository $uRepo) { $this->cookbookRepository = $cbRepo; $this->userRepository = $uRepo; } ! public function check(Context $context, Command $command) { if ($command instanceof CookbookWriteAccessRequired) { $cookbook = $this->cookbookRepository->findOneById($command->getCookbookId()); $user = $this->userRepository->findOneById($context->getUserId()); ! // Zugriff prüfen ... ! throw new AccessDeniedException(); } } }
24.
<?xml version="1.0" ?> <container xmlns="http://symfony.com/schema/dic/services" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://symfony.com/schema/dic/services
..."> <services> ... ! <service id="chefkoch_api.application.use_case.cookbook_save_category" class="ChefkochApplicationCookbookUseCaseSaveCategory"> <argument type="service" id="chefkoch_api.infrastructure.cookbook_category_repository" /> <argument type="service" id="chefkoch_api.infrastructure.user_repository" /> <argument type="service" id="chefkoch_api.application.security_context" /> <tag name="chefkoch_api.application.use_case" commandClass="ChefkochApplicationCookbookCommandSaveCategoryCommand" applicationService="chefkoch_api.application.cookbook_service" /> </service> ! ... </services> </container>
25.
<?php ! namespace ChefkochApplicationCookbookUseCase; ! use ChefkochApplicationCookbookCommandSaveCategoryCommand; use
PixelhouseApplicationSecurityContext; use PixelhouseApplicationUseCase; use ChefkochDomainModelCookbookCategoryRepository; use ChefkochUserDomainModelUserRepository; ! class SaveCategory implements UseCase { ! /** @var CategoryRepository */ private $categoryRepository; ! /** @var UserRepository */ private $userRepository; ! /** @var Context */ private $context; ! public function __construct(CategoryRepository $cRepo, UserRepository $uRepo, Context $context) { $this->categoryRepository = $cRepo; $this->userRepository = $uRepo; $this->context = $context; } ! public function run(SaveCategoryCommand $command) { ... } }
26.
<?php ! namespace ChefkochApplicationCookbookUseCase; ! use PixelhouseApplicationUseCase; use
ChefkochApplicationCookbookCommandSaveCategoryCommand; use ChefkochDomainModelCookbookCategory; use ChefkochApplicationCookbookNotificationCategorySavedSuccess; use ChefkochApplicationCookbookResponseCategoryResponse; use PixelhouseApplicationResponse; ! class SaveCategory implements UseCase { ... ! public function run(SaveCategoryCommand $command) { $user = $this->userRepository->findOneById($this->context->getUserId()); ! $category = new Category( $command->getCookbookId(), $user->getId(), $command->getCategoryRequest()->getName(), $command->getCategoryRequest()->getDescriptionText() ); ! $this->categoryRepository->add($category); ! $categoryResponse = new CategoryResponse($category, $user); ! $response = new Response(); $response->getNotification()->addMessage(new CategorySavedSuccess($categoryResponse)); ! return $response; } }
27.
HTTP/1.1 201 Created
28.
29.
30.
31.
Per Bernhardt info@perprogramming.de perprogramming.de slideshare.net/perprogramming
32.
Bilder • Warning: https://www.flickr.com/photos/gerardstolk/ 6538330609 •
Show Time: https://www.flickr.com/photos/ florida_photo_guy/5212663826 • Question Marks: https://www.flickr.com/photos/ loneblackrider/315302588 • Thank You: https://www.flickr.com/photos/wwworks/ 4759535950
Jetzt herunterladen