SlideShare a Scribd company logo
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 Metadata
James Loghry
 
Salesforce DX with Visual Studio Code
Salesforce DX with Visual Studio CodeSalesforce DX with Visual Studio Code
Salesforce DX with Visual Studio Code
Thierry 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 Ozil
CzechDreamin
 
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
Salesforce 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 framework
Sudipta 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 SmartStore
Tom Gersic
 
Building Visualforce Custom Events Handlers
Building Visualforce Custom Events HandlersBuilding Visualforce Custom Events Handlers
Building Visualforce Custom Events Handlers
Salesforce Developers
 
Secure Salesforce: CRUD / FLS / Sharing
Secure Salesforce: CRUD / FLS / SharingSecure Salesforce: CRUD / FLS / Sharing
Secure Salesforce: CRUD / FLS / Sharing
Salesforce 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 Console
Matthew Poe
 
Finding Security Issues Fast!
Finding Security Issues Fast!Finding Security Issues Fast!
Finding Security Issues Fast!
Salesforce Engineering
 
Visualforce Hack for Junction Objects
Visualforce Hack for Junction ObjectsVisualforce Hack for Junction Objects
Visualforce Hack for Junction Objects
Ritesh Aswaney
 
Intro to Apex Programmers
Intro to Apex ProgrammersIntro to Apex Programmers
Intro to Apex Programmers
Salesforce Developers
 
Salesforce1 Platform for programmers
Salesforce1 Platform for programmersSalesforce1 Platform for programmers
Salesforce1 Platform for programmers
Salesforce 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 Perspective
Mike White
 
Automating the Elastic Stack
Automating the Elastic StackAutomating the Elastic Stack
Automating the Elastic Stack
Elasticsearch
 
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
Elasticsearch
 
Salesforce Developer Group Toronto - Winter'19
Salesforce Developer Group Toronto - Winter'19Salesforce Developer Group Toronto - Winter'19
Salesforce Developer Group Toronto - Winter'19
Jaswinder 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 I
Salesforce 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 Platform
Salesforce 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 Testing
Salesforce 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

From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
Ralf Eggert
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Elena Simperl
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
Bhaskar Mitra
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
CatarinaPereira64715
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 

Recently uploaded (20)

From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 

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