SlideShare a Scribd company logo
1 of 20
Generic Package Extension Architecture 
for AppExchange Partners 
Ami Assayag 
Chief Architect 
CRM Science 
@amiassayag 
Kirk Steffke 
Senior Developer 
CRM Science 
@kirkevonphilly
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.
Ami Assayag 
Chief Architect 
CRM Science
Kirk Steffke 
Senior Developer 
CRM Science
Managed Package Challenges 
Flexibility of platform creates (un)expected variability 
Edition specific features 
• Access and permissions issues 
Optional standard features 
• Person accounts, record types, etc. 
Unknown sharing models 
• Org specific user access 
Varying target org business logic 
• Pre-existing or a-typical business logic
Customer Wants… Customer Gets… 
“...in our org, we do 
<process x> this 
way.” 
“…your package 
does <x>, can it 
do <y>?” 
“…we use <custom object> instead 
of <standard object>“
Extension Package Flow 
Salesforce Org 
Optional Native Base Package Extension Package 
Trigger Trigger 
Trigger Handler 
Business logic Business logic Business logic 
Callout Handler 
External Application
Generic Extension Package Architecture Advantages 
Completely 
generic 
Can handle any 
org-specific 
complexity 
Flexible and 
reusable 
Extends to 
separate packages 
or target orgs
Technologies Used 
The right tools for the job…
Custom Settings 
• Very similar to Custom Objects 
Familiar 
• Can be exposed to or hidden from end-users 
Visibility 
• Won’t count against SOQL limits 
Efficient 
Readily Available 
• Apex 
• Visualforce 
• Formula Fields 
• Web Services API
Interfaces 
// A new global class w/in the Base Package 
global with sharing class <className> { 
} 
// Define an interface with method blueprints 
global interface <interfaceName>{ 
} 
// Define a generic class with generic params 
<returnType> <methodName(<parameters>);
Dynamic Instantiation of Classes 
// get the type of the class outside the package that impl. the generic interface 
Type t = Type.forName(<namespace>, <className>); 
// use a concrete type of the intf. To create a new inst. of the ext. impl. 
Extension ExtensionClass = (Extension)t.newInstance();
Code Examples - Outbound 
3 Steps to Implement this Design Pattern
Step 1: Create Interface in the Base Package 
// A new global class w/in the Base Package 
global with sharing class BasePackage { 
} 
// Define an interface with method blueprints 
global interface Extension { 
} 
// Define a generic class with generic params 
object GenericMethod(list<object> params);
Step 2: Create External Class 
public with sharing class MyExtension implements BasePackageNameSpace.BasePackage.Extension { 
// define a the generic class that is present in the interface 
public static object GenericMethod(list<object> params) { 
// replace input params with variables that have concrete types. 
set<id> RecordIds = (set<id>)params[0]; 
string somestring = (string)params[1]; 
// use the concrete type variables to call the class that does all the work 
ProcessFutureCallout(RecordIds, somestring); 
// in this example the business logic needs to make a callout to a different API 
@future(callout = true) 
public static void ProcessFutureCallout(set<id> RecordIds, string somestring) { 
// anything inside this class can be custom 
} 
// in this case there is no need to return anything so return null; 
return null; 
} 
}
Step 3: Call External Class from Within the Base Package 
// Get the external class name from a custom setting 
PackageExtension__c ext = PackageExtension__c.getInstance('extensionName'); 
if (ext == null) { 
else { 
// Get the type of the class outside the package that implements the generic interface 
Type t = Type.forName(ext.Namespace__c, ext.ClassName__c); 
// Using a concrete type of the int., create a new instance of the ext. implementation 
BasePackage.Extension ExtensionClass = (BasePackage.Extension)t.newInstance(); 
// Use ExtensionClass to call the generic method with any relevant variable 
list<object> retList = ExtensionClass.GenericMethod( 
new list<object>{someRecordIds, someString} 
); 
} 
// Process normal business logic 
}
Code Examples - Inbound 
Re-using Common Code from the Base Package
Utilize Base Package Code from the Extension 
// Define a global entry point to the package that can be called from outside the package 
global object CallMethod(string classDotMethod, list<object> params) { 
// Instantiate a generic object to return 
object retValue; 
// Using a Base Package Class' internal public static method with parameters 
else if (classDotMethod == 'BasePackageClass2.Method1') 
BasePackageClass2.Method1( 
(set<Id>)params[0], 
(string)params[1], 
(string)params[2] 
); 
// Return methods results to caller as an object 
return retValue; 
} 
// Using a Base Package Class' internal public static method 
if (classDotMethod == 'BasePackageClass1.Method1') 
retValue = BasePackageClass1.Method1();
Generic Package Extension Architecture 
for AppExchange Partners 
Ami Assayag 
Chief Architect 
CRM Science 
@amiassayag 
Kirk Steffke 
Senior Developer 
CRM Science 
@kirkevonphilly

More Related Content

Similar to CRM Science - Dreamforce '14: Generic Package Extension Architecture for AppExchange Partners

Partition Your (Apex) Trigger Logic Using Metadata
Partition Your  (Apex) Trigger Logic Using MetadataPartition Your  (Apex) Trigger Logic Using Metadata
Partition Your (Apex) Trigger Logic Using MetadataJames Loghry
 
Salesforce DX with Visual Studio Code
Salesforce DX with Visual Studio CodeSalesforce DX with Visual Studio Code
Salesforce DX with Visual Studio CodeThierry TROUIN ☁
 
Quit Jesting and Test your Lightning Web Components, Phillipe Ozil
Quit Jesting and Test your Lightning Web Components, Phillipe OzilQuit Jesting and Test your Lightning Web Components, Phillipe Ozil
Quit Jesting and Test your Lightning Web Components, Phillipe OzilCzechDreamin
 
Understanding the Salesforce Architecture: How We Do the Magic We Do
Understanding the Salesforce Architecture: How We Do the Magic We DoUnderstanding the Salesforce Architecture: How We Do the Magic We Do
Understanding the Salesforce Architecture: How We Do the Magic We DoSalesforce Developers
 
Orchestrate all of your salesforce automation with the trigger actions framework
Orchestrate all of your salesforce automation with the trigger actions frameworkOrchestrate all of your salesforce automation with the trigger actions framework
Orchestrate all of your salesforce automation with the trigger actions frameworkSudipta Deb ☁
 
Developing Offline Mobile Apps with Salesforce Mobile SDK SmartStore
Developing Offline Mobile Apps with Salesforce Mobile SDK SmartStoreDeveloping Offline Mobile Apps with Salesforce Mobile SDK SmartStore
Developing Offline Mobile Apps with Salesforce Mobile SDK SmartStoreTom Gersic
 
Building Visualforce Custom Events Handlers
Building Visualforce Custom Events HandlersBuilding Visualforce Custom Events Handlers
Building Visualforce Custom Events HandlersSalesforce Developers
 
Secure Salesforce: CRUD / FLS / Sharing
Secure Salesforce: CRUD / FLS / SharingSecure Salesforce: CRUD / FLS / Sharing
Secure Salesforce: CRUD / FLS / SharingSalesforce Developers
 
Bug Hunting with the Salesforce Developer Console
Bug Hunting with the Salesforce Developer ConsoleBug Hunting with the Salesforce Developer Console
Bug Hunting with the Salesforce Developer ConsoleMatthew Poe
 
Visualforce Hack for Junction Objects
Visualforce Hack for Junction ObjectsVisualforce Hack for Junction Objects
Visualforce Hack for Junction ObjectsRitesh Aswaney
 
Salesforce1 Platform for programmers
Salesforce1 Platform for programmersSalesforce1 Platform for programmers
Salesforce1 Platform for programmersSalesforce Developers
 
Dreamforce 2017: Salesforce DX - an Admin's Perspective
Dreamforce 2017:  Salesforce DX - an Admin's PerspectiveDreamforce 2017:  Salesforce DX - an Admin's Perspective
Dreamforce 2017: Salesforce DX - an Admin's PerspectiveMike White
 
Automating the Elastic Stack
Automating the Elastic StackAutomating the Elastic Stack
Automating the Elastic StackElasticsearch
 
Next-level integration with Spring Data Elasticsearch
Next-level integration with Spring Data ElasticsearchNext-level integration with Spring Data Elasticsearch
Next-level integration with Spring Data ElasticsearchElasticsearch
 
Salesforce Developer Group Toronto - Winter'19
Salesforce Developer Group Toronto - Winter'19Salesforce Developer Group Toronto - Winter'19
Salesforce Developer Group Toronto - Winter'19Jaswinder Rattanpal
 
Secure Development on the Salesforce Platform - Part I
Secure Development on the Salesforce Platform - Part ISecure Development on the Salesforce Platform - Part I
Secure Development on the Salesforce Platform - Part ISalesforce Developers
 
Understanding Multitenancy and the Architecture of the Salesforce Platform
Understanding Multitenancy and the Architecture of the Salesforce PlatformUnderstanding Multitenancy and the Architecture of the Salesforce Platform
Understanding Multitenancy and the Architecture of the Salesforce PlatformSalesforce Developers
 
Lightning web components - Episode 4 : Security and Testing
Lightning web components  - Episode 4 : Security and TestingLightning web components  - Episode 4 : Security and Testing
Lightning web components - Episode 4 : Security and TestingSalesforce Developers
 

Similar to CRM Science - Dreamforce '14: Generic Package Extension Architecture for AppExchange Partners (20)

Partition Your (Apex) Trigger Logic Using Metadata
Partition Your  (Apex) Trigger Logic Using MetadataPartition Your  (Apex) Trigger Logic Using Metadata
Partition Your (Apex) Trigger Logic Using Metadata
 
Salesforce DX with Visual Studio Code
Salesforce DX with Visual Studio CodeSalesforce DX with Visual Studio Code
Salesforce DX with Visual Studio Code
 
Quit Jesting and Test your Lightning Web Components, Phillipe Ozil
Quit Jesting and Test your Lightning Web Components, Phillipe OzilQuit Jesting and Test your Lightning Web Components, Phillipe Ozil
Quit Jesting and Test your Lightning Web Components, Phillipe Ozil
 
Understanding the Salesforce Architecture: How We Do the Magic We Do
Understanding the Salesforce Architecture: How We Do the Magic We DoUnderstanding the Salesforce Architecture: How We Do the Magic We Do
Understanding the Salesforce Architecture: How We Do the Magic We Do
 
Orchestrate all of your salesforce automation with the trigger actions framework
Orchestrate all of your salesforce automation with the trigger actions frameworkOrchestrate all of your salesforce automation with the trigger actions framework
Orchestrate all of your salesforce automation with the trigger actions framework
 
Developing Offline Mobile Apps with Salesforce Mobile SDK SmartStore
Developing Offline Mobile Apps with Salesforce Mobile SDK SmartStoreDeveloping Offline Mobile Apps with Salesforce Mobile SDK SmartStore
Developing Offline Mobile Apps with Salesforce Mobile SDK SmartStore
 
Building Visualforce Custom Events Handlers
Building Visualforce Custom Events HandlersBuilding Visualforce Custom Events Handlers
Building Visualforce Custom Events Handlers
 
Secure Salesforce: CRUD / FLS / Sharing
Secure Salesforce: CRUD / FLS / SharingSecure Salesforce: CRUD / FLS / Sharing
Secure Salesforce: CRUD / FLS / Sharing
 
Bug Hunting with the Salesforce Developer Console
Bug Hunting with the Salesforce Developer ConsoleBug Hunting with the Salesforce Developer Console
Bug Hunting with the Salesforce Developer Console
 
Finding Security Issues Fast!
Finding Security Issues Fast!Finding Security Issues Fast!
Finding Security Issues Fast!
 
Visualforce Hack for Junction Objects
Visualforce Hack for Junction ObjectsVisualforce Hack for Junction Objects
Visualforce Hack for Junction Objects
 
Intro to Apex Programmers
Intro to Apex ProgrammersIntro to Apex Programmers
Intro to Apex Programmers
 
Salesforce1 Platform for programmers
Salesforce1 Platform for programmersSalesforce1 Platform for programmers
Salesforce1 Platform for programmers
 
Dreamforce 2017: Salesforce DX - an Admin's Perspective
Dreamforce 2017:  Salesforce DX - an Admin's PerspectiveDreamforce 2017:  Salesforce DX - an Admin's Perspective
Dreamforce 2017: Salesforce DX - an Admin's Perspective
 
Automating the Elastic Stack
Automating the Elastic StackAutomating the Elastic Stack
Automating the Elastic Stack
 
Next-level integration with Spring Data Elasticsearch
Next-level integration with Spring Data ElasticsearchNext-level integration with Spring Data Elasticsearch
Next-level integration with Spring Data Elasticsearch
 
Salesforce Developer Group Toronto - Winter'19
Salesforce Developer Group Toronto - Winter'19Salesforce Developer Group Toronto - Winter'19
Salesforce Developer Group Toronto - Winter'19
 
Secure Development on the Salesforce Platform - Part I
Secure Development on the Salesforce Platform - Part ISecure Development on the Salesforce Platform - Part I
Secure Development on the Salesforce Platform - Part I
 
Understanding Multitenancy and the Architecture of the Salesforce Platform
Understanding Multitenancy and the Architecture of the Salesforce PlatformUnderstanding Multitenancy and the Architecture of the Salesforce Platform
Understanding Multitenancy and the Architecture of the Salesforce Platform
 
Lightning web components - Episode 4 : Security and Testing
Lightning web components  - Episode 4 : Security and TestingLightning web components  - Episode 4 : Security and Testing
Lightning web components - Episode 4 : Security and Testing
 

Recently uploaded

Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)Paige Cruz
 
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdfIntroduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdfFIDO Alliance
 
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...ScyllaDB
 
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider  Progress from Awareness to Implementation.pptxTales from a Passkey Provider  Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider Progress from Awareness to Implementation.pptxFIDO Alliance
 
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...FIDO Alliance
 
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdfThe Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdfFIDO Alliance
 
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsContinuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsLeah Henrickson
 
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...FIDO Alliance
 
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdfHow Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdfFIDO Alliance
 
How we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdfHow we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdfSrushith Repakula
 
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...ScyllaDB
 
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...FIDO Alliance
 
TopCryptoSupers 12thReport OrionX May2024
TopCryptoSupers 12thReport OrionX May2024TopCryptoSupers 12thReport OrionX May2024
TopCryptoSupers 12thReport OrionX May2024Stephen Perrenod
 
WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024Lorenzo Miniero
 
Top 10 CodeIgniter Development Companies
Top 10 CodeIgniter Development CompaniesTop 10 CodeIgniter Development Companies
Top 10 CodeIgniter Development CompaniesTopCSSGallery
 
2024 May Patch Tuesday
2024 May Patch Tuesday2024 May Patch Tuesday
2024 May Patch TuesdayIvanti
 
Google I/O Extended 2024 Warsaw
Google I/O Extended 2024 WarsawGoogle I/O Extended 2024 Warsaw
Google I/O Extended 2024 WarsawGDSC PJATK
 
ERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage IntacctERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage IntacctBrainSell Technologies
 
Event-Driven Architecture Masterclass: Challenges in Stream Processing
Event-Driven Architecture Masterclass: Challenges in Stream ProcessingEvent-Driven Architecture Masterclass: Challenges in Stream Processing
Event-Driven Architecture Masterclass: Challenges in Stream ProcessingScyllaDB
 
Vector Search @ sw2con for slideshare.pptx
Vector Search @ sw2con for slideshare.pptxVector Search @ sw2con for slideshare.pptx
Vector Search @ sw2con for slideshare.pptxjbellis
 

Recently uploaded (20)

Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
 
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdfIntroduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
 
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
 
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider  Progress from Awareness to Implementation.pptxTales from a Passkey Provider  Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
 
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
 
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdfThe Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
 
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsContinuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
 
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
 
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdfHow Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
 
How we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdfHow we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdf
 
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
 
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
 
TopCryptoSupers 12thReport OrionX May2024
TopCryptoSupers 12thReport OrionX May2024TopCryptoSupers 12thReport OrionX May2024
TopCryptoSupers 12thReport OrionX May2024
 
WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024
 
Top 10 CodeIgniter Development Companies
Top 10 CodeIgniter Development CompaniesTop 10 CodeIgniter Development Companies
Top 10 CodeIgniter Development Companies
 
2024 May Patch Tuesday
2024 May Patch Tuesday2024 May Patch Tuesday
2024 May Patch Tuesday
 
Google I/O Extended 2024 Warsaw
Google I/O Extended 2024 WarsawGoogle I/O Extended 2024 Warsaw
Google I/O Extended 2024 Warsaw
 
ERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage IntacctERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage Intacct
 
Event-Driven Architecture Masterclass: Challenges in Stream Processing
Event-Driven Architecture Masterclass: Challenges in Stream ProcessingEvent-Driven Architecture Masterclass: Challenges in Stream Processing
Event-Driven Architecture Masterclass: Challenges in Stream Processing
 
Vector Search @ sw2con for slideshare.pptx
Vector Search @ sw2con for slideshare.pptxVector Search @ sw2con for slideshare.pptx
Vector Search @ sw2con for slideshare.pptx
 

CRM Science - Dreamforce '14: Generic Package Extension Architecture for AppExchange Partners

  • 1. Generic Package Extension Architecture for AppExchange Partners Ami Assayag Chief Architect CRM Science @amiassayag Kirk Steffke Senior Developer CRM Science @kirkevonphilly
  • 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. Ami Assayag Chief Architect CRM Science
  • 4. Kirk Steffke Senior Developer CRM Science
  • 5. Managed Package Challenges Flexibility of platform creates (un)expected variability Edition specific features • Access and permissions issues Optional standard features • Person accounts, record types, etc. Unknown sharing models • Org specific user access Varying target org business logic • Pre-existing or a-typical business logic
  • 6. Customer Wants… Customer Gets… “...in our org, we do <process x> this way.” “…your package does <x>, can it do <y>?” “…we use <custom object> instead of <standard object>“
  • 7. Extension Package Flow Salesforce Org Optional Native Base Package Extension Package Trigger Trigger Trigger Handler Business logic Business logic Business logic Callout Handler External Application
  • 8. Generic Extension Package Architecture Advantages Completely generic Can handle any org-specific complexity Flexible and reusable Extends to separate packages or target orgs
  • 9. Technologies Used The right tools for the job…
  • 10. Custom Settings • Very similar to Custom Objects Familiar • Can be exposed to or hidden from end-users Visibility • Won’t count against SOQL limits Efficient Readily Available • Apex • Visualforce • Formula Fields • Web Services API
  • 11. Interfaces // A new global class w/in the Base Package global with sharing class <className> { } // Define an interface with method blueprints global interface <interfaceName>{ } // Define a generic class with generic params <returnType> <methodName(<parameters>);
  • 12. Dynamic Instantiation of Classes // get the type of the class outside the package that impl. the generic interface Type t = Type.forName(<namespace>, <className>); // use a concrete type of the intf. To create a new inst. of the ext. impl. Extension ExtensionClass = (Extension)t.newInstance();
  • 13. Code Examples - Outbound 3 Steps to Implement this Design Pattern
  • 14. Step 1: Create Interface in the Base Package // A new global class w/in the Base Package global with sharing class BasePackage { } // Define an interface with method blueprints global interface Extension { } // Define a generic class with generic params object GenericMethod(list<object> params);
  • 15. Step 2: Create External Class public with sharing class MyExtension implements BasePackageNameSpace.BasePackage.Extension { // define a the generic class that is present in the interface public static object GenericMethod(list<object> params) { // replace input params with variables that have concrete types. set<id> RecordIds = (set<id>)params[0]; string somestring = (string)params[1]; // use the concrete type variables to call the class that does all the work ProcessFutureCallout(RecordIds, somestring); // in this example the business logic needs to make a callout to a different API @future(callout = true) public static void ProcessFutureCallout(set<id> RecordIds, string somestring) { // anything inside this class can be custom } // in this case there is no need to return anything so return null; return null; } }
  • 16. Step 3: Call External Class from Within the Base Package // Get the external class name from a custom setting PackageExtension__c ext = PackageExtension__c.getInstance('extensionName'); if (ext == null) { else { // Get the type of the class outside the package that implements the generic interface Type t = Type.forName(ext.Namespace__c, ext.ClassName__c); // Using a concrete type of the int., create a new instance of the ext. implementation BasePackage.Extension ExtensionClass = (BasePackage.Extension)t.newInstance(); // Use ExtensionClass to call the generic method with any relevant variable list<object> retList = ExtensionClass.GenericMethod( new list<object>{someRecordIds, someString} ); } // Process normal business logic }
  • 17. Code Examples - Inbound Re-using Common Code from the Base Package
  • 18. Utilize Base Package Code from the Extension // Define a global entry point to the package that can be called from outside the package global object CallMethod(string classDotMethod, list<object> params) { // Instantiate a generic object to return object retValue; // Using a Base Package Class' internal public static method with parameters else if (classDotMethod == 'BasePackageClass2.Method1') BasePackageClass2.Method1( (set<Id>)params[0], (string)params[1], (string)params[2] ); // Return methods results to caller as an object return retValue; } // Using a Base Package Class' internal public static method if (classDotMethod == 'BasePackageClass1.Method1') retValue = BasePackageClass1.Method1();
  • 19.
  • 20. Generic Package Extension Architecture for AppExchange Partners Ami Assayag Chief Architect CRM Science @amiassayag Kirk Steffke Senior Developer CRM Science @kirkevonphilly