SlideShare una empresa de Scribd logo
1 de 27
Descargar para leer sin conexión
@puntadreamin #PD17
Writing Highly Genericized Code Using
Dynamic Apex and the Tooling API
Adam Olshansky
Salesforce Developer, Contractor at YouTube
Salesforce MVP, 13X Certified
AdamToArchitect.com
@adam17amo
¡Estoy feliz de estar en
Punta del Este!
Agenda
•  Overview of generic code for Apex
•  Dynamic Code in Salesforce
•  Tooling API
Generic Programming in Apex
What problems are we solving for?
•  Rigid or fragile code
•  Poor Reusability
•  Lots of patches/quick fixes
•  Duplicate code
•  Overly complicated data structures
•  Maps of maps of maps…
Who are we talking to today?
•  ISV developers
•  Don’t know all conditions of customer orgs
•  Individual app developers
•  May need to accept input from clients/customers
•  Any developer accepting user input
•  Tailor your queries and results based on user conditions
Different Ways of Writing Code: Static vs. Dynamic
Static
•  Generated at compile time
•  Hard coded
•  Doesn’t usually have dependencies
•  Works well if you know what’s in the
org
•  Most commonly used by developers at
a company developing for their own
org
Dynamic/Generic
•  Generated at run time
•  Dependent on user input
•  May have org-specific dependencies
•  Works well if you DON’T know what’s in the
org
•  Most commonly used by developers whose
code needs to run in customized orgs
2 Different Ways of Writing Code
Tradeoffs
​ Positives
•  More detailed information
•  Less chance of an error down the road
•  Endless possibilities
​ Negatives
•  More code to write
•  More code to test
•  Less readability
Tools of the Trade
Several Ways in Salesforce
•  Custom Settings/Metadata
•  Dynamic Apex
•  Dynamic Visualforce
•  Dynamic SOQL
•  Limits class
•  Schema class
Dynamic Apex
Dynamic Controller
Dynamic Visualforce
Dynamic SOQL
•  Don’t always know what parameters are available in a user’s org
•  In your org this will work
•  What if your customer doesn’t have record types defined for Lead?
Limits Class
•  Limits.getDMLRows();
•  Limits.getDMLStatements();
•  Limits.getHeapSize();
•  Limits.getQueries();
•  Limits.getQueryRows();
•  bit.ly/apexlimitsclass (Apex Limits Class)
Tooling API
An API for building…Tools
Tooling API Highlights
•  Gather finely grained metadata about Apex classes, triggers, and tests in an org
-  Classes, triggers, construction of symbol tables
-  Query for code coverage, logs, SOQL results
•  Query metadata about setup objects
-  Business processes, flows, custom items, workflow components
•  Can be utilized for source control/continuous integration
-  Metadata containers, deployment details, code file metadata
•  Can be queried through REST or SOAP
•  Similar to Metadata API but with a ton of additional functionality
​ Great for building…tools!
Our Scenario
​ UTILIZE DYNAMIC APEX TO WRITE APEX USING
APEX!
​ APEX-CEPTION!!!
Additional Tooling API Use Cases
•  Show all objects that can be analyzed
/services/data/v37.0/tooling/sobjects/
•  Show list of all classes
/services/data/v37.0/tooling/apexManifest
•  Show all metadata about a class
/services/data/v37.0/tooling/sobjects/ApexClass/01po0000004SL5b
Tools To Be Built
•  UML Diagram Tool
•  Symbol Table Visualizer
•  Automated Testing Tools
•  Tools to identify unused code
•  Customize managed packages based on
org’s config
•  Use your imagination!
Summary
Next Steps from Here
Summary and Next Steps
•  Be thinking about the right type of code for the app you’re building
•  Write dynamic code
•  Gather granular details to build any app
•  Get out there and build!
Where to Learn More
•  Follow @andyinthecloud (Andy Fawcett, CTO Financial Force)
•  Andy Fawcett’s Blog https://andyinthecloud.com/category/tooling-api/
•  Andy and James Loghry’s Apex Tooling API Wrapper:
https://github.com/afawcett/apex-toolingapi/
•  Pat Patterson’s Java Tooling API Wrapper: https://github.com/metadaddy/force-tooling-demo
https://developer.salesforce.com/blogs/developer-relations/2013/01/new-in-spring-13-the-
tooling-api.html
•  Tom Patros VF page Utilizing Symbol Tables:
https://github.com/tompatros/df13-tooling-api-demo and
http://www.redargyle.com/blog/tooling-around-tooling-api/
Thank Y u
Q&A

Más contenido relacionado

La actualidad más candente

Pain Points In API Development? They’re Everywhere
Pain Points In API Development? They’re EverywherePain Points In API Development? They’re Everywhere
Pain Points In API Development? They’re EverywhereNordic APIs
 
Real-time GraphQL API with minimum coding and maximum benefit
 Real-time GraphQL API with minimum coding and maximum benefit Real-time GraphQL API with minimum coding and maximum benefit
Real-time GraphQL API with minimum coding and maximum benefitMikhail Asavkin
 
London React August - GraphQL at The Financial Times - Viktor Charypar
London React August - GraphQL at The Financial Times - Viktor CharyparLondon React August - GraphQL at The Financial Times - Viktor Charypar
London React August - GraphQL at The Financial Times - Viktor CharyparReact London Community
 
API-first development
API-first developmentAPI-first development
API-first developmentVasco Veloso
 
apidays LIVE Hong Kong 2021 - GraphQL : Beyond APIs, graph your enterprise by...
apidays LIVE Hong Kong 2021 - GraphQL : Beyond APIs, graph your enterprise by...apidays LIVE Hong Kong 2021 - GraphQL : Beyond APIs, graph your enterprise by...
apidays LIVE Hong Kong 2021 - GraphQL : Beyond APIs, graph your enterprise by...apidays
 
Continuous Integration and Delivery at Shapeways (Matt Boyle)
Continuous Integration and Delivery at Shapeways (Matt Boyle)Continuous Integration and Delivery at Shapeways (Matt Boyle)
Continuous Integration and Delivery at Shapeways (Matt Boyle)Nordic APIs
 
The Magic Behind Faster API Development, Testing and Delivery with API Virtua...
The Magic Behind Faster API Development, Testing and Delivery with API Virtua...The Magic Behind Faster API Development, Testing and Delivery with API Virtua...
The Magic Behind Faster API Development, Testing and Delivery with API Virtua...Nordic APIs
 
apidays LIVE Paris - The Augmented API Design Reviewer by Arnaud Lauret
apidays LIVE Paris - The Augmented API Design Reviewer by Arnaud Lauretapidays LIVE Paris - The Augmented API Design Reviewer by Arnaud Lauret
apidays LIVE Paris - The Augmented API Design Reviewer by Arnaud Lauretapidays
 
apidays LIVE Paris 2021 - Learning the Language of HTTP for a Better Data Exp...
apidays LIVE Paris 2021 - Learning the Language of HTTP for a Better Data Exp...apidays LIVE Paris 2021 - Learning the Language of HTTP for a Better Data Exp...
apidays LIVE Paris 2021 - Learning the Language of HTTP for a Better Data Exp...apidays
 
apidays LIVE Paris 2021 - Localizing OpenAPI Specification by Olga Baybakova,...
apidays LIVE Paris 2021 - Localizing OpenAPI Specification by Olga Baybakova,...apidays LIVE Paris 2021 - Localizing OpenAPI Specification by Olga Baybakova,...
apidays LIVE Paris 2021 - Localizing OpenAPI Specification by Olga Baybakova,...apidays
 
apidays LIVE London 2021 - Designing APIs: Less Data is More by Damir Svrtan,...
apidays LIVE London 2021 - Designing APIs: Less Data is More by Damir Svrtan,...apidays LIVE London 2021 - Designing APIs: Less Data is More by Damir Svrtan,...
apidays LIVE London 2021 - Designing APIs: Less Data is More by Damir Svrtan,...apidays
 
GraphQL Munich Meetup #1 - How We Use GraphQL At Commercetools
GraphQL Munich Meetup #1 - How We Use GraphQL At CommercetoolsGraphQL Munich Meetup #1 - How We Use GraphQL At Commercetools
GraphQL Munich Meetup #1 - How We Use GraphQL At CommercetoolsNicola Molinari
 
Api Design Anti-Patterns
Api Design Anti-PatternsApi Design Anti-Patterns
Api Design Anti-PatternsJason Harmon
 
Tools and techniques for APIs
Tools and techniques for APIsTools and techniques for APIs
Tools and techniques for APIsJason Harmon
 
Domain Driven Design Through Onion Architecture
Domain Driven Design Through Onion ArchitectureDomain Driven Design Through Onion Architecture
Domain Driven Design Through Onion ArchitectureBoldRadius Solutions
 
Introduction to APIs, Integrations and Open Data
Introduction to APIs, Integrations and Open DataIntroduction to APIs, Integrations and Open Data
Introduction to APIs, Integrations and Open DataResolver Inc.
 
APEX Alpe Adria Mike Hichwa Keynote April 11th 2019- Zagreb
APEX Alpe Adria Mike Hichwa Keynote April 11th 2019- ZagrebAPEX Alpe Adria Mike Hichwa Keynote April 11th 2019- Zagreb
APEX Alpe Adria Mike Hichwa Keynote April 11th 2019- ZagrebMichael Hichwa
 

La actualidad más candente (20)

Pain Points In API Development? They’re Everywhere
Pain Points In API Development? They’re EverywherePain Points In API Development? They’re Everywhere
Pain Points In API Development? They’re Everywhere
 
Real-time GraphQL API with minimum coding and maximum benefit
 Real-time GraphQL API with minimum coding and maximum benefit Real-time GraphQL API with minimum coding and maximum benefit
Real-time GraphQL API with minimum coding and maximum benefit
 
London React August - GraphQL at The Financial Times - Viktor Charypar
London React August - GraphQL at The Financial Times - Viktor CharyparLondon React August - GraphQL at The Financial Times - Viktor Charypar
London React August - GraphQL at The Financial Times - Viktor Charypar
 
API-first development
API-first developmentAPI-first development
API-first development
 
apidays LIVE Hong Kong 2021 - GraphQL : Beyond APIs, graph your enterprise by...
apidays LIVE Hong Kong 2021 - GraphQL : Beyond APIs, graph your enterprise by...apidays LIVE Hong Kong 2021 - GraphQL : Beyond APIs, graph your enterprise by...
apidays LIVE Hong Kong 2021 - GraphQL : Beyond APIs, graph your enterprise by...
 
Continuous Integration and Delivery at Shapeways (Matt Boyle)
Continuous Integration and Delivery at Shapeways (Matt Boyle)Continuous Integration and Delivery at Shapeways (Matt Boyle)
Continuous Integration and Delivery at Shapeways (Matt Boyle)
 
The Magic Behind Faster API Development, Testing and Delivery with API Virtua...
The Magic Behind Faster API Development, Testing and Delivery with API Virtua...The Magic Behind Faster API Development, Testing and Delivery with API Virtua...
The Magic Behind Faster API Development, Testing and Delivery with API Virtua...
 
apidays LIVE Paris - The Augmented API Design Reviewer by Arnaud Lauret
apidays LIVE Paris - The Augmented API Design Reviewer by Arnaud Lauretapidays LIVE Paris - The Augmented API Design Reviewer by Arnaud Lauret
apidays LIVE Paris - The Augmented API Design Reviewer by Arnaud Lauret
 
Huge: Running an API at Scale
Huge: Running an API at ScaleHuge: Running an API at Scale
Huge: Running an API at Scale
 
apidays LIVE Paris 2021 - Learning the Language of HTTP for a Better Data Exp...
apidays LIVE Paris 2021 - Learning the Language of HTTP for a Better Data Exp...apidays LIVE Paris 2021 - Learning the Language of HTTP for a Better Data Exp...
apidays LIVE Paris 2021 - Learning the Language of HTTP for a Better Data Exp...
 
apidays LIVE Paris 2021 - Localizing OpenAPI Specification by Olga Baybakova,...
apidays LIVE Paris 2021 - Localizing OpenAPI Specification by Olga Baybakova,...apidays LIVE Paris 2021 - Localizing OpenAPI Specification by Olga Baybakova,...
apidays LIVE Paris 2021 - Localizing OpenAPI Specification by Olga Baybakova,...
 
apidays LIVE London 2021 - Designing APIs: Less Data is More by Damir Svrtan,...
apidays LIVE London 2021 - Designing APIs: Less Data is More by Damir Svrtan,...apidays LIVE London 2021 - Designing APIs: Less Data is More by Damir Svrtan,...
apidays LIVE London 2021 - Designing APIs: Less Data is More by Damir Svrtan,...
 
Introduction to GraphQL
Introduction to GraphQLIntroduction to GraphQL
Introduction to GraphQL
 
GraphQL Munich Meetup #1 - How We Use GraphQL At Commercetools
GraphQL Munich Meetup #1 - How We Use GraphQL At CommercetoolsGraphQL Munich Meetup #1 - How We Use GraphQL At Commercetools
GraphQL Munich Meetup #1 - How We Use GraphQL At Commercetools
 
Api Design Anti-Patterns
Api Design Anti-PatternsApi Design Anti-Patterns
Api Design Anti-Patterns
 
Tools and techniques for APIs
Tools and techniques for APIsTools and techniques for APIs
Tools and techniques for APIs
 
GraphQL Europe Recap
GraphQL Europe RecapGraphQL Europe Recap
GraphQL Europe Recap
 
Domain Driven Design Through Onion Architecture
Domain Driven Design Through Onion ArchitectureDomain Driven Design Through Onion Architecture
Domain Driven Design Through Onion Architecture
 
Introduction to APIs, Integrations and Open Data
Introduction to APIs, Integrations and Open DataIntroduction to APIs, Integrations and Open Data
Introduction to APIs, Integrations and Open Data
 
APEX Alpe Adria Mike Hichwa Keynote April 11th 2019- Zagreb
APEX Alpe Adria Mike Hichwa Keynote April 11th 2019- ZagrebAPEX Alpe Adria Mike Hichwa Keynote April 11th 2019- Zagreb
APEX Alpe Adria Mike Hichwa Keynote April 11th 2019- Zagreb
 

Destacado

La mediación escolar_rosa_garcia_mendive
La mediación escolar_rosa_garcia_mendiveLa mediación escolar_rosa_garcia_mendive
La mediación escolar_rosa_garcia_mendiverosagarciamendive
 
10 Economic Consequences of Trump
10 Economic Consequences of Trump10 Economic Consequences of Trump
10 Economic Consequences of TrumpSusana Gallardo
 
عند بناء محتوى تسويقي... لا تتحدث مع الغرباء!
عند بناء محتوى تسويقي... لا تتحدث مع الغرباء!عند بناء محتوى تسويقي... لا تتحدث مع الغرباء!
عند بناء محتوى تسويقي... لا تتحدث مع الغرباء!Haifa Alharbi
 
Pancreatitis aguda y crónica
Pancreatitis aguda y crónicaPancreatitis aguda y crónica
Pancreatitis aguda y crónicaviky95
 
Docker Online Meetup: Announcing Docker CE + EE
Docker Online Meetup: Announcing Docker CE + EEDocker Online Meetup: Announcing Docker CE + EE
Docker Online Meetup: Announcing Docker CE + EEDocker, Inc.
 
Plataformas y redes de comunicacion
Plataformas y redes de comunicacionPlataformas y redes de comunicacion
Plataformas y redes de comunicaciondaniel suarez
 
Vertebrates and invertebrates
Vertebrates and invertebratesVertebrates and invertebrates
Vertebrates and invertebratesTeacherLuis0311
 
3Com 70N3
3Com 70N33Com 70N3
3Com 70N3savomir
 
Hemorragia digestiva y síndrome pilórico
Hemorragia digestiva y síndrome pilóricoHemorragia digestiva y síndrome pilórico
Hemorragia digestiva y síndrome pilóricoviky95
 
Investigación ATIT
Investigación ATITInvestigación ATIT
Investigación ATITDavid Romero
 
EVALUATION OF SCIENTIFIC ATTITUDE AMONG STUDENT TEACHERS
EVALUATION OF SCIENTIFIC ATTITUDE AMONG STUDENT TEACHERSEVALUATION OF SCIENTIFIC ATTITUDE AMONG STUDENT TEACHERS
EVALUATION OF SCIENTIFIC ATTITUDE AMONG STUDENT TEACHERSS. Raj Kumar
 
Artificial inteligence by m.shahbaz ..
Artificial inteligence by m.shahbaz ..Artificial inteligence by m.shahbaz ..
Artificial inteligence by m.shahbaz ..Shahbaaz Liaqat
 
Presentació de la ponència.esc.coop.el puig
Presentació de la ponència.esc.coop.el puigPresentació de la ponència.esc.coop.el puig
Presentació de la ponència.esc.coop.el puigpbatall1
 
Exercício contabilidade débito e crédito
Exercício contabilidade débito e créditoExercício contabilidade débito e crédito
Exercício contabilidade débito e créditoRaimundo Filho
 

Destacado (20)

La mediación escolar_rosa_garcia_mendive
La mediación escolar_rosa_garcia_mendiveLa mediación escolar_rosa_garcia_mendive
La mediación escolar_rosa_garcia_mendive
 
10 Economic Consequences of Trump
10 Economic Consequences of Trump10 Economic Consequences of Trump
10 Economic Consequences of Trump
 
عند بناء محتوى تسويقي... لا تتحدث مع الغرباء!
عند بناء محتوى تسويقي... لا تتحدث مع الغرباء!عند بناء محتوى تسويقي... لا تتحدث مع الغرباء!
عند بناء محتوى تسويقي... لا تتحدث مع الغرباء!
 
Pancreatitis aguda y crónica
Pancreatitis aguda y crónicaPancreatitis aguda y crónica
Pancreatitis aguda y crónica
 
Docker Online Meetup: Announcing Docker CE + EE
Docker Online Meetup: Announcing Docker CE + EEDocker Online Meetup: Announcing Docker CE + EE
Docker Online Meetup: Announcing Docker CE + EE
 
Plataformas y redes de comunicacion
Plataformas y redes de comunicacionPlataformas y redes de comunicacion
Plataformas y redes de comunicacion
 
Vertebrates and invertebrates
Vertebrates and invertebratesVertebrates and invertebrates
Vertebrates and invertebrates
 
P.a.
P.a.P.a.
P.a.
 
3Com 70N3
3Com 70N33Com 70N3
3Com 70N3
 
Hemorragia digestiva y síndrome pilórico
Hemorragia digestiva y síndrome pilóricoHemorragia digestiva y síndrome pilórico
Hemorragia digestiva y síndrome pilórico
 
Región NOA
Región NOARegión NOA
Región NOA
 
Investigación ATIT
Investigación ATITInvestigación ATIT
Investigación ATIT
 
Energy conversion
Energy conversion Energy conversion
Energy conversion
 
EVALUATION OF SCIENTIFIC ATTITUDE AMONG STUDENT TEACHERS
EVALUATION OF SCIENTIFIC ATTITUDE AMONG STUDENT TEACHERSEVALUATION OF SCIENTIFIC ATTITUDE AMONG STUDENT TEACHERS
EVALUATION OF SCIENTIFIC ATTITUDE AMONG STUDENT TEACHERS
 
Build Features, Not Apps
Build Features, Not AppsBuild Features, Not Apps
Build Features, Not Apps
 
Artificial inteligence by m.shahbaz ..
Artificial inteligence by m.shahbaz ..Artificial inteligence by m.shahbaz ..
Artificial inteligence by m.shahbaz ..
 
Presentación algoritmo
Presentación algoritmoPresentación algoritmo
Presentación algoritmo
 
Video Media
Video MediaVideo Media
Video Media
 
Presentació de la ponència.esc.coop.el puig
Presentació de la ponència.esc.coop.el puigPresentació de la ponència.esc.coop.el puig
Presentació de la ponència.esc.coop.el puig
 
Exercício contabilidade débito e crédito
Exercício contabilidade débito e créditoExercício contabilidade débito e crédito
Exercício contabilidade débito e crédito
 

Similar a Punta Dreamin 17 Generic Apex and Tooling Api

API Description Languages
API Description LanguagesAPI Description Languages
API Description LanguagesAkana
 
API Description Languages
API Description LanguagesAPI Description Languages
API Description LanguagesAkana
 
(ATS6-DEV02) Web Application Strategies
(ATS6-DEV02) Web Application Strategies(ATS6-DEV02) Web Application Strategies
(ATS6-DEV02) Web Application StrategiesBIOVIA
 
API workshop: Introduction to APIs (TC Camp)
API workshop: Introduction to APIs (TC Camp)API workshop: Introduction to APIs (TC Camp)
API workshop: Introduction to APIs (TC Camp)Tom Johnson
 
Create Salesforce online IDE in 30 minutes
Create Salesforce online IDE in 30 minutesCreate Salesforce online IDE in 30 minutes
Create Salesforce online IDE in 30 minutesJitendra Zaa
 
Lessons learned on the Azure API Stewardship Journey.pptx
Lessons learned on the Azure API Stewardship Journey.pptxLessons learned on the Azure API Stewardship Journey.pptx
Lessons learned on the Azure API Stewardship Journey.pptxapidays
 
API Description Languages: Which Is The Right One For Me?
 API Description Languages: Which Is The Right One For Me?  API Description Languages: Which Is The Right One For Me?
API Description Languages: Which Is The Right One For Me? ProgrammableWeb
 
Design for scale
Design for scaleDesign for scale
Design for scaleDoug Lampe
 
How to create custom dashboards in Elastic Search / Kibana with Performance V...
How to create custom dashboards in Elastic Search / Kibana with Performance V...How to create custom dashboards in Elastic Search / Kibana with Performance V...
How to create custom dashboards in Elastic Search / Kibana with Performance V...PerformanceVision (previously SecurActive)
 
API City 2019 Presentation - Delivering Developer Tools at Scale: Microsoft A...
API City 2019 Presentation - Delivering Developer Tools at Scale: Microsoft A...API City 2019 Presentation - Delivering Developer Tools at Scale: Microsoft A...
API City 2019 Presentation - Delivering Developer Tools at Scale: Microsoft A...Joe Levy
 
APIs distribuidos con alta escalabilidad
APIs distribuidos con alta escalabilidadAPIs distribuidos con alta escalabilidad
APIs distribuidos con alta escalabilidadSoftware Guru
 
Practices and tools for building better APIs
Practices and tools for building better APIsPractices and tools for building better APIs
Practices and tools for building better APIsNLJUG
 
Practices and tools for building better API (JFall 2013)
Practices and tools for building better API (JFall 2013)Practices and tools for building better API (JFall 2013)
Practices and tools for building better API (JFall 2013)Peter Hendriks
 
Lifecycle Management with SharePoint Apps and Solutions
Lifecycle Management with SharePoint Apps and SolutionsLifecycle Management with SharePoint Apps and Solutions
Lifecycle Management with SharePoint Apps and SolutionsSPC Adriatics
 
Sahi Principles and Architecture
Sahi Principles and ArchitectureSahi Principles and Architecture
Sahi Principles and ArchitectureTyto Software
 
Scaling with swagger
Scaling with swaggerScaling with swagger
Scaling with swaggerTony Tam
 

Similar a Punta Dreamin 17 Generic Apex and Tooling Api (20)

API Description Languages
API Description LanguagesAPI Description Languages
API Description Languages
 
API Description Languages
API Description LanguagesAPI Description Languages
API Description Languages
 
(ATS6-DEV02) Web Application Strategies
(ATS6-DEV02) Web Application Strategies(ATS6-DEV02) Web Application Strategies
(ATS6-DEV02) Web Application Strategies
 
API ARU-ARU
API ARU-ARUAPI ARU-ARU
API ARU-ARU
 
API workshop: Introduction to APIs (TC Camp)
API workshop: Introduction to APIs (TC Camp)API workshop: Introduction to APIs (TC Camp)
API workshop: Introduction to APIs (TC Camp)
 
Create Salesforce online IDE in 30 minutes
Create Salesforce online IDE in 30 minutesCreate Salesforce online IDE in 30 minutes
Create Salesforce online IDE in 30 minutes
 
Lessons learned on the Azure API Stewardship Journey.pptx
Lessons learned on the Azure API Stewardship Journey.pptxLessons learned on the Azure API Stewardship Journey.pptx
Lessons learned on the Azure API Stewardship Journey.pptx
 
API Description Languages: Which Is The Right One For Me?
 API Description Languages: Which Is The Right One For Me?  API Description Languages: Which Is The Right One For Me?
API Description Languages: Which Is The Right One For Me?
 
Design for scale
Design for scaleDesign for scale
Design for scale
 
REST APIs
REST APIsREST APIs
REST APIs
 
How to create custom dashboards in Elastic Search / Kibana with Performance V...
How to create custom dashboards in Elastic Search / Kibana with Performance V...How to create custom dashboards in Elastic Search / Kibana with Performance V...
How to create custom dashboards in Elastic Search / Kibana with Performance V...
 
API City 2019 Presentation - Delivering Developer Tools at Scale: Microsoft A...
API City 2019 Presentation - Delivering Developer Tools at Scale: Microsoft A...API City 2019 Presentation - Delivering Developer Tools at Scale: Microsoft A...
API City 2019 Presentation - Delivering Developer Tools at Scale: Microsoft A...
 
APIs distribuidos con alta escalabilidad
APIs distribuidos con alta escalabilidadAPIs distribuidos con alta escalabilidad
APIs distribuidos con alta escalabilidad
 
SGCE 2015 REST APIs
SGCE 2015 REST APIsSGCE 2015 REST APIs
SGCE 2015 REST APIs
 
Varun-CV-J
Varun-CV-JVarun-CV-J
Varun-CV-J
 
Practices and tools for building better APIs
Practices and tools for building better APIsPractices and tools for building better APIs
Practices and tools for building better APIs
 
Practices and tools for building better API (JFall 2013)
Practices and tools for building better API (JFall 2013)Practices and tools for building better API (JFall 2013)
Practices and tools for building better API (JFall 2013)
 
Lifecycle Management with SharePoint Apps and Solutions
Lifecycle Management with SharePoint Apps and SolutionsLifecycle Management with SharePoint Apps and Solutions
Lifecycle Management with SharePoint Apps and Solutions
 
Sahi Principles and Architecture
Sahi Principles and ArchitectureSahi Principles and Architecture
Sahi Principles and Architecture
 
Scaling with swagger
Scaling with swaggerScaling with swagger
Scaling with swagger
 

Más de Adam Olshansky

Apex Testing Deep Dive
Apex Testing Deep DiveApex Testing Deep Dive
Apex Testing Deep DiveAdam Olshansky
 
Maximize Apex Performance with Platform Cache
Maximize Apex Performance with Platform CacheMaximize Apex Performance with Platform Cache
Maximize Apex Performance with Platform CacheAdam Olshansky
 
Lightning Components 101: An Apex Developer's Guide
Lightning Components 101: An Apex Developer's GuideLightning Components 101: An Apex Developer's Guide
Lightning Components 101: An Apex Developer's GuideAdam Olshansky
 
Demystifying Code for Admins: The Last Step to Apex
Demystifying Code for Admins: The Last Step to ApexDemystifying Code for Admins: The Last Step to Apex
Demystifying Code for Admins: The Last Step to ApexAdam Olshansky
 
Force Academy LA Trigger Framework
Force Academy LA Trigger FrameworkForce Academy LA Trigger Framework
Force Academy LA Trigger FrameworkAdam Olshansky
 
Phx User Group Salesforce Connect
Phx User Group Salesforce ConnectPhx User Group Salesforce Connect
Phx User Group Salesforce ConnectAdam Olshansky
 

Más de Adam Olshansky (7)

Apex Testing Deep Dive
Apex Testing Deep DiveApex Testing Deep Dive
Apex Testing Deep Dive
 
Maximize Apex Performance with Platform Cache
Maximize Apex Performance with Platform CacheMaximize Apex Performance with Platform Cache
Maximize Apex Performance with Platform Cache
 
Lightning Components 101: An Apex Developer's Guide
Lightning Components 101: An Apex Developer's GuideLightning Components 101: An Apex Developer's Guide
Lightning Components 101: An Apex Developer's Guide
 
Demystifying Code for Admins: The Last Step to Apex
Demystifying Code for Admins: The Last Step to ApexDemystifying Code for Admins: The Last Step to Apex
Demystifying Code for Admins: The Last Step to Apex
 
Force Academy LA Trigger Framework
Force Academy LA Trigger FrameworkForce Academy LA Trigger Framework
Force Academy LA Trigger Framework
 
Blaze Your Trail
Blaze Your TrailBlaze Your Trail
Blaze Your Trail
 
Phx User Group Salesforce Connect
Phx User Group Salesforce ConnectPhx User Group Salesforce Connect
Phx User Group Salesforce Connect
 

Último

Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityWSO2
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontologyjohnbeverley2021
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 

Último (20)

Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 

Punta Dreamin 17 Generic Apex and Tooling Api

  • 2. Writing Highly Genericized Code Using Dynamic Apex and the Tooling API Adam Olshansky Salesforce Developer, Contractor at YouTube Salesforce MVP, 13X Certified AdamToArchitect.com @adam17amo
  • 3. ¡Estoy feliz de estar en Punta del Este!
  • 4. Agenda •  Overview of generic code for Apex •  Dynamic Code in Salesforce •  Tooling API
  • 6. What problems are we solving for? •  Rigid or fragile code •  Poor Reusability •  Lots of patches/quick fixes •  Duplicate code •  Overly complicated data structures •  Maps of maps of maps…
  • 7. Who are we talking to today? •  ISV developers •  Don’t know all conditions of customer orgs •  Individual app developers •  May need to accept input from clients/customers •  Any developer accepting user input •  Tailor your queries and results based on user conditions
  • 8. Different Ways of Writing Code: Static vs. Dynamic Static •  Generated at compile time •  Hard coded •  Doesn’t usually have dependencies •  Works well if you know what’s in the org •  Most commonly used by developers at a company developing for their own org Dynamic/Generic •  Generated at run time •  Dependent on user input •  May have org-specific dependencies •  Works well if you DON’T know what’s in the org •  Most commonly used by developers whose code needs to run in customized orgs
  • 9. 2 Different Ways of Writing Code
  • 10. Tradeoffs ​ Positives •  More detailed information •  Less chance of an error down the road •  Endless possibilities ​ Negatives •  More code to write •  More code to test •  Less readability
  • 11. Tools of the Trade
  • 12. Several Ways in Salesforce •  Custom Settings/Metadata •  Dynamic Apex •  Dynamic Visualforce •  Dynamic SOQL •  Limits class •  Schema class
  • 16. Dynamic SOQL •  Don’t always know what parameters are available in a user’s org •  In your org this will work •  What if your customer doesn’t have record types defined for Lead?
  • 17. Limits Class •  Limits.getDMLRows(); •  Limits.getDMLStatements(); •  Limits.getHeapSize(); •  Limits.getQueries(); •  Limits.getQueryRows(); •  bit.ly/apexlimitsclass (Apex Limits Class)
  • 18. Tooling API An API for building…Tools
  • 19. Tooling API Highlights •  Gather finely grained metadata about Apex classes, triggers, and tests in an org -  Classes, triggers, construction of symbol tables -  Query for code coverage, logs, SOQL results •  Query metadata about setup objects -  Business processes, flows, custom items, workflow components •  Can be utilized for source control/continuous integration -  Metadata containers, deployment details, code file metadata •  Can be queried through REST or SOAP •  Similar to Metadata API but with a ton of additional functionality ​ Great for building…tools!
  • 20. Our Scenario ​ UTILIZE DYNAMIC APEX TO WRITE APEX USING APEX! ​ APEX-CEPTION!!!
  • 21. Additional Tooling API Use Cases •  Show all objects that can be analyzed /services/data/v37.0/tooling/sobjects/ •  Show list of all classes /services/data/v37.0/tooling/apexManifest •  Show all metadata about a class /services/data/v37.0/tooling/sobjects/ApexClass/01po0000004SL5b
  • 22. Tools To Be Built •  UML Diagram Tool •  Symbol Table Visualizer •  Automated Testing Tools •  Tools to identify unused code •  Customize managed packages based on org’s config •  Use your imagination!
  • 24. Summary and Next Steps •  Be thinking about the right type of code for the app you’re building •  Write dynamic code •  Gather granular details to build any app •  Get out there and build!
  • 25. Where to Learn More •  Follow @andyinthecloud (Andy Fawcett, CTO Financial Force) •  Andy Fawcett’s Blog https://andyinthecloud.com/category/tooling-api/ •  Andy and James Loghry’s Apex Tooling API Wrapper: https://github.com/afawcett/apex-toolingapi/ •  Pat Patterson’s Java Tooling API Wrapper: https://github.com/metadaddy/force-tooling-demo https://developer.salesforce.com/blogs/developer-relations/2013/01/new-in-spring-13-the- tooling-api.html •  Tom Patros VF page Utilizing Symbol Tables: https://github.com/tompatros/df13-tooling-api-demo and http://www.redargyle.com/blog/tooling-around-tooling-api/
  • 27. Q&A