SlideShare a Scribd company logo
Shorten Your Development Time
with An Extensible Design for Apex!
(NOT a Uni-tasker!)
Robert Nunemaker, Citrix Systems Inc., Senior Systems Architect
Safe harbor
Safe harbor statement under the Private Securities Litigation Reform Act of 1995:
This presentation may contain forward-looking statements that involve risks, uncertainties, and assumptions. If any such uncertainties
materialize or if any of the assumptions proves incorrect, the results of salesforce.com, inc. could differ materially from the results
expressed or implied by the forward-looking statements we make. All statements other than statements of historical fact could be
deemed forward-looking, including any projections of product or service availability, subscriber growth, earnings, revenues, or other
financial items and any statements regarding strategies or plans of management for future operations, statements of belief, any
statements concerning new, planned, or upgraded services or technology developments and customer contracts or use of our services.
The risks and uncertainties referred to above include – but are not limited to – risks associated with developing and delivering new
functionality for our service, new products and services, our new business model, our past operating losses, possible fluctuations in our
operating results and rate of growth, interruptions or delays in our Web hosting, breach of our security measures, the outcome of any
litigation, risks associated with completed and any possible mergers and acquisitions, the immature market in which we operate, our
relatively limited operating history, our ability to expand, retain, and motivate our employees and manage our growth, new releases of our
service and successful customer deployment, our limited history reselling non-salesforce.com products, and utilization and selling to
larger enterprise customers. Further information on potential factors that could affect the financial results of salesforce.com, inc. is
included in our annual report on Form 10-K for the most recent fiscal year and in our quarterly report on Form 10-Q for the most recent
fiscal quarter. These documents and others containing important disclosures are available on the SEC Filings section of the Investor
Information section of our Web site.
Any unreleased services or features referenced in this or other presentations, press releases or public statements are not currently
available and may not be delivered on time or at all. Customers who purchase our services should make the purchase decisions
based upon features that are currently available. Salesforce.com, inc. assumes no obligation and does not intend to update these
forward-looking statements.
Robert J Nunemaker
Senior Systems Architect
Ask Yourself
• How many of you have triggers and/or classes that have hundreds of
lines?
• How many have had to spend hours reverse engineering code just to find
where something occurs, its dependencies, and how to change it?
• How many don’t code, but wish they could know what is going on inside
the multiple triggers?
• Why can’t we get contractors/new hires to code consistently?
Objectives
• Provide another flexible tool for your Apex Development
• Provoke thought into standard patterns (or free-style) that don’t take shared resources into
account.
• Provide a pattern that managers, analysts, and developers alike can benefit from.
• Advantages:
o Scales VERY well.
o VERY readable and easy to maintain.
o VERY modular and a single point of DML and Error handling.
o Limits reverse engineering and regression testing.
The Design!
• What IS EDA?
o Event, Dispatch, Action
o Learn the parable of the Plumber!
• Error Handling Benefits
o One place of handling; no need to handle again.
o DML for other objects rolled back to requesting object.
The Design!
Let’s look an example trigger for a custom object called Account_Segmentation__c using Eclipse.
The Design! (Enhancement)
• When an Account Segmentation is Deleted, we need to update all linking Account Segmentation fields to be initialized
to NULL.
• How? EASY!
o Create your Service method first to update Accounts as necessary. Notice how you can concentrate on the task;
not the “hooks”.
o BUT, those updates are to be put into the sObject LIST for update by the Dispatcher (already coded!).
o Don’t forget your errorMAP population.
o Finally add your small code fragment in your Dispatch Action method:

o DONE!
The Design!
• Considerations
o Script statements limits are now effectively removed in Winter ’14.
o Modularization of functionality.
o Other patterns can be used in the Service (Action).
o @Future must still be done in Service.
o Test class considerations (bPreventRecursion).
• Non-Developer Benefits
o No need to read code; just look at Dispatcher Action methods.
o After initial development, enhancements much faster.
o Regression testing easier and sometimes not necessary!
• Snippets in Eclipse!
Final Thoughts
• Hopefully you’ve seen how this pattern can benefit stability, scale, maintainability, and
development velocity.
o Ask yourself – Where can you benefit?
• It can be used by developers, analysts, and management to aid them in clarity and future
development needs.
• Even if you don’t use it as shown, maybe it will lead you to some ideas of how to make yourself
more scalable or efficient.
• Most important, does it help you provide better velocity in your enhancements to your customers?
• Chatter posting will include the code, including enhancement code, and instructions on how to
create your own Snippets for Eclipse!
Shorten Your Development Time with an Extensible Design for Apex
Shorten Your Development Time with an Extensible Design for Apex

More Related Content

PDF
The Apex Ten Commandments
PPTX
Salesforce Meetup 18 April 2015 - Apex Trigger & Scheduler Framworks
PPTX
Triggers for Admins: A Five-step Framework for Creating Triggers
PPTX
Deep Dive into Apex Triggers
PPT
Apex Trigger Debugging: Solving the Hard Problems
PDF
A differnt Type of Supermarket Delivery
PPTX
How to Go Codeless for Automated Mobile App Testing
PDF
Managing Your Batch and Scheduled Apex Processes with Relax
The Apex Ten Commandments
Salesforce Meetup 18 April 2015 - Apex Trigger & Scheduler Framworks
Triggers for Admins: A Five-step Framework for Creating Triggers
Deep Dive into Apex Triggers
Apex Trigger Debugging: Solving the Hard Problems
A differnt Type of Supermarket Delivery
How to Go Codeless for Automated Mobile App Testing
Managing Your Batch and Scheduled Apex Processes with Relax

What's hot (20)

PPTX
AMC Networks Experiments Faster on the Server Side
PDF
Using Prototypes to Validate Product Strategy - Product Camp DC Presentation ...
PPTX
Episode 12 - Basics of Trigger
PDF
The What, Why and How of Analytics Testing
PPTX
Building Test Automations the agile way
ODP
Data-Driven Software Design
PDF
Enabling CD in Enterprises with Testing
PDF
Shift Up
PPTX
Continuous business goal validation
PPTX
Beyond DevOps - How Netflix Bridges the Gap
PDF
You Can't be Agile When you are Knee Deep in Mud
PDF
Why software projects fail in 2021?
PPTX
Optimizely NYC Developer Meetup - Experimentation at Blue Apron
PDF
Tdd2018 state of the software quality in Germany
PPTX
Best Practices for a Repeatable Shift-Left Commitment
PDF
Prototyping for Business Outcomes at ModevUX
PDF
iOS Testing With Appium at Gilt
PPTX
HPE | Network Virtualization | POC
PPTX
Developer Night Opticon 2017
PDF
Rasa Developer Summit - Tom Bocklisch, Rasa - Product Updates from Rasa
AMC Networks Experiments Faster on the Server Side
Using Prototypes to Validate Product Strategy - Product Camp DC Presentation ...
Episode 12 - Basics of Trigger
The What, Why and How of Analytics Testing
Building Test Automations the agile way
Data-Driven Software Design
Enabling CD in Enterprises with Testing
Shift Up
Continuous business goal validation
Beyond DevOps - How Netflix Bridges the Gap
You Can't be Agile When you are Knee Deep in Mud
Why software projects fail in 2021?
Optimizely NYC Developer Meetup - Experimentation at Blue Apron
Tdd2018 state of the software quality in Germany
Best Practices for a Repeatable Shift-Left Commitment
Prototyping for Business Outcomes at ModevUX
iOS Testing With Appium at Gilt
HPE | Network Virtualization | POC
Developer Night Opticon 2017
Rasa Developer Summit - Tom Bocklisch, Rasa - Product Updates from Rasa
Ad

Similar to Shorten Your Development Time with an Extensible Design for Apex (20)

PDF
Design Patterns for Asynchronous Apex
PDF
Design Patterns: ISV Recipes for Success (Dreamforce 2015)
PPT
Salesforce Integration
PPTX
Bridging the Gap between Clicks & Code
PDF
Manage Development in Your Org with Salesforce Governance Framework
PPTX
Force.com Friday : Intro to Apex
PDF
Enterprise Integration - Solution Patterns From the Field
PPTX
CCT London 2013 Theatre Intro to Apex
PPTX
Architecting in the Cloud: Choosing the Right Technologies for your Solution
PDF
Design Patterns Every ISV Needs to Know (October 15, 2014)
PPTX
Salesforce – Proven Platform Development with DevOps & Agile
PDF
Extracting Microservices from your Monolithic org - Strategies and Tactics
PDF
Twin Cities Salesforce.com Developer User Group Presentation April 2012
PDF
Just-In-Time Sharing Using Apex
PPTX
Finding Security Issues Fast!
PPTX
Maintaining a-healthy-architecture-in-sf
PPT
Dreamforce 2008 : Behind-the-Scenes @ Salesforce.com R&D: How We Deliver 3 Ma...
PPTX
Successfully Scaling an Agile Innovation Culture with Perforce - 2011 Perforc...
PDF
How To Staff for Salesforce Innovation
PDF
Introduction to Apex Triggers
Design Patterns for Asynchronous Apex
Design Patterns: ISV Recipes for Success (Dreamforce 2015)
Salesforce Integration
Bridging the Gap between Clicks & Code
Manage Development in Your Org with Salesforce Governance Framework
Force.com Friday : Intro to Apex
Enterprise Integration - Solution Patterns From the Field
CCT London 2013 Theatre Intro to Apex
Architecting in the Cloud: Choosing the Right Technologies for your Solution
Design Patterns Every ISV Needs to Know (October 15, 2014)
Salesforce – Proven Platform Development with DevOps & Agile
Extracting Microservices from your Monolithic org - Strategies and Tactics
Twin Cities Salesforce.com Developer User Group Presentation April 2012
Just-In-Time Sharing Using Apex
Finding Security Issues Fast!
Maintaining a-healthy-architecture-in-sf
Dreamforce 2008 : Behind-the-Scenes @ Salesforce.com R&D: How We Deliver 3 Ma...
Successfully Scaling an Agile Innovation Culture with Perforce - 2011 Perforc...
How To Staff for Salesforce Innovation
Introduction to Apex Triggers
Ad

More from Salesforce Developers (20)

PDF
Sample Gallery: Reference Code and Best Practices for Salesforce Developers
PDF
Maximizing Salesforce Lightning Experience and Lightning Component Performance
PDF
Local development with Open Source Base Components
PPTX
TrailheaDX India : Developer Highlights
PDF
Why developers shouldn’t miss TrailheaDX India
PPTX
CodeLive: Build Lightning Web Components faster with Local Development
PPTX
CodeLive: Converting Aura Components to Lightning Web Components
PPTX
Enterprise-grade UI with open source Lightning Web Components
PPTX
TrailheaDX and Summer '19: Developer Highlights
PDF
Live coding with LWC
PDF
Lightning web components - Episode 4 : Security and Testing
PDF
LWC Episode 3- Component Communication and Aura Interoperability
PDF
Lightning web components episode 2- work with salesforce data
PDF
Lightning web components - Episode 1 - An Introduction
PDF
Migrating CPQ to Advanced Calculator and JSQCP
PDF
Scale with Large Data Volumes and Big Objects in Salesforce
PDF
Replicate Salesforce Data in Real Time with Change Data Capture
PDF
Modern Development with Salesforce DX
PDF
Get Into Lightning Flow Development
PDF
Integrate CMS Content Into Lightning Communities with CMS Connect
Sample Gallery: Reference Code and Best Practices for Salesforce Developers
Maximizing Salesforce Lightning Experience and Lightning Component Performance
Local development with Open Source Base Components
TrailheaDX India : Developer Highlights
Why developers shouldn’t miss TrailheaDX India
CodeLive: Build Lightning Web Components faster with Local Development
CodeLive: Converting Aura Components to Lightning Web Components
Enterprise-grade UI with open source Lightning Web Components
TrailheaDX and Summer '19: Developer Highlights
Live coding with LWC
Lightning web components - Episode 4 : Security and Testing
LWC Episode 3- Component Communication and Aura Interoperability
Lightning web components episode 2- work with salesforce data
Lightning web components - Episode 1 - An Introduction
Migrating CPQ to Advanced Calculator and JSQCP
Scale with Large Data Volumes and Big Objects in Salesforce
Replicate Salesforce Data in Real Time with Change Data Capture
Modern Development with Salesforce DX
Get Into Lightning Flow Development
Integrate CMS Content Into Lightning Communities with CMS Connect

Recently uploaded (20)

PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
Spectroscopy.pptx food analysis technology
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PPTX
Big Data Technologies - Introduction.pptx
PDF
Encapsulation theory and applications.pdf
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Empathic Computing: Creating Shared Understanding
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
cuic standard and advanced reporting.pdf
Spectral efficient network and resource selection model in 5G networks
Diabetes mellitus diagnosis method based random forest with bat algorithm
Spectroscopy.pptx food analysis technology
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Chapter 3 Spatial Domain Image Processing.pdf
Network Security Unit 5.pdf for BCA BBA.
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
“AI and Expert System Decision Support & Business Intelligence Systems”
Big Data Technologies - Introduction.pptx
Encapsulation theory and applications.pdf
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
The Rise and Fall of 3GPP – Time for a Sabbatical?
Empathic Computing: Creating Shared Understanding
MYSQL Presentation for SQL database connectivity
Mobile App Security Testing_ A Comprehensive Guide.pdf
Unlocking AI with Model Context Protocol (MCP)
cuic standard and advanced reporting.pdf

Shorten Your Development Time with an Extensible Design for Apex

  • 1. Shorten Your Development Time with An Extensible Design for Apex! (NOT a Uni-tasker!) Robert Nunemaker, Citrix Systems Inc., Senior Systems Architect
  • 2. Safe harbor Safe harbor statement under the Private Securities Litigation Reform Act of 1995: This presentation may contain forward-looking statements that involve risks, uncertainties, and assumptions. If any such uncertainties materialize or if any of the assumptions proves incorrect, the results of salesforce.com, inc. could differ materially from the results expressed or implied by the forward-looking statements we make. All statements other than statements of historical fact could be deemed forward-looking, including any projections of product or service availability, subscriber growth, earnings, revenues, or other financial items and any statements regarding strategies or plans of management for future operations, statements of belief, any statements concerning new, planned, or upgraded services or technology developments and customer contracts or use of our services. The risks and uncertainties referred to above include – but are not limited to – risks associated with developing and delivering new functionality for our service, new products and services, our new business model, our past operating losses, possible fluctuations in our operating results and rate of growth, interruptions or delays in our Web hosting, breach of our security measures, the outcome of any litigation, risks associated with completed and any possible mergers and acquisitions, the immature market in which we operate, our relatively limited operating history, our ability to expand, retain, and motivate our employees and manage our growth, new releases of our service and successful customer deployment, our limited history reselling non-salesforce.com products, and utilization and selling to larger enterprise customers. Further information on potential factors that could affect the financial results of salesforce.com, inc. is included in our annual report on Form 10-K for the most recent fiscal year and in our quarterly report on Form 10-Q for the most recent fiscal quarter. These documents and others containing important disclosures are available on the SEC Filings section of the Investor Information section of our Web site. Any unreleased services or features referenced in this or other presentations, press releases or public statements are not currently available and may not be delivered on time or at all. Customers who purchase our services should make the purchase decisions based upon features that are currently available. Salesforce.com, inc. assumes no obligation and does not intend to update these forward-looking statements.
  • 3. Robert J Nunemaker Senior Systems Architect
  • 4. Ask Yourself • How many of you have triggers and/or classes that have hundreds of lines? • How many have had to spend hours reverse engineering code just to find where something occurs, its dependencies, and how to change it? • How many don’t code, but wish they could know what is going on inside the multiple triggers? • Why can’t we get contractors/new hires to code consistently?
  • 5. Objectives • Provide another flexible tool for your Apex Development • Provoke thought into standard patterns (or free-style) that don’t take shared resources into account. • Provide a pattern that managers, analysts, and developers alike can benefit from. • Advantages: o Scales VERY well. o VERY readable and easy to maintain. o VERY modular and a single point of DML and Error handling. o Limits reverse engineering and regression testing.
  • 6. The Design! • What IS EDA? o Event, Dispatch, Action o Learn the parable of the Plumber! • Error Handling Benefits o One place of handling; no need to handle again. o DML for other objects rolled back to requesting object.
  • 7. The Design! Let’s look an example trigger for a custom object called Account_Segmentation__c using Eclipse.
  • 8. The Design! (Enhancement) • When an Account Segmentation is Deleted, we need to update all linking Account Segmentation fields to be initialized to NULL. • How? EASY! o Create your Service method first to update Accounts as necessary. Notice how you can concentrate on the task; not the “hooks”. o BUT, those updates are to be put into the sObject LIST for update by the Dispatcher (already coded!). o Don’t forget your errorMAP population. o Finally add your small code fragment in your Dispatch Action method: o DONE!
  • 9. The Design! • Considerations o Script statements limits are now effectively removed in Winter ’14. o Modularization of functionality. o Other patterns can be used in the Service (Action). o @Future must still be done in Service. o Test class considerations (bPreventRecursion). • Non-Developer Benefits o No need to read code; just look at Dispatcher Action methods. o After initial development, enhancements much faster. o Regression testing easier and sometimes not necessary! • Snippets in Eclipse!
  • 10. Final Thoughts • Hopefully you’ve seen how this pattern can benefit stability, scale, maintainability, and development velocity. o Ask yourself – Where can you benefit? • It can be used by developers, analysts, and management to aid them in clarity and future development needs. • Even if you don’t use it as shown, maybe it will lead you to some ideas of how to make yourself more scalable or efficient. • Most important, does it help you provide better velocity in your enhancements to your customers? • Chatter posting will include the code, including enhancement code, and instructions on how to create your own Snippets for Eclipse!