SlideShare a Scribd company logo
1
Privalia
9 MARZO 2017
2A LEADING GROUP AT YOUR SERVICE
LEADERS IN ALL MARKETS
POLAND
FRANCE, SPAIN, ITALY,
GERMANY, AUSTRIA, UK
SPAIN, ITALY, MEXICO,
BRAZIL
BENELUX
SWITZERLAND
DENMARK
Uncontestable flash sales
leader in Europe and
LATAM.
We are your partner to
deliver you a global
service tailored to each
market according to your
business needs.
VENTE-PRIVEE GROUP AMBITIONS
3A LEADING GROUP AT YOUR SERVICE
FACTS & FIGURES
#1 Flash Sales in EU and
Latam.
#2 e-commerce in EU
MAJOR PLAYER
Members
+ 60 M
Products sold / day
+320 K
In 2016*
2,1€ Bn
Unique sales visitors
12,1M
Of sales from mobile
65%
* Classic Sales (w/out taxes)
4A LEADING GROUP AT YOUR SERVICE
IT AREAS
# Systems # Production
# Cybersecurity # Network
# Application Maintenance
INFRASTRUCTURE
# SAP # WMS
# ETL # Data # Scrum
BACKOFFICE
CORE TEAM
QA & RELEASE BI & DATA PLATFORM AGILE OFFICE
# Mobile # Catalogue
# Customer # Payments &
Fraud # Billing & Interfaces
# Supply Chain # Marketplace
# VP Integration
# Architecture Solution
# QA # DevOps
5A LEADING GROUP AT YOUR SERVICE
IT TECHNOLOGIES
DATA CODE TOOLS PERFORMANCE
6A LEADING GROUP AT YOUR SERVICE
JOB OPPORTUNITIES
HIRING!
We are
01001010010011110100100101001110
# Tech Lead # PHP Developer # DevOps # Android Developer
# IOS Developer # Solutions Architect # Scrum Master # SAP FICO
# SAP LO # WMS JIT Developer # QA # JAVA Developer #Javascript
# CISO # ETL Developer # Systems Administrator
people@privalia.com
01001010010011110100100101001110
7
From Legacy to
DDD in PHP
Tech Talk | Privalia
9 MARZO 2017
8WHO I AM
Jordi Vila Gallardo
Senior Developer @Privalia
Twitter: @jordivilaga
9
1. Legacy
2. Introduction (DDD)
3. Strategic (DDD)
- Concepts
4. Tactical (DDD)
- Architecture
- Layers
- Objects
5. Advantages and disadvantages
6. Demo
SUMMARY
10
Legacy
1
111. Legacy
Computer program (typically a database system) which, although critical to an organization's operations, is
in an obsolete format or is installed on an obsolete system.
● Not testable.
● Hard to maintain.
● Reduces performance.
● Security and access control problems.
● Reduces productivity.
● Hard to scale.
● Reduces time to market.
12
Introduction
Domain-Driven Design
2
132. Introduction
● Is an approach to software development for complex needs.
● It was coined by Eric Evans in his book “Domain-Driven Design - Tackling Complexity in the Heart of
Software”.
SOME PREMISES
● Primary focus on the domain logic.
● Initiating continuous collaboration between technical and domain experts.
● Development based on business and not database oriented.
142. Introduction
STRATEGIC VS TACTICAL
STRATEGIC VS TACTICAL
Domain-Driven Design
15
STRATEGIC
Domain-Driven Design
3
163. Strategic
● Domain
● Subdomain
● Bounded Context
● Ubiquitous Language
CONCEPTS
173. Strategic
DOMAIN
Is the global problem space.
183. Strategic
SUBDOMAINS
Are a portion of the problem space concept.
193. Strategic
BOUNDED CONTEXT
Are a portion of the solution space concept. In other words, the subdomain is describing something
about the way you’ve chosen to break down your business and the bonded context describes how the
software has been broken down.
203. Strategic
DOMAIN EXPERT
A member of a software project whose field is the domain of the application, rather than software
development. Not just any user of the software, the domain expert has deep knowledge of the subject.
213. Strategic
UBIQUITOUS LANGUAGE
Ubiquitous language is the term Eric Evans in Domain-Driven Design for the practice of building up
common, rigorous language between developers and users. This language should be based on the
Domain Model used in the software.
223. Strategic
● Learning about our Domain by talking with a Domain Expert.
● Breaking the Domain into Subdomains.
● Focusing on one Subdomain with the Domain Expert.
○ Make a list of things we need to know about the Subdomain.
○ Modeling the Domain with the Domain Expert and working the terminology.
● First high-level Model of the Subdomain.
STEPS TO MODELING A PROBLEM IN SOFTWARE
23
TACTICAL
Domain-Driven Design
4
244. Tactical
● Hexagonal Architecture
● CQRS (Command-Query Responsibility Segregation)
● Event-Driven Architecture
● Service-Oriented
● Representational State Transfer (REST)
● Data Fabric and Grid-Based Distributed Computing
ARCHITECTURES
254. Tactical
HEXAGONAL ARCHITECTURE
264. Tactical
LAYERS
CONTROLLERS
COMMANDS
USE CASES
DTO’S
ENTITIES
VALUE
OBJECTS
LOGGING
EXCEPTIONS
DOMAIN
EVENTS
REPOSITORIES
274. Tactical
● Entities → Domain
● Value Objects → Domain
● Services → Domain, Infrastructure and Application
● Domain Events → Domain
● Aggregates → Domain
● Factories → Domain
● Repositories → Infrastructure
OBJECTS
284. Tactical
OBJECTS: ENTITIES
An object fundamentally defined by identity and not by its attributes.
CHARACTERISTICS
● Unique identity.
● Mutable.
● Comparison using identifier or reference equality.
● Can live by its own.
● Lifespan (It has history of what happened to it and how it changed during its lifetime).
294. Tactical
OBJECTS: ENTITIES - ANEMIC ENTITY ANTI-PATTERN
ANEMIC NON ANEMIC
304. Tactical
OBJECTS: ENTITIES - UBIQUITOUS LANGUAGE
UBIQUITOUS LANGUAGE
Modeling on terms coming out of our UBIQUITOUS LANGUAGE instead of a noun and verbs
object-oriented design.
Traditional object-oriented design: UBIQUITOUS LANGUAGE design:
314. Tactical
OBJECTS: VALUE OBJECTS
An object that contains attributes but has not conceptual identity.
CHARACTERISTICS
● Measures, quantifies, or describe a thing in the domain.
● Immutable
● Comparison using structural or reference equality.
● Can not live by its own, it should always belong to one or several entities.
● No lifespan.
324. Tactical
OBJECTS: VALUE OBJECTS - EXAMPLE
EXAMPLE: Example of Value Object.
334. Tactical
OBJECTS: VALUE OBJECTS - EXAMPLE IMMUTABILITY
EXAMPLE: Immutability
Money constructor Increase the amount
344. Tactical
OBJECTS: SERVICES
It’s a middleware between the outside world and the domain logic.
CHARACTERISTICS
● The operation relates to a domain concept that is not a natural part of an ENTITY or VALUE OBJECT.
● The operation name is part of the UBIQUITOUS LANGUAGE.
● The operation is stateless.
354. Tactical
OBJECTS: SERVICES
TYPES
● Application Services
○ Is how the outside world communicates with our application.
○ This could be through HTTP requests, an API or through an automated messaging service.
○ Business rules are not allowed.
○ Sometimes referred as “Workflow Services” or “Use Cases”.
● Domain Services
○ Encapsulates business logic that does not naturally fit within a domain objects.
○ Meaning and responsibilities should make sense to the STAKEHOLDERS or DOMAIN EXPERTS.
● Infrastructure Services
○ Is used for dealing with technical details of the infrastructure.
364. Tactical
OBJECTS: SERVICES
DOMAIN SERVICE
EXAMPLE: Hashing service.
● Is derived from the UBIQUITOUS LANGUAGE? Yes
● Is stateless? Yes
● Is it not responsibility of any existing domain object? Yes
Then I would say that is an excellent candidate for a DOMAIN SERVICE.
374. Tactical
OBJECTS: SERVICES
INFRASTRUCTURE SERVICE
EXAMPLE: Hashing service implementation.
● Is the implementation derived from the UBIQUITOUS LANGUAGE? No
● Is important how the password is actually hashed? No
Then I would say the implementation of hashing a password would go inside an INFRASTRUCTURE
SERVICE.
384. Tactical
OBJECTS: DOMAIN EVENTS
Use a DOMAIN EVENT to capture an occurrence of something that happened in the domain.
394. Tactical
OBJECTS: AGGREGATES
A collection of objects that are bound together by a root entity, otherwise known as an aggregate root.
404. Tactical
OBJECTS: AGGREGATES
EXAMPLE: Example on how to create a new address in a customer entity.
414. Tactical
OBJECTS: FACTORIES
A pattern design for decoupling the client from the knowing how to build a complex objects and
aggregates.
424. Tactical
OBJECTS: FACTORIES
EXAMPLE: Product factory.
434. Tactical
OBJECTS: REPOSITORIES
It’s a structural design pattern that mediates between the domain and data mapping layers using
collection-like interface for accessing domain objects.
44
Advantages and
disadvantages
5
455. Advantages
● Give us the principles and patterns to solve difficult problems.
● History of success.
● Clear code.
● Better understanding.
● Interaction with Domain Experts.
● Focus on the Domain.
465. Disadvantages
● Only for complex domains.
● Time consuming upfront.
● High learning curve.
475. References
● Wikipedia: https://en.wikipedia.org/wiki/Domain-driven_design
● Books: Implementing Domain-Driven Design by Vaughn Vernon and Domain-Driven Design in PHP
by Carlos Buenosvinos, Christian Soronellas, and Keyvan Akbary.
48
DEMO
6
49

More Related Content

Viewers also liked

Dealing With Legacy PHP Applications
Dealing With Legacy PHP ApplicationsDealing With Legacy PHP Applications
Dealing With Legacy PHP Applications
Viget Labs
 
Dealing with Legacy PHP Applications
Dealing with Legacy PHP ApplicationsDealing with Legacy PHP Applications
Dealing with Legacy PHP Applications
Clinton Dreisbach
 
PHP 7.1 : elegance of our legacy
PHP 7.1 : elegance of our legacyPHP 7.1 : elegance of our legacy
PHP 7.1 : elegance of our legacy
Damien Seguy
 
Working with Legacy Code
Working with Legacy CodeWorking with Legacy Code
Working with Legacy Code
Eyal Golan
 
PHPBarcelona Conference - Optimización aplicaciones PHP - Client side
PHPBarcelona Conference - Optimización aplicaciones PHP - Client sidePHPBarcelona Conference - Optimización aplicaciones PHP - Client side
PHPBarcelona Conference - Optimización aplicaciones PHP - Client side
maguilar
 
Working Effectively With Legacy Code
Working Effectively With Legacy CodeWorking Effectively With Legacy Code
Working Effectively With Legacy Code
scidept
 
Ecosistema de desarrollo en PHP con Docker y Ansible
Ecosistema de desarrollo en PHP con Docker y AnsibleEcosistema de desarrollo en PHP con Docker y Ansible
Ecosistema de desarrollo en PHP con Docker y Ansible
Vicent Soria Durá
 
Steganography: Hiding your secrets with PHP
Steganography: Hiding your secrets with PHPSteganography: Hiding your secrets with PHP
Steganography: Hiding your secrets with PHP
Raul Fraile
 
Transforming legacy PHP applications with Symfony2 and Varnish
Transforming legacy PHP applications with Symfony2 and VarnishTransforming legacy PHP applications with Symfony2 and Varnish
Transforming legacy PHP applications with Symfony2 and Varnish
Craig Marvelley
 
Working With Legacy Code
Working With Legacy CodeWorking With Legacy Code
Working With Legacy Code
Andrea Polci
 
Pimp legacy PHP apps with Apigility - TrueNorthPHP 2014
Pimp legacy PHP apps with Apigility - TrueNorthPHP 2014Pimp legacy PHP apps with Apigility - TrueNorthPHP 2014
Pimp legacy PHP apps with Apigility - TrueNorthPHP 2014
Michelangelo van Dam
 
XP Days Ukraine 2014 - Refactoring legacy code
XP Days Ukraine 2014 - Refactoring legacy codeXP Days Ukraine 2014 - Refactoring legacy code
XP Days Ukraine 2014 - Refactoring legacy code
Dmytro Mindra
 
XPDays Ukraine: Legacy
XPDays Ukraine: LegacyXPDays Ukraine: Legacy
XPDays Ukraine: Legacy
Victor_Cr
 
ITGM#4 Технический долг 2.0
ITGM#4 Технический долг 2.0ITGM#4 Технический долг 2.0
ITGM#4 Технический долг 2.0
Maxim Shulga
 
Club of anonimous developers "Refactoring: Legacy code"
Club of anonimous developers "Refactoring: Legacy code"Club of anonimous developers "Refactoring: Legacy code"
Club of anonimous developers "Refactoring: Legacy code"
Victor_Cr
 
Legacy: как победить в гонке (Joker)
Legacy: как победить в гонке (Joker)Legacy: как победить в гонке (Joker)
Legacy: как победить в гонке (Joker)
Victor_Cr
 
Living With Legacy Code
Living With Legacy CodeLiving With Legacy Code
Living With Legacy Code
Rowan Merewood
 
RabbitMQ y Symfony
RabbitMQ y SymfonyRabbitMQ y Symfony
RabbitMQ y Symfony
Miquel Company Rodriguez
 
Working Effectively With Legacy Code
Working Effectively With Legacy CodeWorking Effectively With Legacy Code
Working Effectively With Legacy Code
Naresh Jain
 
Refactoring 101
Refactoring 101Refactoring 101
Refactoring 101
Adam Culp
 

Viewers also liked (20)

Dealing With Legacy PHP Applications
Dealing With Legacy PHP ApplicationsDealing With Legacy PHP Applications
Dealing With Legacy PHP Applications
 
Dealing with Legacy PHP Applications
Dealing with Legacy PHP ApplicationsDealing with Legacy PHP Applications
Dealing with Legacy PHP Applications
 
PHP 7.1 : elegance of our legacy
PHP 7.1 : elegance of our legacyPHP 7.1 : elegance of our legacy
PHP 7.1 : elegance of our legacy
 
Working with Legacy Code
Working with Legacy CodeWorking with Legacy Code
Working with Legacy Code
 
PHPBarcelona Conference - Optimización aplicaciones PHP - Client side
PHPBarcelona Conference - Optimización aplicaciones PHP - Client sidePHPBarcelona Conference - Optimización aplicaciones PHP - Client side
PHPBarcelona Conference - Optimización aplicaciones PHP - Client side
 
Working Effectively With Legacy Code
Working Effectively With Legacy CodeWorking Effectively With Legacy Code
Working Effectively With Legacy Code
 
Ecosistema de desarrollo en PHP con Docker y Ansible
Ecosistema de desarrollo en PHP con Docker y AnsibleEcosistema de desarrollo en PHP con Docker y Ansible
Ecosistema de desarrollo en PHP con Docker y Ansible
 
Steganography: Hiding your secrets with PHP
Steganography: Hiding your secrets with PHPSteganography: Hiding your secrets with PHP
Steganography: Hiding your secrets with PHP
 
Transforming legacy PHP applications with Symfony2 and Varnish
Transforming legacy PHP applications with Symfony2 and VarnishTransforming legacy PHP applications with Symfony2 and Varnish
Transforming legacy PHP applications with Symfony2 and Varnish
 
Working With Legacy Code
Working With Legacy CodeWorking With Legacy Code
Working With Legacy Code
 
Pimp legacy PHP apps with Apigility - TrueNorthPHP 2014
Pimp legacy PHP apps with Apigility - TrueNorthPHP 2014Pimp legacy PHP apps with Apigility - TrueNorthPHP 2014
Pimp legacy PHP apps with Apigility - TrueNorthPHP 2014
 
XP Days Ukraine 2014 - Refactoring legacy code
XP Days Ukraine 2014 - Refactoring legacy codeXP Days Ukraine 2014 - Refactoring legacy code
XP Days Ukraine 2014 - Refactoring legacy code
 
XPDays Ukraine: Legacy
XPDays Ukraine: LegacyXPDays Ukraine: Legacy
XPDays Ukraine: Legacy
 
ITGM#4 Технический долг 2.0
ITGM#4 Технический долг 2.0ITGM#4 Технический долг 2.0
ITGM#4 Технический долг 2.0
 
Club of anonimous developers "Refactoring: Legacy code"
Club of anonimous developers "Refactoring: Legacy code"Club of anonimous developers "Refactoring: Legacy code"
Club of anonimous developers "Refactoring: Legacy code"
 
Legacy: как победить в гонке (Joker)
Legacy: как победить в гонке (Joker)Legacy: как победить в гонке (Joker)
Legacy: как победить в гонке (Joker)
 
Living With Legacy Code
Living With Legacy CodeLiving With Legacy Code
Living With Legacy Code
 
RabbitMQ y Symfony
RabbitMQ y SymfonyRabbitMQ y Symfony
RabbitMQ y Symfony
 
Working Effectively With Legacy Code
Working Effectively With Legacy CodeWorking Effectively With Legacy Code
Working Effectively With Legacy Code
 
Refactoring 101
Refactoring 101Refactoring 101
Refactoring 101
 

Similar to From Legacy to DDD in PHP | Tech Talks | Privalia

Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven Design
Mojammel Haque
 
Madhu_Resume
Madhu_ResumeMadhu_Resume
Madhu_Resume
madhu latha pulimi
 
Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven Design
Harsh Jegadeesan
 
Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven Design
Up2 Technology
 
Data Science in Production: Technologies That Drive Adoption of Data Science ...
Data Science in Production: Technologies That Drive Adoption of Data Science ...Data Science in Production: Technologies That Drive Adoption of Data Science ...
Data Science in Production: Technologies That Drive Adoption of Data Science ...
Nir Yungster
 
Dagster @ R&S MNT
Dagster @ R&S MNTDagster @ R&S MNT
Dagster @ R&S MNT
Simon Späti
 
Kubernetes, Toolbox to fail or succeed for beginners - Demi Ben-Ari, VP R&D @...
Kubernetes, Toolbox to fail or succeed for beginners - Demi Ben-Ari, VP R&D @...Kubernetes, Toolbox to fail or succeed for beginners - Demi Ben-Ari, VP R&D @...
Kubernetes, Toolbox to fail or succeed for beginners - Demi Ben-Ari, VP R&D @...
Demi Ben-Ari
 
Cloud Native Application Integration With APIs
Cloud Native Application Integration With APIsCloud Native Application Integration With APIs
Cloud Native Application Integration With APIs
Nirmal Fernando
 
Docker, Microservices, and the Service Mesh
Docker, Microservices, and the Service MeshDocker, Microservices, and the Service Mesh
Docker, Microservices, and the Service Mesh
Tony Pujals
 
2019-Nov: Domain Driven Design (DDD) and when not to use it
2019-Nov: Domain Driven Design (DDD) and when not to use it2019-Nov: Domain Driven Design (DDD) and when not to use it
2019-Nov: Domain Driven Design (DDD) and when not to use it
Mark Windholtz
 
ML Platform Q1 Meetup: Airbnb's End-to-End Machine Learning Infrastructure
ML Platform Q1 Meetup: Airbnb's End-to-End Machine Learning InfrastructureML Platform Q1 Meetup: Airbnb's End-to-End Machine Learning Infrastructure
ML Platform Q1 Meetup: Airbnb's End-to-End Machine Learning Infrastructure
Fei Chen
 
Tampere Docker meetup - Happy 5th Birthday Docker
Tampere Docker meetup - Happy 5th Birthday DockerTampere Docker meetup - Happy 5th Birthday Docker
Tampere Docker meetup - Happy 5th Birthday Docker
Sakari Hoisko
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
Industrializing Machine learning pipelines
Industrializing Machine learning pipelinesIndustrializing Machine learning pipelines
Industrializing Machine learning pipelines
Germain Tanguy
 
DITA Interoperability
DITA InteroperabilityDITA Interoperability
DITA Interoperability
Kristen Eberlein
 
Production-Ready Kubernetes: It's Not About Technology
Production-Ready Kubernetes: It's Not About TechnologyProduction-Ready Kubernetes: It's Not About Technology
Production-Ready Kubernetes: It's Not About Technology
Antoine Craske
 
Multilanguage Pipelines with Jenkins, Docker and Kubernetes (Commit Conf 2018)
Multilanguage Pipelines with Jenkins, Docker and Kubernetes (Commit Conf 2018)Multilanguage Pipelines with Jenkins, Docker and Kubernetes (Commit Conf 2018)
Multilanguage Pipelines with Jenkins, Docker and Kubernetes (Commit Conf 2018)
Jorge Hidalgo
 
Clean architecture
Clean architectureClean architecture
Clean architecture
.NET Crowd
 
Montreal Kubernetes Meetup: Developer-first workflows (for microservices) on ...
Montreal Kubernetes Meetup: Developer-first workflows (for microservices) on ...Montreal Kubernetes Meetup: Developer-first workflows (for microservices) on ...
Montreal Kubernetes Meetup: Developer-first workflows (for microservices) on ...
Ambassador Labs
 
Docker Birthday #5 Meetup Cluj - Presentation
Docker Birthday #5 Meetup Cluj - PresentationDocker Birthday #5 Meetup Cluj - Presentation
Docker Birthday #5 Meetup Cluj - Presentation
Alex Vranceanu
 

Similar to From Legacy to DDD in PHP | Tech Talks | Privalia (20)

Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven Design
 
Madhu_Resume
Madhu_ResumeMadhu_Resume
Madhu_Resume
 
Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven Design
 
Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven Design
 
Data Science in Production: Technologies That Drive Adoption of Data Science ...
Data Science in Production: Technologies That Drive Adoption of Data Science ...Data Science in Production: Technologies That Drive Adoption of Data Science ...
Data Science in Production: Technologies That Drive Adoption of Data Science ...
 
Dagster @ R&S MNT
Dagster @ R&S MNTDagster @ R&S MNT
Dagster @ R&S MNT
 
Kubernetes, Toolbox to fail or succeed for beginners - Demi Ben-Ari, VP R&D @...
Kubernetes, Toolbox to fail or succeed for beginners - Demi Ben-Ari, VP R&D @...Kubernetes, Toolbox to fail or succeed for beginners - Demi Ben-Ari, VP R&D @...
Kubernetes, Toolbox to fail or succeed for beginners - Demi Ben-Ari, VP R&D @...
 
Cloud Native Application Integration With APIs
Cloud Native Application Integration With APIsCloud Native Application Integration With APIs
Cloud Native Application Integration With APIs
 
Docker, Microservices, and the Service Mesh
Docker, Microservices, and the Service MeshDocker, Microservices, and the Service Mesh
Docker, Microservices, and the Service Mesh
 
2019-Nov: Domain Driven Design (DDD) and when not to use it
2019-Nov: Domain Driven Design (DDD) and when not to use it2019-Nov: Domain Driven Design (DDD) and when not to use it
2019-Nov: Domain Driven Design (DDD) and when not to use it
 
ML Platform Q1 Meetup: Airbnb's End-to-End Machine Learning Infrastructure
ML Platform Q1 Meetup: Airbnb's End-to-End Machine Learning InfrastructureML Platform Q1 Meetup: Airbnb's End-to-End Machine Learning Infrastructure
ML Platform Q1 Meetup: Airbnb's End-to-End Machine Learning Infrastructure
 
Tampere Docker meetup - Happy 5th Birthday Docker
Tampere Docker meetup - Happy 5th Birthday DockerTampere Docker meetup - Happy 5th Birthday Docker
Tampere Docker meetup - Happy 5th Birthday Docker
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Industrializing Machine learning pipelines
Industrializing Machine learning pipelinesIndustrializing Machine learning pipelines
Industrializing Machine learning pipelines
 
DITA Interoperability
DITA InteroperabilityDITA Interoperability
DITA Interoperability
 
Production-Ready Kubernetes: It's Not About Technology
Production-Ready Kubernetes: It's Not About TechnologyProduction-Ready Kubernetes: It's Not About Technology
Production-Ready Kubernetes: It's Not About Technology
 
Multilanguage Pipelines with Jenkins, Docker and Kubernetes (Commit Conf 2018)
Multilanguage Pipelines with Jenkins, Docker and Kubernetes (Commit Conf 2018)Multilanguage Pipelines with Jenkins, Docker and Kubernetes (Commit Conf 2018)
Multilanguage Pipelines with Jenkins, Docker and Kubernetes (Commit Conf 2018)
 
Clean architecture
Clean architectureClean architecture
Clean architecture
 
Montreal Kubernetes Meetup: Developer-first workflows (for microservices) on ...
Montreal Kubernetes Meetup: Developer-first workflows (for microservices) on ...Montreal Kubernetes Meetup: Developer-first workflows (for microservices) on ...
Montreal Kubernetes Meetup: Developer-first workflows (for microservices) on ...
 
Docker Birthday #5 Meetup Cluj - Presentation
Docker Birthday #5 Meetup Cluj - PresentationDocker Birthday #5 Meetup Cluj - Presentation
Docker Birthday #5 Meetup Cluj - Presentation
 

Recently uploaded

Microservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we workMicroservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we work
Sven Peters
 
Unveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdfUnveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdf
brainerhub1
 
316895207-SAP-Oil-and-Gas-Downstream-Training.pptx
316895207-SAP-Oil-and-Gas-Downstream-Training.pptx316895207-SAP-Oil-and-Gas-Downstream-Training.pptx
316895207-SAP-Oil-and-Gas-Downstream-Training.pptx
ssuserad3af4
 
Top 9 Trends in Cybersecurity for 2024.pptx
Top 9 Trends in Cybersecurity for 2024.pptxTop 9 Trends in Cybersecurity for 2024.pptx
Top 9 Trends in Cybersecurity for 2024.pptx
devvsandy
 
All you need to know about Spring Boot and GraalVM
All you need to know about Spring Boot and GraalVMAll you need to know about Spring Boot and GraalVM
All you need to know about Spring Boot and GraalVM
Alina Yurenko
 
Odoo ERP Vs. Traditional ERP Systems – A Comparative Analysis
Odoo ERP Vs. Traditional ERP Systems – A Comparative AnalysisOdoo ERP Vs. Traditional ERP Systems – A Comparative Analysis
Odoo ERP Vs. Traditional ERP Systems – A Comparative Analysis
Envertis Software Solutions
 
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
mz5nrf0n
 
Artificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension FunctionsArtificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension Functions
Octavian Nadolu
 
Lecture 2 - software testing SE 412.pptx
Lecture 2 - software testing SE 412.pptxLecture 2 - software testing SE 412.pptx
Lecture 2 - software testing SE 412.pptx
TaghreedAltamimi
 
How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?
ToXSL Technologies
 
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
kalichargn70th171
 
GreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-JurisicGreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-Jurisic
Green Software Development
 
Webinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for EmbeddedWebinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for Embedded
ICS
 
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
dakas1
 
Modelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - AmsterdamModelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - Amsterdam
Alberto Brandolini
 
Requirement Traceability in Xen Functional Safety
Requirement Traceability in Xen Functional SafetyRequirement Traceability in Xen Functional Safety
Requirement Traceability in Xen Functional Safety
Ayan Halder
 
Using Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query PerformanceUsing Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query Performance
Grant Fritchey
 
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
mz5nrf0n
 
Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
Philip Schwarz
 
zOS Mainframe JES2-JES3 JCL-JECL Differences
zOS Mainframe JES2-JES3 JCL-JECL DifferenceszOS Mainframe JES2-JES3 JCL-JECL Differences
zOS Mainframe JES2-JES3 JCL-JECL Differences
YousufSait3
 

Recently uploaded (20)

Microservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we workMicroservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we work
 
Unveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdfUnveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdf
 
316895207-SAP-Oil-and-Gas-Downstream-Training.pptx
316895207-SAP-Oil-and-Gas-Downstream-Training.pptx316895207-SAP-Oil-and-Gas-Downstream-Training.pptx
316895207-SAP-Oil-and-Gas-Downstream-Training.pptx
 
Top 9 Trends in Cybersecurity for 2024.pptx
Top 9 Trends in Cybersecurity for 2024.pptxTop 9 Trends in Cybersecurity for 2024.pptx
Top 9 Trends in Cybersecurity for 2024.pptx
 
All you need to know about Spring Boot and GraalVM
All you need to know about Spring Boot and GraalVMAll you need to know about Spring Boot and GraalVM
All you need to know about Spring Boot and GraalVM
 
Odoo ERP Vs. Traditional ERP Systems – A Comparative Analysis
Odoo ERP Vs. Traditional ERP Systems – A Comparative AnalysisOdoo ERP Vs. Traditional ERP Systems – A Comparative Analysis
Odoo ERP Vs. Traditional ERP Systems – A Comparative Analysis
 
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
 
Artificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension FunctionsArtificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension Functions
 
Lecture 2 - software testing SE 412.pptx
Lecture 2 - software testing SE 412.pptxLecture 2 - software testing SE 412.pptx
Lecture 2 - software testing SE 412.pptx
 
How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?
 
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
 
GreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-JurisicGreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-Jurisic
 
Webinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for EmbeddedWebinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for Embedded
 
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
 
Modelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - AmsterdamModelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - Amsterdam
 
Requirement Traceability in Xen Functional Safety
Requirement Traceability in Xen Functional SafetyRequirement Traceability in Xen Functional Safety
Requirement Traceability in Xen Functional Safety
 
Using Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query PerformanceUsing Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query Performance
 
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
 
Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
 
zOS Mainframe JES2-JES3 JCL-JECL Differences
zOS Mainframe JES2-JES3 JCL-JECL DifferenceszOS Mainframe JES2-JES3 JCL-JECL Differences
zOS Mainframe JES2-JES3 JCL-JECL Differences
 

From Legacy to DDD in PHP | Tech Talks | Privalia

  • 2. 2A LEADING GROUP AT YOUR SERVICE LEADERS IN ALL MARKETS POLAND FRANCE, SPAIN, ITALY, GERMANY, AUSTRIA, UK SPAIN, ITALY, MEXICO, BRAZIL BENELUX SWITZERLAND DENMARK Uncontestable flash sales leader in Europe and LATAM. We are your partner to deliver you a global service tailored to each market according to your business needs. VENTE-PRIVEE GROUP AMBITIONS
  • 3. 3A LEADING GROUP AT YOUR SERVICE FACTS & FIGURES #1 Flash Sales in EU and Latam. #2 e-commerce in EU MAJOR PLAYER Members + 60 M Products sold / day +320 K In 2016* 2,1€ Bn Unique sales visitors 12,1M Of sales from mobile 65% * Classic Sales (w/out taxes)
  • 4. 4A LEADING GROUP AT YOUR SERVICE IT AREAS # Systems # Production # Cybersecurity # Network # Application Maintenance INFRASTRUCTURE # SAP # WMS # ETL # Data # Scrum BACKOFFICE CORE TEAM QA & RELEASE BI & DATA PLATFORM AGILE OFFICE # Mobile # Catalogue # Customer # Payments & Fraud # Billing & Interfaces # Supply Chain # Marketplace # VP Integration # Architecture Solution # QA # DevOps
  • 5. 5A LEADING GROUP AT YOUR SERVICE IT TECHNOLOGIES DATA CODE TOOLS PERFORMANCE
  • 6. 6A LEADING GROUP AT YOUR SERVICE JOB OPPORTUNITIES HIRING! We are 01001010010011110100100101001110 # Tech Lead # PHP Developer # DevOps # Android Developer # IOS Developer # Solutions Architect # Scrum Master # SAP FICO # SAP LO # WMS JIT Developer # QA # JAVA Developer #Javascript # CISO # ETL Developer # Systems Administrator people@privalia.com 01001010010011110100100101001110
  • 7. 7 From Legacy to DDD in PHP Tech Talk | Privalia 9 MARZO 2017
  • 8. 8WHO I AM Jordi Vila Gallardo Senior Developer @Privalia Twitter: @jordivilaga
  • 9. 9 1. Legacy 2. Introduction (DDD) 3. Strategic (DDD) - Concepts 4. Tactical (DDD) - Architecture - Layers - Objects 5. Advantages and disadvantages 6. Demo SUMMARY
  • 11. 111. Legacy Computer program (typically a database system) which, although critical to an organization's operations, is in an obsolete format or is installed on an obsolete system. ● Not testable. ● Hard to maintain. ● Reduces performance. ● Security and access control problems. ● Reduces productivity. ● Hard to scale. ● Reduces time to market.
  • 13. 132. Introduction ● Is an approach to software development for complex needs. ● It was coined by Eric Evans in his book “Domain-Driven Design - Tackling Complexity in the Heart of Software”. SOME PREMISES ● Primary focus on the domain logic. ● Initiating continuous collaboration between technical and domain experts. ● Development based on business and not database oriented.
  • 14. 142. Introduction STRATEGIC VS TACTICAL STRATEGIC VS TACTICAL Domain-Driven Design
  • 16. 163. Strategic ● Domain ● Subdomain ● Bounded Context ● Ubiquitous Language CONCEPTS
  • 17. 173. Strategic DOMAIN Is the global problem space.
  • 18. 183. Strategic SUBDOMAINS Are a portion of the problem space concept.
  • 19. 193. Strategic BOUNDED CONTEXT Are a portion of the solution space concept. In other words, the subdomain is describing something about the way you’ve chosen to break down your business and the bonded context describes how the software has been broken down.
  • 20. 203. Strategic DOMAIN EXPERT A member of a software project whose field is the domain of the application, rather than software development. Not just any user of the software, the domain expert has deep knowledge of the subject.
  • 21. 213. Strategic UBIQUITOUS LANGUAGE Ubiquitous language is the term Eric Evans in Domain-Driven Design for the practice of building up common, rigorous language between developers and users. This language should be based on the Domain Model used in the software.
  • 22. 223. Strategic ● Learning about our Domain by talking with a Domain Expert. ● Breaking the Domain into Subdomains. ● Focusing on one Subdomain with the Domain Expert. ○ Make a list of things we need to know about the Subdomain. ○ Modeling the Domain with the Domain Expert and working the terminology. ● First high-level Model of the Subdomain. STEPS TO MODELING A PROBLEM IN SOFTWARE
  • 24. 244. Tactical ● Hexagonal Architecture ● CQRS (Command-Query Responsibility Segregation) ● Event-Driven Architecture ● Service-Oriented ● Representational State Transfer (REST) ● Data Fabric and Grid-Based Distributed Computing ARCHITECTURES
  • 27. 274. Tactical ● Entities → Domain ● Value Objects → Domain ● Services → Domain, Infrastructure and Application ● Domain Events → Domain ● Aggregates → Domain ● Factories → Domain ● Repositories → Infrastructure OBJECTS
  • 28. 284. Tactical OBJECTS: ENTITIES An object fundamentally defined by identity and not by its attributes. CHARACTERISTICS ● Unique identity. ● Mutable. ● Comparison using identifier or reference equality. ● Can live by its own. ● Lifespan (It has history of what happened to it and how it changed during its lifetime).
  • 29. 294. Tactical OBJECTS: ENTITIES - ANEMIC ENTITY ANTI-PATTERN ANEMIC NON ANEMIC
  • 30. 304. Tactical OBJECTS: ENTITIES - UBIQUITOUS LANGUAGE UBIQUITOUS LANGUAGE Modeling on terms coming out of our UBIQUITOUS LANGUAGE instead of a noun and verbs object-oriented design. Traditional object-oriented design: UBIQUITOUS LANGUAGE design:
  • 31. 314. Tactical OBJECTS: VALUE OBJECTS An object that contains attributes but has not conceptual identity. CHARACTERISTICS ● Measures, quantifies, or describe a thing in the domain. ● Immutable ● Comparison using structural or reference equality. ● Can not live by its own, it should always belong to one or several entities. ● No lifespan.
  • 32. 324. Tactical OBJECTS: VALUE OBJECTS - EXAMPLE EXAMPLE: Example of Value Object.
  • 33. 334. Tactical OBJECTS: VALUE OBJECTS - EXAMPLE IMMUTABILITY EXAMPLE: Immutability Money constructor Increase the amount
  • 34. 344. Tactical OBJECTS: SERVICES It’s a middleware between the outside world and the domain logic. CHARACTERISTICS ● The operation relates to a domain concept that is not a natural part of an ENTITY or VALUE OBJECT. ● The operation name is part of the UBIQUITOUS LANGUAGE. ● The operation is stateless.
  • 35. 354. Tactical OBJECTS: SERVICES TYPES ● Application Services ○ Is how the outside world communicates with our application. ○ This could be through HTTP requests, an API or through an automated messaging service. ○ Business rules are not allowed. ○ Sometimes referred as “Workflow Services” or “Use Cases”. ● Domain Services ○ Encapsulates business logic that does not naturally fit within a domain objects. ○ Meaning and responsibilities should make sense to the STAKEHOLDERS or DOMAIN EXPERTS. ● Infrastructure Services ○ Is used for dealing with technical details of the infrastructure.
  • 36. 364. Tactical OBJECTS: SERVICES DOMAIN SERVICE EXAMPLE: Hashing service. ● Is derived from the UBIQUITOUS LANGUAGE? Yes ● Is stateless? Yes ● Is it not responsibility of any existing domain object? Yes Then I would say that is an excellent candidate for a DOMAIN SERVICE.
  • 37. 374. Tactical OBJECTS: SERVICES INFRASTRUCTURE SERVICE EXAMPLE: Hashing service implementation. ● Is the implementation derived from the UBIQUITOUS LANGUAGE? No ● Is important how the password is actually hashed? No Then I would say the implementation of hashing a password would go inside an INFRASTRUCTURE SERVICE.
  • 38. 384. Tactical OBJECTS: DOMAIN EVENTS Use a DOMAIN EVENT to capture an occurrence of something that happened in the domain.
  • 39. 394. Tactical OBJECTS: AGGREGATES A collection of objects that are bound together by a root entity, otherwise known as an aggregate root.
  • 40. 404. Tactical OBJECTS: AGGREGATES EXAMPLE: Example on how to create a new address in a customer entity.
  • 41. 414. Tactical OBJECTS: FACTORIES A pattern design for decoupling the client from the knowing how to build a complex objects and aggregates.
  • 43. 434. Tactical OBJECTS: REPOSITORIES It’s a structural design pattern that mediates between the domain and data mapping layers using collection-like interface for accessing domain objects.
  • 45. 455. Advantages ● Give us the principles and patterns to solve difficult problems. ● History of success. ● Clear code. ● Better understanding. ● Interaction with Domain Experts. ● Focus on the Domain.
  • 46. 465. Disadvantages ● Only for complex domains. ● Time consuming upfront. ● High learning curve.
  • 47. 475. References ● Wikipedia: https://en.wikipedia.org/wiki/Domain-driven_design ● Books: Implementing Domain-Driven Design by Vaughn Vernon and Domain-Driven Design in PHP by Carlos Buenosvinos, Christian Soronellas, and Keyvan Akbary.
  • 49. 49