SlideShare a Scribd company logo
1 of 18
How to migrate to Apex Enterprise
Patterns?
by David Fernandez
#CD22
- Long time developer.
- Some years of experience in
Salesforce ecosystem.
- Artificial Intelligence
enthusiast.
@DfdezR
dfernandezr/
Salesforce Innovation Squad Lead
at Bluez.io
#CD22
● What are Apex Enterprise Patterns?
● Why should I Migrate to Apex Enterprise
Patterns?
● Where to start?
○ Selector Approach
○ Service Approach
○ Domain Approach
● Tips and Study Materials
● Q & A
Agenda
#CD22
● Who, What, When?
● Separation Of Concerns
● DRY
● SOC = Code Reuse?
What are Apex Enterprise Patterns?
#CD22
SELECTOR PATTERN
#CD22
DOMAIN PATTERN
#CD22
SERVICE PATTERN
#CD22
UNIT OF WORK PATTERN
#CD22
● Facilitates collaborative teamwork between developers
● Allows evolution of complexity
● Sets a good ground for scalability
● Less Tests!!!! (When developing new stuff)
● Prepares the implementations to implement new technologies
(Salesforce DX)
Why should I Migrate to Apex Enterprise Patterns?
#CD22
● Do I need AEP?
Where to start?
#CD22
● Realistically evaluate the developers maturity and establish
responsibilities.
● Be aware of the amount of time to dedicate.
● Focus on those pain points to start (Fix, don’t patch).
● Think and implement new functionalities into the change of mind.
What factors I need to successfully migrate?
#CD22
Selector Approach
Domain Approach
Service Approach
Ok I want to migrate, I can do it, but… Where do I start?
#CD22
1. Select object
2. Find ALL query usages
3. Inject selector in usages
4. Start Service implementation
5. Start Domain implementation
6. Controllers
7. Triggers/Batches
Selector Approach
#CD22
1. Select object
2. Create SINGLE trigger
3. Move all trigger functionalities and DML related operations
4. Start Selectors implementation
5. Start Services implementations
6. Controllers
7. Batches
Domain Approach
#CD22
1. Select object
2. Find ALL business usages of object
3. Isolate specific functionalities in specific services
4. Start Selectors implementation
5. Start Domain implementations
6. Triggers/Batches
7. Controllers
Service Approach
#CD22
Q & A
#CD22
- https://trailhead.salesforce.com/en/content/learn/modules/apex_pattern
s_sl
- https://trailhead.salesforce.com/en/content/learn/modules/apex_pattern
s_dsl
- https://andyinthecloud.com/
- https://www.apexhours.com/apex-enterprise-patterns/
- https://quirkyapex.com/
Tips and Study Materials
Thank you! #CD22

More Related Content

What's hot

What's hot (20)

Introduction to Salesforce | Salesforce Tutorial for Beginners | Salesforce T...
Introduction to Salesforce | Salesforce Tutorial for Beginners | Salesforce T...Introduction to Salesforce | Salesforce Tutorial for Beginners | Salesforce T...
Introduction to Salesforce | Salesforce Tutorial for Beginners | Salesforce T...
 
Salesforce Org Health Check & Performance Testing
Salesforce Org Health Check & Performance TestingSalesforce Org Health Check & Performance Testing
Salesforce Org Health Check & Performance Testing
 
First Steps to Salesforce Release Management & DevOps [Salesforce User Group,...
First Steps to Salesforce Release Management & DevOps [Salesforce User Group,...First Steps to Salesforce Release Management & DevOps [Salesforce User Group,...
First Steps to Salesforce Release Management & DevOps [Salesforce User Group,...
 
Demystify Salesforce Bulk API
Demystify Salesforce Bulk APIDemystify Salesforce Bulk API
Demystify Salesforce Bulk API
 
Salesforce Development Best Practices
Salesforce Development Best PracticesSalesforce Development Best Practices
Salesforce Development Best Practices
 
What Is Salesforce? | Salesforce Training - What Does Salesforce Do? | Salesf...
What Is Salesforce? | Salesforce Training - What Does Salesforce Do? | Salesf...What Is Salesforce? | Salesforce Training - What Does Salesforce Do? | Salesf...
What Is Salesforce? | Salesforce Training - What Does Salesforce Do? | Salesf...
 
Manage Salesforce Like a Pro with Governance
Manage Salesforce Like a Pro with GovernanceManage Salesforce Like a Pro with Governance
Manage Salesforce Like a Pro with Governance
 
Introduction to MuleSoft Anytime Platform
Introduction to MuleSoft Anytime PlatformIntroduction to MuleSoft Anytime Platform
Introduction to MuleSoft Anytime Platform
 
Introduction to lightning Web Component
Introduction to lightning Web ComponentIntroduction to lightning Web Component
Introduction to lightning Web Component
 
Salesforce admin training 1
Salesforce admin training 1Salesforce admin training 1
Salesforce admin training 1
 
Dell Boomi Integration with Salesforce
Dell Boomi Integration with SalesforceDell Boomi Integration with Salesforce
Dell Boomi Integration with Salesforce
 
Salesforce apex hours PayPal with Salesforce Integration
Salesforce apex hours   PayPal with Salesforce IntegrationSalesforce apex hours   PayPal with Salesforce Integration
Salesforce apex hours PayPal with Salesforce Integration
 
Tackling Salesforce Technical Debt
Tackling Salesforce Technical DebtTackling Salesforce Technical Debt
Tackling Salesforce Technical Debt
 
Best Practices for Team Development in a Single Org
Best Practices for Team Development in a Single OrgBest Practices for Team Development in a Single Org
Best Practices for Team Development in a Single Org
 
Microsoft PowerApps
Microsoft PowerAppsMicrosoft PowerApps
Microsoft PowerApps
 
SERVICENOW PPT BY PAVANKUMAR
SERVICENOW PPT BY PAVANKUMARSERVICENOW PPT BY PAVANKUMAR
SERVICENOW PPT BY PAVANKUMAR
 
Exploring the Salesforce REST API
Exploring the Salesforce REST APIExploring the Salesforce REST API
Exploring the Salesforce REST API
 
Best Practices with Apex in 2022.pdf
Best Practices with Apex in 2022.pdfBest Practices with Apex in 2022.pdf
Best Practices with Apex in 2022.pdf
 
Salesforce Pardot basics
Salesforce Pardot basicsSalesforce Pardot basics
Salesforce Pardot basics
 
Best Practices for Successful Deployment
Best Practices for Successful DeploymentBest Practices for Successful Deployment
Best Practices for Successful Deployment
 

Similar to How to migrate to Apex Enterprise Patterns?, David Fernandez

How To Do A Project?
How To Do A Project?How To Do A Project?
How To Do A Project?
Aravinth NSP
 

Similar to How to migrate to Apex Enterprise Patterns?, David Fernandez (20)

Tackle Your Everyday Business Problems Like an Architect, Melissa Shepard
Tackle Your Everyday Business Problems Like an Architect, Melissa ShepardTackle Your Everyday Business Problems Like an Architect, Melissa Shepard
Tackle Your Everyday Business Problems Like an Architect, Melissa Shepard
 
How to scale Mendix teams - Mx meetup jan 28 2021
How to scale Mendix teams - Mx meetup  jan 28 2021How to scale Mendix teams - Mx meetup  jan 28 2021
How to scale Mendix teams - Mx meetup jan 28 2021
 
Three pillars and Seven specializations – Product Development Outsourcers Pro...
Three pillars and Seven specializations – Product Development Outsourcers Pro...Three pillars and Seven specializations – Product Development Outsourcers Pro...
Three pillars and Seven specializations – Product Development Outsourcers Pro...
 
How we should include Devops Center to get happy developers?, David Fernandez...
How we should include Devops Center to get happy developers?, David Fernandez...How we should include Devops Center to get happy developers?, David Fernandez...
How we should include Devops Center to get happy developers?, David Fernandez...
 
Model Driven Architectures
Model Driven ArchitecturesModel Driven Architectures
Model Driven Architectures
 
Keeping up with Tech
Keeping up with Tech Keeping up with Tech
Keeping up with Tech
 
Salesforce DevOps: Where Do You Start?
Salesforce DevOps: Where Do You Start?Salesforce DevOps: Where Do You Start?
Salesforce DevOps: Where Do You Start?
 
How To Do A Project
How To Do A ProjectHow To Do A Project
How To Do A Project
 
How To Do A Project?
How To Do A Project?How To Do A Project?
How To Do A Project?
 
Tips on Hiring ​Full-Stack Developers for Your Business
Tips on Hiring ​Full-Stack Developers for Your BusinessTips on Hiring ​Full-Stack Developers for Your Business
Tips on Hiring ​Full-Stack Developers for Your Business
 
Design in the wild! A look at Salesforce Designer in their natural habitat, K...
Design in the wild! A look at Salesforce Designer in their natural habitat, K...Design in the wild! A look at Salesforce Designer in their natural habitat, K...
Design in the wild! A look at Salesforce Designer in their natural habitat, K...
 
How DevOps Impact Product Management by xOps Co-Founders
How DevOps Impact Product Management by xOps Co-FoundersHow DevOps Impact Product Management by xOps Co-Founders
How DevOps Impact Product Management by xOps Co-Founders
 
DevOpsDays Jakarta Igites
DevOpsDays Jakarta IgitesDevOpsDays Jakarta Igites
DevOpsDays Jakarta Igites
 
Pluk2011 deploy-mysql-like-a-devops-sysadmin
Pluk2011 deploy-mysql-like-a-devops-sysadminPluk2011 deploy-mysql-like-a-devops-sysadmin
Pluk2011 deploy-mysql-like-a-devops-sysadmin
 
Seven Cloud Sins of DevOps
Seven Cloud Sins of DevOpsSeven Cloud Sins of DevOps
Seven Cloud Sins of DevOps
 
Confee Full Stack Developer Job Description
Confee Full Stack Developer Job DescriptionConfee Full Stack Developer Job Description
Confee Full Stack Developer Job Description
 
How to Do Kick-Ass Software Development
How to Do Kick-Ass Software DevelopmentHow to Do Kick-Ass Software Development
How to Do Kick-Ass Software Development
 
Agile Methodology
Agile MethodologyAgile Methodology
Agile Methodology
 
The Death and Rise of Enterprise DevOps
The Death and Rise of Enterprise DevOpsThe Death and Rise of Enterprise DevOps
The Death and Rise of Enterprise DevOps
 
"The life beyond Terraform, or the rise of Platform Engineering", Stanislav ...
"The life beyond Terraform, or the rise of Platform Engineering",  Stanislav ..."The life beyond Terraform, or the rise of Platform Engineering",  Stanislav ...
"The life beyond Terraform, or the rise of Platform Engineering", Stanislav ...
 

More from CzechDreamin

More from CzechDreamin (20)

Salesforce Forecasting: Evolution, Implementation and Best Practices, Christi...
Salesforce Forecasting: Evolution, Implementation and Best Practices, Christi...Salesforce Forecasting: Evolution, Implementation and Best Practices, Christi...
Salesforce Forecasting: Evolution, Implementation and Best Practices, Christi...
 
Supercharge Salesforce Marketing Cloud: The Ultimate Apps Guide, Cyril Louis ...
Supercharge Salesforce Marketing Cloud: The Ultimate Apps Guide, Cyril Louis ...Supercharge Salesforce Marketing Cloud: The Ultimate Apps Guide, Cyril Louis ...
Supercharge Salesforce Marketing Cloud: The Ultimate Apps Guide, Cyril Louis ...
 
Streamline Your Integration with Salesforce’s Composite API: A Consultant’s G...
Streamline Your Integration with Salesforce’s Composite API: A Consultant’s G...Streamline Your Integration with Salesforce’s Composite API: A Consultant’s G...
Streamline Your Integration with Salesforce’s Composite API: A Consultant’s G...
 
Architecting for Analytics, Aaron Crear
Architecting for Analytics, Aaron CrearArchitecting for Analytics, Aaron Crear
Architecting for Analytics, Aaron Crear
 
Ape to API, Filip Dousek
Ape to API, Filip DousekApe to API, Filip Dousek
Ape to API, Filip Dousek
 
Push Upgrades, The last mile of Salesforce DevOps, Manuel Moya
Push Upgrades, The last mile of Salesforce DevOps, Manuel MoyaPush Upgrades, The last mile of Salesforce DevOps, Manuel Moya
Push Upgrades, The last mile of Salesforce DevOps, Manuel Moya
 
How do you know you’re solving the right problem? Design Thinking for Salesfo...
How do you know you’re solving the right problem? Design Thinking for Salesfo...How do you know you’re solving the right problem? Design Thinking for Salesfo...
How do you know you’re solving the right problem? Design Thinking for Salesfo...
 
ChatGPT … How Does it Flow?, Mark Jones
ChatGPT … How Does it Flow?, Mark JonesChatGPT … How Does it Flow?, Mark Jones
ChatGPT … How Does it Flow?, Mark Jones
 
Real-time communication with Account Engagement (Pardot). Marketers meet deve...
Real-time communication with Account Engagement (Pardot). Marketers meet deve...Real-time communication with Account Engagement (Pardot). Marketers meet deve...
Real-time communication with Account Engagement (Pardot). Marketers meet deve...
 
Black Hat Session: Exploring and Exploiting Aura based Experiences, Christian...
Black Hat Session: Exploring and Exploiting Aura based Experiences, Christian...Black Hat Session: Exploring and Exploiting Aura based Experiences, Christian...
Black Hat Session: Exploring and Exploiting Aura based Experiences, Christian...
 
Sales methodology for Salesforce Opportunity, Georgy Avilov
Sales methodology for Salesforce Opportunity, Georgy AvilovSales methodology for Salesforce Opportunity, Georgy Avilov
Sales methodology for Salesforce Opportunity, Georgy Avilov
 
5 key ideas for robust and flexible REST API integrations with Apex, Lucian M...
5 key ideas for robust and flexible REST API integrations with Apex, Lucian M...5 key ideas for robust and flexible REST API integrations with Apex, Lucian M...
5 key ideas for robust and flexible REST API integrations with Apex, Lucian M...
 
Report & Dashboard REST API : Get your report accessible anywhere !, Romain Q...
Report & Dashboard REST API : Get your report accessible anywhere !, Romain Q...Report & Dashboard REST API : Get your report accessible anywhere !, Romain Q...
Report & Dashboard REST API : Get your report accessible anywhere !, Romain Q...
 
No Such Thing as Best Practice in Design, Nati Asher and Pat Fragoso
No Such Thing as Best Practice in Design, Nati Asher and Pat FragosoNo Such Thing as Best Practice in Design, Nati Asher and Pat Fragoso
No Such Thing as Best Practice in Design, Nati Asher and Pat Fragoso
 
Why do you Need to Migrate to Salesforce Flow?, Andrew Cook
Why do you Need to Migrate to Salesforce Flow?, Andrew CookWhy do you Need to Migrate to Salesforce Flow?, Andrew Cook
Why do you Need to Migrate to Salesforce Flow?, Andrew Cook
 
Be kind to your future admin self, Silvia Denaro & Nathaniel Sombu
Be kind to your future admin self, Silvia Denaro & Nathaniel SombuBe kind to your future admin self, Silvia Denaro & Nathaniel Sombu
Be kind to your future admin self, Silvia Denaro & Nathaniel Sombu
 
Monitoring Automation Performance in Marketing Cloud Engagement, Daniela Vrbk...
Monitoring Automation Performance in Marketing Cloud Engagement, Daniela Vrbk...Monitoring Automation Performance in Marketing Cloud Engagement, Daniela Vrbk...
Monitoring Automation Performance in Marketing Cloud Engagement, Daniela Vrbk...
 
The minimum-profile approach – the modern way to design an efficient security...
The minimum-profile approach – the modern way to design an efficient security...The minimum-profile approach – the modern way to design an efficient security...
The minimum-profile approach – the modern way to design an efficient security...
 
Restriction Rules – The Whole Picture, Louise Lockie
Restriction Rules – The Whole Picture, Louise LockieRestriction Rules – The Whole Picture, Louise Lockie
Restriction Rules – The Whole Picture, Louise Lockie
 
Introduction to Custom Journey Builder Activities, Orkhan Alakbarli
Introduction to Custom Journey Builder Activities, Orkhan AlakbarliIntroduction to Custom Journey Builder Activities, Orkhan Alakbarli
Introduction to Custom Journey Builder Activities, Orkhan Alakbarli
 

Recently uploaded

Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...
Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...
Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...
Lisi Hocke
 

Recently uploaded (20)

Weeding your micro service landscape.pdf
Weeding your micro service landscape.pdfWeeding your micro service landscape.pdf
Weeding your micro service landscape.pdf
 
Abortion Clinic Pretoria ](+27832195400*)[ Abortion Clinic Near Me ● Abortion...
Abortion Clinic Pretoria ](+27832195400*)[ Abortion Clinic Near Me ● Abortion...Abortion Clinic Pretoria ](+27832195400*)[ Abortion Clinic Near Me ● Abortion...
Abortion Clinic Pretoria ](+27832195400*)[ Abortion Clinic Near Me ● Abortion...
 
From Theory to Practice: Utilizing SpiraPlan's REST API
From Theory to Practice: Utilizing SpiraPlan's REST APIFrom Theory to Practice: Utilizing SpiraPlan's REST API
From Theory to Practice: Utilizing SpiraPlan's REST API
 
CERVED e Neo4j su una nuvola, migrazione ed evoluzione di un grafo mission cr...
CERVED e Neo4j su una nuvola, migrazione ed evoluzione di un grafo mission cr...CERVED e Neo4j su una nuvola, migrazione ed evoluzione di un grafo mission cr...
CERVED e Neo4j su una nuvola, migrazione ed evoluzione di un grafo mission cr...
 
Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...
Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...
Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...
 
Workshop - Architecting Innovative Graph Applications- GraphSummit Milan
Workshop -  Architecting Innovative Graph Applications- GraphSummit MilanWorkshop -  Architecting Innovative Graph Applications- GraphSummit Milan
Workshop - Architecting Innovative Graph Applications- GraphSummit Milan
 
Abortion Pill Prices Turfloop ](+27832195400*)[ 🏥 Women's Abortion Clinic in ...
Abortion Pill Prices Turfloop ](+27832195400*)[ 🏥 Women's Abortion Clinic in ...Abortion Pill Prices Turfloop ](+27832195400*)[ 🏥 Women's Abortion Clinic in ...
Abortion Pill Prices Turfloop ](+27832195400*)[ 🏥 Women's Abortion Clinic in ...
 
Navigation in flutter – how to add stack, tab, and drawer navigators to your ...
Navigation in flutter – how to add stack, tab, and drawer navigators to your ...Navigation in flutter – how to add stack, tab, and drawer navigators to your ...
Navigation in flutter – how to add stack, tab, and drawer navigators to your ...
 
Community is Just as Important as Code by Andrea Goulet
Community is Just as Important as Code by Andrea GouletCommunity is Just as Important as Code by Andrea Goulet
Community is Just as Important as Code by Andrea Goulet
 
Alluxio Monthly Webinar | Simplify Data Access for AI in Multi-Cloud
Alluxio Monthly Webinar | Simplify Data Access for AI in Multi-CloudAlluxio Monthly Webinar | Simplify Data Access for AI in Multi-Cloud
Alluxio Monthly Webinar | Simplify Data Access for AI in Multi-Cloud
 
Test Automation Design Patterns_ A Comprehensive Guide.pdf
Test Automation Design Patterns_ A Comprehensive Guide.pdfTest Automation Design Patterns_ A Comprehensive Guide.pdf
Test Automation Design Patterns_ A Comprehensive Guide.pdf
 
Abortion Clinic In Pretoria ](+27832195400*)[ 🏥 Safe Abortion Pills in Pretor...
Abortion Clinic In Pretoria ](+27832195400*)[ 🏥 Safe Abortion Pills in Pretor...Abortion Clinic In Pretoria ](+27832195400*)[ 🏥 Safe Abortion Pills in Pretor...
Abortion Clinic In Pretoria ](+27832195400*)[ 🏥 Safe Abortion Pills in Pretor...
 
Anypoint Code Builder - Munich MuleSoft Meetup - 16th May 2024
Anypoint Code Builder - Munich MuleSoft Meetup - 16th May 2024Anypoint Code Builder - Munich MuleSoft Meetup - 16th May 2024
Anypoint Code Builder - Munich MuleSoft Meetup - 16th May 2024
 
Software Engineering - Introduction + Process Models + Requirements Engineering
Software Engineering - Introduction + Process Models + Requirements EngineeringSoftware Engineering - Introduction + Process Models + Requirements Engineering
Software Engineering - Introduction + Process Models + Requirements Engineering
 
Evolving Data Governance for the Real-time Streaming and AI Era
Evolving Data Governance for the Real-time Streaming and AI EraEvolving Data Governance for the Real-time Streaming and AI Era
Evolving Data Governance for the Real-time Streaming and AI Era
 
Wired_2.0_CREATE YOUR ULTIMATE LEARNING ENVIRONMENT_JCON_16052024
Wired_2.0_CREATE YOUR ULTIMATE LEARNING ENVIRONMENT_JCON_16052024Wired_2.0_CREATE YOUR ULTIMATE LEARNING ENVIRONMENT_JCON_16052024
Wired_2.0_CREATE YOUR ULTIMATE LEARNING ENVIRONMENT_JCON_16052024
 
COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...
COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...
COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...
 
Abortion Clinic In Johannesburg ](+27832195400*)[ 🏥 Safe Abortion Pills in Jo...
Abortion Clinic In Johannesburg ](+27832195400*)[ 🏥 Safe Abortion Pills in Jo...Abortion Clinic In Johannesburg ](+27832195400*)[ 🏥 Safe Abortion Pills in Jo...
Abortion Clinic In Johannesburg ](+27832195400*)[ 🏥 Safe Abortion Pills in Jo...
 
Lessons Learned from Building a Serverless Notifications System.pdf
Lessons Learned from Building a Serverless Notifications System.pdfLessons Learned from Building a Serverless Notifications System.pdf
Lessons Learned from Building a Serverless Notifications System.pdf
 
Automate your OpenSIPS config tests - OpenSIPS Summit 2024
Automate your OpenSIPS config tests - OpenSIPS Summit 2024Automate your OpenSIPS config tests - OpenSIPS Summit 2024
Automate your OpenSIPS config tests - OpenSIPS Summit 2024
 

How to migrate to Apex Enterprise Patterns?, David Fernandez

Editor's Notes

  1. 1 - Created by financial force Framework which supports implementation of various Martin Fowler design patterns, in 2014 Andy Fawcett adapted it to SF FFLIB Apex Mocks An Apex mocking framework for true unit testing in Salesforce, with Stub API support Based on the Java mocking framework Mockito FFLIB Apex Commons FFLIB frameworks are now maintained by the Apex Enterprise Patterns GitHub group 2 Complex code gets out of hand when you don’t partition it properly. When code is heavily intermixed, it becomes error prone, difficult to maintain, and hard to learn. Have you ever tried to debug someone's spaghetti code? And the problems get worse as you bring new developers into the party! Creating modules or libraries to share common calculations and processes among different parts of your application is often the first step in code reuse, which is, of course, a good thing! Each layer should have a single responsability 3. Dont Repeat Yourself 4.- Yes... and no. SOC requires some upfront thinking about the internal plumbing of your application, including class naming conventions and coding guidelines. You want this planning to endure and be somewhat self-describing to others. Good code should tell a story. The usual approach to code reuse is moving fragments of code around as soon as two or more areas need it. The code is often just placed in MyUtil classes or some other generic dumping area. Which is fine, and certainly recommended to copy and paste!
  2. Extend points
  3. Extend points