SlideShare a Scribd company logo
1
#CD22
Managing Complexity
Keep your software under control!
27.05.2022 1
2
#CD22
David Felkel
Founder of helpful bits
Software Architect
Programming since 1997
Salesforce since 2016
https://helpfulbits.com
27.05.2022
3
#CD22
Part 1- About Complexity
27.05.2022
4
#CD22
Complexity kills
• Budget
• Quality
• Engineers‘ Motivation
• Extensibility
• Customer Support
27.05.2022
5
#CD22
Complex software is like a jungle
27.05.2022
6
#CD22
Simple software is a garden
27.05.2022
7
#CD22
What is complexity in software?
A problem of state
27.05.2022
n The number of Latin squares of order n
1 1
2 2
3 12
4 576
5 161,280
6 812,851,200
7 61,479,419,904,000
8 108,776,032,459,082,956,800
9 5,524,751,496,156,892,842,531,225,600
10 9,982,437,658,213,039,871,725,064,756,920,320,000
11 776,966,836,171,770,144,107,444,346,734,230,682,311,065,600,000
1 2 3
2 3 1
3 1 2
8
#CD22
Where is the relation to software?
• Combinatorial explosions occur a lot in software
• Branches in Program Flow
• Possibles states of data increase with every new field
• Now suppose you‘ve got 4 picklists with 10 values each:
• 10.000 possible states of data
• Have you got 10.000 unit tests for that?
No? Shame on you, sloppy programmer!
27.05.2022
9
#CD22
Or a global variable for that matter …
Congrats, you can now multiply all already possible states of your
whole program!
You will win the award for the most stateful program!
And you better pray the next maintenance developer does not
know where you live! I suggest you leave the country!
27.05.2022
10
#CD22
What is complexity in software?
A problem of cognitive load
27.05.2022
11
#CD22
Where is the relation to software?
• The same things are named differently
• The same thing is being done differently
• Different things have the same name
• There‘s simply too much of the same thing in different flavors
• Communication Problems
27.05.2022
12
#CD22
What is complexity in software?
A problem of features
• People buy feature-rich software
• People want powerful software to fuel their processes
27.05.2022
13
#CD22
What is complexity in software?
A problem of premature optimization
“The real problem is that programmers have spent far too
much time worrying about efficiency in the wrong places
and at the wrong times; premature optimization is the
root of all evil (or at least most of it) in
programming”
(Donald Knuth, 1974)
Yet, we are often forced to do so in Salesforce. It worsens
the problem.
27.05.2022
14
#CD22
The solution: KISS – Keep IT simple and stupid
• Complex code is bad code
• Simple code is good code
• Simple code is not easy to write, it‘s easier to write complex
code
• Simple code with better modularization has less state than
complex code and makes you think less.
27.05.2022
15
#CD22
We‘ve known this since the 70s
• Structured Programming promoted by Djikstra
27.05.2022
How do we convince people that
in programming, simplicity and clarity –
in short: what mathematicians
call „elegance“ – are not a dispensable luxury,
but a crucial matter that decides between
success and failure?
16
#CD22
What is simple and maintainable code?
27.05.2022
17
#CD22
And how do we achieve less complexity?
• Boundaries!
• Divide & Conquer! Everywhere!
• Modularization!
• Encapsulation!
• True Object Orientation!
• Readable and clean code!
• Be close to your domain, no unecessary abstractions!
• Stupid code!
27.05.2022
18
#CD22
27.05.2022
19
#CD22
Part 2 – Practical solutions to complexity
problems
27.05.2022
20
#CD22
Fundamentals
• Establish Coding Conventions
• They teach your eyes and your mental parser
• Code will make you think less
• You can prevent errors with proper conventions
27.05.2022
21
#CD22
Fundamentals
• Establish a ubiqitous language
• Enable your business people and your programmers to understand
each other!
• Any business term should have a precise meaning and only that
meaning
• These terms should be found in the code
27.05.2022
22
#CD22
Fundamentals
• Clean Code
• Vast topic – I recommend Uncle Bob‘s book ‚Clean Code‘
• Don‘t make the maintenance programmer think
• Don‘t duplicate code
• Don‘t have methods more than a few lines and don‘t have more than 3
Arguments
• Etc. etc.
27.05.2022
Any fool can write code that a computer can understand.
Good programmers write code that humans can understand.”—Martin Fowler
23
#CD22
Fundamentals – clean code
27.05.2022
24
#CD22
Fundamentals – clean code
27.05.2022
25
#CD22
Fundamentals – clean code
27.05.2022
There are only two hard things in Computer Science: cache invalidation and naming things.
Phil Karlton
26
#CD22
Fundamentals
• S ingle Responsibility Principle
• O pen Closed Principle
• L iskov Substitution Principle
• I nterface Segregation Principle
• D ependency Inversion Principle
https://en.wikipedia.org/wiki/SOLID
27.05.2022
27
#CD22
Fundamentals
27.05.2022
28
#CD22
Fundamentals
• Use proper tools for the job
• 1st Rule is: DON‘T USE EVERYTHING IN YOUR SALESFORCE TOOLKIT
• 2nd Rule is: DON‘T USE EVERYTHING IN YOUR SALESFORCE TOOLKIT
• 3rd Rule is: Understand the tools you use
• Flows and Processes are hard to debug, yet accessible for non
programmers
• Good combinations:
• Pure Apex and LWC for complex domains
• LWC with flows for lots of step by step processes and wizards
• No Apex at all and just flows for simple domains
27.05.2022
29
#CD22
Fundamentals
• Key Success factor:
• Requirements Engineering: Know what you are up to, because the
client most likely won‘t pay for refactorings.
• Team Setup: Know your teams skills.
• Have the guts to say „no“ to the client
• If in doubt, use Apex and LWC, avoid Workflows and Processes.
A Flow here and there probably doesn‘t hurt.
• Workflows and processes are harder to debug and, together with rollup
summaries, cause triggers to fire a 2nd time, counting against your
limits.
27.05.2022
30
#CD22
Part 3 – Architecture primer
27.05.2022
31
#CD22
Architecture Fundamentals
• The Layer Architecture (aka n-Tier architecture)
• Clear separation between Persistence, Business Logic and UI
27.05.2022
Only call down, never call up!
32
#CD22
Architecture Fundamentals
• There‘s fflib:
https://github.com/apex-enterprise-patterns/fflib-apex-common
https://trailhead.salesforce.com/en/content/learn/modules/apex_patterns_d
sl
• I consider it too heavy weight but you might like it.
• Architecture is more a pattern than a library, you can roll your
own.
27.05.2022
33
#CD22
Architecture Fundamentals – Business Logic
• API Layer
• Well defined API for a Business Domain
• Encapsulates the actions your business really does
• Properly published via Facade Pattern
• Done properly, you won‘t have to bulkify (or at least loop) much
anymore
• Can avoid „Trigger cascades“ if done right
27.05.2022
34
#CD22
Architecture Fundamentals – Data Access
• The lazy Repository (aka Kazlovich Repository)
• Is initialized with all IDs necessary
• Only fetches records or relations when actually accessed
• Uses mainly one big query to fetch as much data as possible in a single
database call
• Great in avoiding complexity and limits!
27.05.2022
35
#CD22
Architecture Fundamentals – Presentation
• LWC or Visual Force
• Avoid Aura for its complexity and lack of readability is its meat and
bones
• Don‘t write business logic in your code, rather call Backend methods
• The UI should only care about presentation logic and not much about
the business process, apart from visualizing it!
• No Javascript business logic algorithms!
• Patterns used in other technologies: MVC, MVVM, MVP
27.05.2022
36
#CD22
Architecture Fundamentals – DDD
• Define module boundaries in your requirements
27.05.2022
Done right, any domain will fit into a salesforce
Package and not depend on others
37
#CD22
Why is this so important?
• Proper architecture means proper divide and conquer
• Proper divide and conquer = less complexity
• Proper decoupling = less complexity and even more
flexibility
• Properly architected, well defined interfaces and
decoupled modules emerge naturally
27.05.2022
38
#CD22
Summary
• How does this solve Salesforce problems technically?
• You can avoid limits
• You can even avoid the need for bulkification
• Your code is more clean and concise
• Your code is easier to maintain, more flexible
• Your code is more easily extensible
• Your code is easier to deploy
27.05.2022
39
#CD22
Summary
• How does this solve Salesforce problems organizationally?
• Quick changes
• Less bugs
• Multiproject Management
• Clear separation of organizational responsibilities
• But: It‘s not easy getting there. Proper conventions and
guidelines have to be created. Any building block must confirm
to your standards.
27.05.2022
40
#CD22
27.05.2022
41
#CD22
27.05.2022
Thank you!
#CD22

More Related Content

Similar to Managing Complexity in Salesforce, David Felkel

Code quality and its business value, Nikita Belov
Code quality and its business value, Nikita BelovCode quality and its business value, Nikita Belov
Code quality and its business value, Nikita Belov
CzechDreamin
 
DOES16 London - Jonathan Fletcher - Re-imagining Hiscox IT: A DevOps Story
DOES16 London - Jonathan Fletcher - Re-imagining Hiscox IT: A DevOps StoryDOES16 London - Jonathan Fletcher - Re-imagining Hiscox IT: A DevOps Story
DOES16 London - Jonathan Fletcher - Re-imagining Hiscox IT: A DevOps Story
Gene Kim
 
Delivering Fantastic Brand Experiences With Low-Code
Delivering Fantastic Brand Experiences With Low-CodeDelivering Fantastic Brand Experiences With Low-Code
Delivering Fantastic Brand Experiences With Low-Code
Cyber-Duck
 
Technical Debt.pptx
Technical Debt.pptxTechnical Debt.pptx
Technical Debt.pptx
Atish Narlawar
 
A modern architecturereview–usingcodereviewtools-ver-3.5
A modern architecturereview–usingcodereviewtools-ver-3.5A modern architecturereview–usingcodereviewtools-ver-3.5
A modern architecturereview–usingcodereviewtools-ver-3.5
SSW
 
Watching the Clouds: Challenges with Monitoring Hybrid Cloud Environments
Watching the Clouds: Challenges with Monitoring Hybrid Cloud EnvironmentsWatching the Clouds: Challenges with Monitoring Hybrid Cloud Environments
Watching the Clouds: Challenges with Monitoring Hybrid Cloud Environments
Blue Medora
 
Agile & Test Driven Development: The Ampersand Commerce Approach
Agile & Test Driven Development: The Ampersand Commerce ApproachAgile & Test Driven Development: The Ampersand Commerce Approach
Agile & Test Driven Development: The Ampersand Commerce Approach
Ampersand
 
[DN Scrum Breakfast] Effective Cloud Computing
[DN Scrum Breakfast] Effective Cloud Computing[DN Scrum Breakfast] Effective Cloud Computing
[DN Scrum Breakfast] Effective Cloud Computing
Scrum Breakfast Vietnam
 
Death by Technical Debt: Lessons Learned to Get you Unbuired
Death by Technical Debt: Lessons Learned to Get you UnbuiredDeath by Technical Debt: Lessons Learned to Get you Unbuired
Death by Technical Debt: Lessons Learned to Get you Unbuired
TechnologyAssociationOregon
 
Career Path Planning
Career Path PlanningCareer Path Planning
Career Path Planning
Stephen Elbourn
 
IT Architecture and Architects
IT Architecture and ArchitectsIT Architecture and Architects
IT Architecture and Architects
AndreDovgal1
 
FEA_basics.pdf
FEA_basics.pdfFEA_basics.pdf
FEA_basics.pdf
CMR University
 
Go for Operations
Go for OperationsGo for Operations
Go for Operations
QAware GmbH
 
Technical debt management strategies
Technical debt management strategiesTechnical debt management strategies
Technical debt management strategies
Raquel Pau
 
Operational Costs of Technical Debt
Operational Costs of Technical DebtOperational Costs of Technical Debt
Operational Costs of Technical Debt
Kurt Andersen
 
Introduction to TDD and BDD
Introduction to TDD and BDDIntroduction to TDD and BDD
Introduction to TDD and BDD
Luis García Castro
 
Don't Drop ACID (July 2021)
Don't Drop ACID (July 2021)Don't Drop ACID (July 2021)
Don't Drop ACID (July 2021)
Matthew Groves
 
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
CzechDreamin
 
Anti patterns part 2
Anti patterns part 2Anti patterns part 2
Anti patterns part 2
Return on Intelligence
 
MongoDB World 2019: Building Flexible and Secure Customer Applications with M...
MongoDB World 2019: Building Flexible and Secure Customer Applications with M...MongoDB World 2019: Building Flexible and Secure Customer Applications with M...
MongoDB World 2019: Building Flexible and Secure Customer Applications with M...
MongoDB
 

Similar to Managing Complexity in Salesforce, David Felkel (20)

Code quality and its business value, Nikita Belov
Code quality and its business value, Nikita BelovCode quality and its business value, Nikita Belov
Code quality and its business value, Nikita Belov
 
DOES16 London - Jonathan Fletcher - Re-imagining Hiscox IT: A DevOps Story
DOES16 London - Jonathan Fletcher - Re-imagining Hiscox IT: A DevOps StoryDOES16 London - Jonathan Fletcher - Re-imagining Hiscox IT: A DevOps Story
DOES16 London - Jonathan Fletcher - Re-imagining Hiscox IT: A DevOps Story
 
Delivering Fantastic Brand Experiences With Low-Code
Delivering Fantastic Brand Experiences With Low-CodeDelivering Fantastic Brand Experiences With Low-Code
Delivering Fantastic Brand Experiences With Low-Code
 
Technical Debt.pptx
Technical Debt.pptxTechnical Debt.pptx
Technical Debt.pptx
 
A modern architecturereview–usingcodereviewtools-ver-3.5
A modern architecturereview–usingcodereviewtools-ver-3.5A modern architecturereview–usingcodereviewtools-ver-3.5
A modern architecturereview–usingcodereviewtools-ver-3.5
 
Watching the Clouds: Challenges with Monitoring Hybrid Cloud Environments
Watching the Clouds: Challenges with Monitoring Hybrid Cloud EnvironmentsWatching the Clouds: Challenges with Monitoring Hybrid Cloud Environments
Watching the Clouds: Challenges with Monitoring Hybrid Cloud Environments
 
Agile & Test Driven Development: The Ampersand Commerce Approach
Agile & Test Driven Development: The Ampersand Commerce ApproachAgile & Test Driven Development: The Ampersand Commerce Approach
Agile & Test Driven Development: The Ampersand Commerce Approach
 
[DN Scrum Breakfast] Effective Cloud Computing
[DN Scrum Breakfast] Effective Cloud Computing[DN Scrum Breakfast] Effective Cloud Computing
[DN Scrum Breakfast] Effective Cloud Computing
 
Death by Technical Debt: Lessons Learned to Get you Unbuired
Death by Technical Debt: Lessons Learned to Get you UnbuiredDeath by Technical Debt: Lessons Learned to Get you Unbuired
Death by Technical Debt: Lessons Learned to Get you Unbuired
 
Career Path Planning
Career Path PlanningCareer Path Planning
Career Path Planning
 
IT Architecture and Architects
IT Architecture and ArchitectsIT Architecture and Architects
IT Architecture and Architects
 
FEA_basics.pdf
FEA_basics.pdfFEA_basics.pdf
FEA_basics.pdf
 
Go for Operations
Go for OperationsGo for Operations
Go for Operations
 
Technical debt management strategies
Technical debt management strategiesTechnical debt management strategies
Technical debt management strategies
 
Operational Costs of Technical Debt
Operational Costs of Technical DebtOperational Costs of Technical Debt
Operational Costs of Technical Debt
 
Introduction to TDD and BDD
Introduction to TDD and BDDIntroduction to TDD and BDD
Introduction to TDD and BDD
 
Don't Drop ACID (July 2021)
Don't Drop ACID (July 2021)Don't Drop ACID (July 2021)
Don't Drop ACID (July 2021)
 
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
 
Anti patterns part 2
Anti patterns part 2Anti patterns part 2
Anti patterns part 2
 
MongoDB World 2019: Building Flexible and Secure Customer Applications with M...
MongoDB World 2019: Building Flexible and Secure Customer Applications with M...MongoDB World 2019: Building Flexible and Secure Customer Applications with M...
MongoDB World 2019: Building Flexible and Secure Customer Applications with M...
 

More from CzechDreamin

10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka Doktorová10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka Doktorová
CzechDreamin
 
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
CzechDreamin
 
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
CzechDreamin
 
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone KomSalesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
CzechDreamin
 
Powerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara LaskowskaPowerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara Laskowska
CzechDreamin
 
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi IbrahimzadeFree and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
CzechDreamin
 
AI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří KarpíšekAI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří Karpíšek
CzechDreamin
 
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya HalderCustom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
CzechDreamin
 
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
CzechDreamin
 
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...
CzechDreamin
 
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 ...
CzechDreamin
 
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...
CzechDreamin
 
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...
CzechDreamin
 
Architecting for Analytics, Aaron Crear
Architecting for Analytics, Aaron CrearArchitecting for Analytics, Aaron Crear
Architecting for Analytics, Aaron Crear
CzechDreamin
 
Ape to API, Filip Dousek
Ape to API, Filip DousekApe to API, Filip Dousek
Ape to API, Filip Dousek
CzechDreamin
 
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
CzechDreamin
 
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...
CzechDreamin
 
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
CzechDreamin
 
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...
CzechDreamin
 
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...
CzechDreamin
 

More from CzechDreamin (20)

10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka Doktorová10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka Doktorová
 
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
 
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
 
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone KomSalesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
 
Powerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara LaskowskaPowerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara Laskowska
 
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi IbrahimzadeFree and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
 
AI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří KarpíšekAI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří Karpíšek
 
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya HalderCustom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
 
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
 
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 ...
 
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...
 
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...
 

Recently uploaded

May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
Adele Miller
 
Empowering Growth with Best Software Development Company in Noida - Deuglo
Empowering Growth with Best Software  Development Company in Noida - DeugloEmpowering Growth with Best Software  Development Company in Noida - Deuglo
Empowering Growth with Best Software Development Company in Noida - Deuglo
Deuglo Infosystem Pvt Ltd
 
BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
Ortus Solutions, Corp
 
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteAI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
Google
 
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissancesAtelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Neo4j
 
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeA Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
Aftab Hussain
 
AI Genie Review: World’s First Open AI WordPress Website Creator
AI Genie Review: World’s First Open AI WordPress Website CreatorAI Genie Review: World’s First Open AI WordPress Website Creator
AI Genie Review: World’s First Open AI WordPress Website Creator
Google
 
Game Development with Unity3D (Game Development lecture 3)
Game Development  with Unity3D (Game Development lecture 3)Game Development  with Unity3D (Game Development lecture 3)
Game Development with Unity3D (Game Development lecture 3)
abdulrafaychaudhry
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
Drona Infotech
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Łukasz Chruściel
 
First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
Globus
 
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptxText-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
ShamsuddeenMuhammadA
 
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Crescat
 
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
XfilesPro
 
Nidhi Software Price. Fact , Costs, Tips
Nidhi Software Price. Fact , Costs, TipsNidhi Software Price. Fact , Costs, Tips
Nidhi Software Price. Fact , Costs, Tips
vrstrong314
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOMLORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
lorraineandreiamcidl
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
Juraj Vysvader
 
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket ManagementUtilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
Max Andersen
 

Recently uploaded (20)

May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
 
Empowering Growth with Best Software Development Company in Noida - Deuglo
Empowering Growth with Best Software  Development Company in Noida - DeugloEmpowering Growth with Best Software  Development Company in Noida - Deuglo
Empowering Growth with Best Software Development Company in Noida - Deuglo
 
BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
 
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteAI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
 
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissancesAtelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissances
 
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeA Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
 
AI Genie Review: World’s First Open AI WordPress Website Creator
AI Genie Review: World’s First Open AI WordPress Website CreatorAI Genie Review: World’s First Open AI WordPress Website Creator
AI Genie Review: World’s First Open AI WordPress Website Creator
 
Game Development with Unity3D (Game Development lecture 3)
Game Development  with Unity3D (Game Development lecture 3)Game Development  with Unity3D (Game Development lecture 3)
Game Development with Unity3D (Game Development lecture 3)
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
 
First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
 
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptxText-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
 
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
 
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
 
Nidhi Software Price. Fact , Costs, Tips
Nidhi Software Price. Fact , Costs, TipsNidhi Software Price. Fact , Costs, Tips
Nidhi Software Price. Fact , Costs, Tips
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOMLORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
 
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket ManagementUtilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
 

Managing Complexity in Salesforce, David Felkel

  • 1. 1 #CD22 Managing Complexity Keep your software under control! 27.05.2022 1
  • 2. 2 #CD22 David Felkel Founder of helpful bits Software Architect Programming since 1997 Salesforce since 2016 https://helpfulbits.com 27.05.2022
  • 3. 3 #CD22 Part 1- About Complexity 27.05.2022
  • 4. 4 #CD22 Complexity kills • Budget • Quality • Engineers‘ Motivation • Extensibility • Customer Support 27.05.2022
  • 5. 5 #CD22 Complex software is like a jungle 27.05.2022
  • 6. 6 #CD22 Simple software is a garden 27.05.2022
  • 7. 7 #CD22 What is complexity in software? A problem of state 27.05.2022 n The number of Latin squares of order n 1 1 2 2 3 12 4 576 5 161,280 6 812,851,200 7 61,479,419,904,000 8 108,776,032,459,082,956,800 9 5,524,751,496,156,892,842,531,225,600 10 9,982,437,658,213,039,871,725,064,756,920,320,000 11 776,966,836,171,770,144,107,444,346,734,230,682,311,065,600,000 1 2 3 2 3 1 3 1 2
  • 8. 8 #CD22 Where is the relation to software? • Combinatorial explosions occur a lot in software • Branches in Program Flow • Possibles states of data increase with every new field • Now suppose you‘ve got 4 picklists with 10 values each: • 10.000 possible states of data • Have you got 10.000 unit tests for that? No? Shame on you, sloppy programmer! 27.05.2022
  • 9. 9 #CD22 Or a global variable for that matter … Congrats, you can now multiply all already possible states of your whole program! You will win the award for the most stateful program! And you better pray the next maintenance developer does not know where you live! I suggest you leave the country! 27.05.2022
  • 10. 10 #CD22 What is complexity in software? A problem of cognitive load 27.05.2022
  • 11. 11 #CD22 Where is the relation to software? • The same things are named differently • The same thing is being done differently • Different things have the same name • There‘s simply too much of the same thing in different flavors • Communication Problems 27.05.2022
  • 12. 12 #CD22 What is complexity in software? A problem of features • People buy feature-rich software • People want powerful software to fuel their processes 27.05.2022
  • 13. 13 #CD22 What is complexity in software? A problem of premature optimization “The real problem is that programmers have spent far too much time worrying about efficiency in the wrong places and at the wrong times; premature optimization is the root of all evil (or at least most of it) in programming” (Donald Knuth, 1974) Yet, we are often forced to do so in Salesforce. It worsens the problem. 27.05.2022
  • 14. 14 #CD22 The solution: KISS – Keep IT simple and stupid • Complex code is bad code • Simple code is good code • Simple code is not easy to write, it‘s easier to write complex code • Simple code with better modularization has less state than complex code and makes you think less. 27.05.2022
  • 15. 15 #CD22 We‘ve known this since the 70s • Structured Programming promoted by Djikstra 27.05.2022 How do we convince people that in programming, simplicity and clarity – in short: what mathematicians call „elegance“ – are not a dispensable luxury, but a crucial matter that decides between success and failure?
  • 16. 16 #CD22 What is simple and maintainable code? 27.05.2022
  • 17. 17 #CD22 And how do we achieve less complexity? • Boundaries! • Divide & Conquer! Everywhere! • Modularization! • Encapsulation! • True Object Orientation! • Readable and clean code! • Be close to your domain, no unecessary abstractions! • Stupid code! 27.05.2022
  • 19. 19 #CD22 Part 2 – Practical solutions to complexity problems 27.05.2022
  • 20. 20 #CD22 Fundamentals • Establish Coding Conventions • They teach your eyes and your mental parser • Code will make you think less • You can prevent errors with proper conventions 27.05.2022
  • 21. 21 #CD22 Fundamentals • Establish a ubiqitous language • Enable your business people and your programmers to understand each other! • Any business term should have a precise meaning and only that meaning • These terms should be found in the code 27.05.2022
  • 22. 22 #CD22 Fundamentals • Clean Code • Vast topic – I recommend Uncle Bob‘s book ‚Clean Code‘ • Don‘t make the maintenance programmer think • Don‘t duplicate code • Don‘t have methods more than a few lines and don‘t have more than 3 Arguments • Etc. etc. 27.05.2022 Any fool can write code that a computer can understand. Good programmers write code that humans can understand.”—Martin Fowler
  • 25. 25 #CD22 Fundamentals – clean code 27.05.2022 There are only two hard things in Computer Science: cache invalidation and naming things. Phil Karlton
  • 26. 26 #CD22 Fundamentals • S ingle Responsibility Principle • O pen Closed Principle • L iskov Substitution Principle • I nterface Segregation Principle • D ependency Inversion Principle https://en.wikipedia.org/wiki/SOLID 27.05.2022
  • 28. 28 #CD22 Fundamentals • Use proper tools for the job • 1st Rule is: DON‘T USE EVERYTHING IN YOUR SALESFORCE TOOLKIT • 2nd Rule is: DON‘T USE EVERYTHING IN YOUR SALESFORCE TOOLKIT • 3rd Rule is: Understand the tools you use • Flows and Processes are hard to debug, yet accessible for non programmers • Good combinations: • Pure Apex and LWC for complex domains • LWC with flows for lots of step by step processes and wizards • No Apex at all and just flows for simple domains 27.05.2022
  • 29. 29 #CD22 Fundamentals • Key Success factor: • Requirements Engineering: Know what you are up to, because the client most likely won‘t pay for refactorings. • Team Setup: Know your teams skills. • Have the guts to say „no“ to the client • If in doubt, use Apex and LWC, avoid Workflows and Processes. A Flow here and there probably doesn‘t hurt. • Workflows and processes are harder to debug and, together with rollup summaries, cause triggers to fire a 2nd time, counting against your limits. 27.05.2022
  • 30. 30 #CD22 Part 3 – Architecture primer 27.05.2022
  • 31. 31 #CD22 Architecture Fundamentals • The Layer Architecture (aka n-Tier architecture) • Clear separation between Persistence, Business Logic and UI 27.05.2022 Only call down, never call up!
  • 32. 32 #CD22 Architecture Fundamentals • There‘s fflib: https://github.com/apex-enterprise-patterns/fflib-apex-common https://trailhead.salesforce.com/en/content/learn/modules/apex_patterns_d sl • I consider it too heavy weight but you might like it. • Architecture is more a pattern than a library, you can roll your own. 27.05.2022
  • 33. 33 #CD22 Architecture Fundamentals – Business Logic • API Layer • Well defined API for a Business Domain • Encapsulates the actions your business really does • Properly published via Facade Pattern • Done properly, you won‘t have to bulkify (or at least loop) much anymore • Can avoid „Trigger cascades“ if done right 27.05.2022
  • 34. 34 #CD22 Architecture Fundamentals – Data Access • The lazy Repository (aka Kazlovich Repository) • Is initialized with all IDs necessary • Only fetches records or relations when actually accessed • Uses mainly one big query to fetch as much data as possible in a single database call • Great in avoiding complexity and limits! 27.05.2022
  • 35. 35 #CD22 Architecture Fundamentals – Presentation • LWC or Visual Force • Avoid Aura for its complexity and lack of readability is its meat and bones • Don‘t write business logic in your code, rather call Backend methods • The UI should only care about presentation logic and not much about the business process, apart from visualizing it! • No Javascript business logic algorithms! • Patterns used in other technologies: MVC, MVVM, MVP 27.05.2022
  • 36. 36 #CD22 Architecture Fundamentals – DDD • Define module boundaries in your requirements 27.05.2022 Done right, any domain will fit into a salesforce Package and not depend on others
  • 37. 37 #CD22 Why is this so important? • Proper architecture means proper divide and conquer • Proper divide and conquer = less complexity • Proper decoupling = less complexity and even more flexibility • Properly architected, well defined interfaces and decoupled modules emerge naturally 27.05.2022
  • 38. 38 #CD22 Summary • How does this solve Salesforce problems technically? • You can avoid limits • You can even avoid the need for bulkification • Your code is more clean and concise • Your code is easier to maintain, more flexible • Your code is more easily extensible • Your code is easier to deploy 27.05.2022
  • 39. 39 #CD22 Summary • How does this solve Salesforce problems organizationally? • Quick changes • Less bugs • Multiproject Management • Clear separation of organizational responsibilities • But: It‘s not easy getting there. Proper conventions and guidelines have to be created. Any building block must confirm to your standards. 27.05.2022