SlideShare une entreprise Scribd logo
1  sur  13
Télécharger pour lire hors ligne
TerraSky Power Night 2013/12/05

Apex 10 Commandments
最初に自己紹介

やまむろ あつし

1
Apex 10 Commandments

2
#1 Thou shalt not put queries in for loops

3
#2 Thou shalt not put DML in for loops

4
#3 Thou shalt have a happy balance
between clicks & code

5
#4 Thou shalt only put one trigger per object

#5 Thou shalt not put code in triggers other than
calling methods and managing execution order

6
#6 Thou shalt utilize maps for queries
wherever possible

7
#7 Thou shalt make use of relationships to
reduce queries wherever possible

8
#8 Thou shalt aim for 100% test coverage

In general test your methods for:
 Positive effects.
• Given proper input it should act like this.

• Not just happy path, but all logic branches.

 Negative effects.
• Given bad data it should error like this.

 Role/Profile/User effects
• Given a user with X profile and Y role it should
act like this.
9
#9 Thou shalt write meaningful and useful tests

It’s not a test without assertions.
 Assert(A==B, “Reason for Assert failure”)

 AssertEquals(A,B, “Reason for Assert failure”)
 AssertNotEquals(A,B, “Reason for Assert
failure”)

10
#10 Thou shalt limit future calls and use
asynchronous code where possible
In general bias towards batch apex

 Ensure it runs as efficiently as possible.
 If you need @future methods.

11
#11 Research the session content beforehand
If you go to Dreamforce・・・

12

Contenu connexe

En vedette

5 TSPN_Write Apex and Visualforce Using Re-usable Patterns
5 TSPN_Write Apex and Visualforce Using Re-usable Patterns5 TSPN_Write Apex and Visualforce Using Re-usable Patterns
5 TSPN_Write Apex and Visualforce Using Re-usable PatternsTerraSky
 
5分で振り返る過去10回のdreamforce
5分で振り返る過去10回のdreamforce5分で振り返る過去10回のdreamforce
5分で振り返る過去10回のdreamforceJunji Imaoka
 
2 TSPN_Dreamforceに見たSalesforceが描く世界(大友)
2 TSPN_Dreamforceに見たSalesforceが描く世界(大友)2 TSPN_Dreamforceに見たSalesforceが描く世界(大友)
2 TSPN_Dreamforceに見たSalesforceが描く世界(大友)TerraSky
 
01 awsとsalesforceを使ったエコシステム ファイル編
01 awsとsalesforceを使ったエコシステム ファイル編01 awsとsalesforceを使ったエコシステム ファイル編
01 awsとsalesforceを使ったエコシステム ファイル編TerraSky
 
7 TSPN_次世代UIフレームワークについて
7 TSPN_次世代UIフレームワークについて7 TSPN_次世代UIフレームワークについて
7 TSPN_次世代UIフレームワークについてTerraSky
 
02 singletonとflyweightを使った省エネapex
02 singletonとflyweightを使った省エネapex02 singletonとflyweightを使った省エネapex
02 singletonとflyweightを使った省エネapexTerraSky
 

En vedette (6)

5 TSPN_Write Apex and Visualforce Using Re-usable Patterns
5 TSPN_Write Apex and Visualforce Using Re-usable Patterns5 TSPN_Write Apex and Visualforce Using Re-usable Patterns
5 TSPN_Write Apex and Visualforce Using Re-usable Patterns
 
5分で振り返る過去10回のdreamforce
5分で振り返る過去10回のdreamforce5分で振り返る過去10回のdreamforce
5分で振り返る過去10回のdreamforce
 
2 TSPN_Dreamforceに見たSalesforceが描く世界(大友)
2 TSPN_Dreamforceに見たSalesforceが描く世界(大友)2 TSPN_Dreamforceに見たSalesforceが描く世界(大友)
2 TSPN_Dreamforceに見たSalesforceが描く世界(大友)
 
01 awsとsalesforceを使ったエコシステム ファイル編
01 awsとsalesforceを使ったエコシステム ファイル編01 awsとsalesforceを使ったエコシステム ファイル編
01 awsとsalesforceを使ったエコシステム ファイル編
 
7 TSPN_次世代UIフレームワークについて
7 TSPN_次世代UIフレームワークについて7 TSPN_次世代UIフレームワークについて
7 TSPN_次世代UIフレームワークについて
 
02 singletonとflyweightを使った省エネapex
02 singletonとflyweightを使った省エネapex02 singletonとflyweightを使った省エネapex
02 singletonとflyweightを使った省エネapex
 

Similaire à 4 TSPN_Apex 10 Commandments

Salesforce Apex Ten Commandments
Salesforce Apex Ten CommandmentsSalesforce Apex Ten Commandments
Salesforce Apex Ten CommandmentsNetStronghold
 
Apex 10 commandments df14
Apex 10 commandments df14Apex 10 commandments df14
Apex 10 commandments df14James Loghry
 
Unit Testing and Behavior Driven Testing with AngularJS - Jesse Liberty | Fal...
Unit Testing and Behavior Driven Testing with AngularJS - Jesse Liberty | Fal...Unit Testing and Behavior Driven Testing with AngularJS - Jesse Liberty | Fal...
Unit Testing and Behavior Driven Testing with AngularJS - Jesse Liberty | Fal...FalafelSoftware
 
Helping Programmers Write Better Tests
Helping Programmers Write Better TestsHelping Programmers Write Better Tests
Helping Programmers Write Better TestsGeoffrey Dunn
 
Test-Driven Development
 Test-Driven Development  Test-Driven Development
Test-Driven Development Amir Assad
 
Effective Unit Testing
Effective Unit TestingEffective Unit Testing
Effective Unit TestingEyal Kenig
 
Shift-Left Testing: QA in a DevOps World by David Laulusa
Shift-Left Testing: QA in a DevOps World by David LaulusaShift-Left Testing: QA in a DevOps World by David Laulusa
Shift-Left Testing: QA in a DevOps World by David LaulusaQA or the Highway
 
Test Driven Development with Laravel
Test Driven Development with LaravelTest Driven Development with Laravel
Test Driven Development with LaravelTyler Johnston
 
assertYourself - Breaking the Theories and Assumptions of Unit Testing in Flex
assertYourself - Breaking the Theories and Assumptions of Unit Testing in FlexassertYourself - Breaking the Theories and Assumptions of Unit Testing in Flex
assertYourself - Breaking the Theories and Assumptions of Unit Testing in Flexmichael.labriola
 
TDD: seriously, try it! 
TDD: seriously, try it! TDD: seriously, try it! 
TDD: seriously, try it! Nacho Cougil
 
Developer Tests - Things to Know (Vilnius JUG)
Developer Tests - Things to Know (Vilnius JUG)Developer Tests - Things to Know (Vilnius JUG)
Developer Tests - Things to Know (Vilnius JUG)vilniusjug
 
Strategic Testing (CodeMash 2016)
Strategic Testing (CodeMash 2016)Strategic Testing (CodeMash 2016)
Strategic Testing (CodeMash 2016)Dmitry Sharkov
 
Software Testing Introduction (Part 1)
Software Testing Introduction (Part 1)Software Testing Introduction (Part 1)
Software Testing Introduction (Part 1)Thapar Institute
 
Your Tests Are Not Your Specs
Your Tests Are Not Your SpecsYour Tests Are Not Your Specs
Your Tests Are Not Your SpecsHillel Wayne
 
Getting started with Test Driven Development - Ferdous Mahmud Shaon
Getting started with Test Driven Development - Ferdous Mahmud ShaonGetting started with Test Driven Development - Ferdous Mahmud Shaon
Getting started with Test Driven Development - Ferdous Mahmud ShaonCefalo
 
Unit testing
Unit testingUnit testing
Unit testingPiXeL16
 
Getting started with Test Driven Development
Getting started with Test Driven DevelopmentGetting started with Test Driven Development
Getting started with Test Driven DevelopmentFerdous Mahmud Shaon
 

Similaire à 4 TSPN_Apex 10 Commandments (20)

The Apex Ten Commandments
The Apex Ten CommandmentsThe Apex Ten Commandments
The Apex Ten Commandments
 
Salesforce Apex Ten Commandments
Salesforce Apex Ten CommandmentsSalesforce Apex Ten Commandments
Salesforce Apex Ten Commandments
 
Apex 10 commandments df14
Apex 10 commandments df14Apex 10 commandments df14
Apex 10 commandments df14
 
Unit Testing and Behavior Driven Testing with AngularJS - Jesse Liberty | Fal...
Unit Testing and Behavior Driven Testing with AngularJS - Jesse Liberty | Fal...Unit Testing and Behavior Driven Testing with AngularJS - Jesse Liberty | Fal...
Unit Testing and Behavior Driven Testing with AngularJS - Jesse Liberty | Fal...
 
Helping Programmers Write Better Tests
Helping Programmers Write Better TestsHelping Programmers Write Better Tests
Helping Programmers Write Better Tests
 
Test-Driven Development
 Test-Driven Development  Test-Driven Development
Test-Driven Development
 
Effective Unit Testing
Effective Unit TestingEffective Unit Testing
Effective Unit Testing
 
Shift-Left Testing: QA in a DevOps World by David Laulusa
Shift-Left Testing: QA in a DevOps World by David LaulusaShift-Left Testing: QA in a DevOps World by David Laulusa
Shift-Left Testing: QA in a DevOps World by David Laulusa
 
Test Driven Development with Laravel
Test Driven Development with LaravelTest Driven Development with Laravel
Test Driven Development with Laravel
 
assertYourself - Breaking the Theories and Assumptions of Unit Testing in Flex
assertYourself - Breaking the Theories and Assumptions of Unit Testing in FlexassertYourself - Breaking the Theories and Assumptions of Unit Testing in Flex
assertYourself - Breaking the Theories and Assumptions of Unit Testing in Flex
 
Manual Testing.
Manual Testing.Manual Testing.
Manual Testing.
 
TDD: seriously, try it! 
TDD: seriously, try it! TDD: seriously, try it! 
TDD: seriously, try it! 
 
Developer Tests - Things to Know (Vilnius JUG)
Developer Tests - Things to Know (Vilnius JUG)Developer Tests - Things to Know (Vilnius JUG)
Developer Tests - Things to Know (Vilnius JUG)
 
Strategic Testing (CodeMash 2016)
Strategic Testing (CodeMash 2016)Strategic Testing (CodeMash 2016)
Strategic Testing (CodeMash 2016)
 
TDD Best Practices
TDD Best PracticesTDD Best Practices
TDD Best Practices
 
Software Testing Introduction (Part 1)
Software Testing Introduction (Part 1)Software Testing Introduction (Part 1)
Software Testing Introduction (Part 1)
 
Your Tests Are Not Your Specs
Your Tests Are Not Your SpecsYour Tests Are Not Your Specs
Your Tests Are Not Your Specs
 
Getting started with Test Driven Development - Ferdous Mahmud Shaon
Getting started with Test Driven Development - Ferdous Mahmud ShaonGetting started with Test Driven Development - Ferdous Mahmud Shaon
Getting started with Test Driven Development - Ferdous Mahmud Shaon
 
Unit testing
Unit testingUnit testing
Unit testing
 
Getting started with Test Driven Development
Getting started with Test Driven DevelopmentGetting started with Test Driven Development
Getting started with Test Driven Development
 

Plus de TerraSky

TerraSky PowerNight - Salesforce is ready for ERP -
TerraSky PowerNight - Salesforce is ready for ERP -TerraSky PowerNight - Salesforce is ready for ERP -
TerraSky PowerNight - Salesforce is ready for ERP -TerraSky
 
TerraSky PowerNight myEinstein
TerraSky PowerNight  myEinsteinTerraSky PowerNight  myEinstein
TerraSky PowerNight myEinsteinTerraSky
 
TerraSky PowerNight Soql performance explained
TerraSky PowerNight  Soql performance explainedTerraSky PowerNight  Soql performance explained
TerraSky PowerNight Soql performance explainedTerraSky
 
セールスフォース的開発メソッドのススメ 須山洋輔
セールスフォース的開発メソッドのススメ 須山洋輔セールスフォース的開発メソッドのススメ 須山洋輔
セールスフォース的開発メソッドのススメ 須山洋輔TerraSky
 
Xivelyで楽々IoT 岩井哲郎
Xivelyで楽々IoT 岩井哲郎Xivelyで楽々IoT 岩井哲郎
Xivelyで楽々IoT 岩井哲郎TerraSky
 
これだけは押さえておきたいDreamforceを楽しむための英語力 下川原章仁
これだけは押さえておきたいDreamforceを楽しむための英語力 下川原章仁これだけは押さえておきたいDreamforceを楽しむための英語力 下川原章仁
これだけは押さえておきたいDreamforceを楽しむための英語力 下川原章仁TerraSky
 
Dreamforce2016から読み解く、これからのit 大友幹
Dreamforce2016から読み解く、これからのit 大友幹Dreamforce2016から読み解く、これからのit 大友幹
Dreamforce2016から読み解く、これからのit 大友幹TerraSky
 
12 power night2014 miyanishi
12 power night2014 miyanishi12 power night2014 miyanishi
12 power night2014 miyanishiTerraSky
 
11 power nignt_furuta
11 power nignt_furuta11 power nignt_furuta
11 power nignt_furutaTerraSky
 
10 power night2014_uematsu
10 power night2014_uematsu10 power night2014_uematsu
10 power night2014_uematsuTerraSky
 
9 power night2014_iwai
9 power night2014_iwai9 power night2014_iwai
9 power night2014_iwaiTerraSky
 
8 power night2014_nakamura
8 power night2014_nakamura8 power night2014_nakamura
8 power night2014_nakamuraTerraSky
 
7 power night2014_kanbayashi
7 power night2014_kanbayashi7 power night2014_kanbayashi
7 power night2014_kanbayashiTerraSky
 
6 power night2014_sasaki
6 power night2014_sasaki6 power night2014_sasaki
6 power night2014_sasakiTerraSky
 
5 power night2014_totsuka
5 power night2014_totsuka5 power night2014_totsuka
5 power night2014_totsukaTerraSky
 
4 power night2014_yoshikawa
4 power night2014_yoshikawa4 power night2014_yoshikawa
4 power night2014_yoshikawaTerraSky
 
3 power nignt2014_yamamoto
3 power nignt2014_yamamoto3 power nignt2014_yamamoto
3 power nignt2014_yamamotoTerraSky
 
2 power night2014_erp
2 power night2014_erp2 power night2014_erp
2 power night2014_erpTerraSky
 
1 power night2014_imaoka
1 power night2014_imaoka1 power night2014_imaoka
1 power night2014_imaokaTerraSky
 
13 power nignt2014_yanase
13 power nignt2014_yanase13 power nignt2014_yanase
13 power nignt2014_yanaseTerraSky
 

Plus de TerraSky (20)

TerraSky PowerNight - Salesforce is ready for ERP -
TerraSky PowerNight - Salesforce is ready for ERP -TerraSky PowerNight - Salesforce is ready for ERP -
TerraSky PowerNight - Salesforce is ready for ERP -
 
TerraSky PowerNight myEinstein
TerraSky PowerNight  myEinsteinTerraSky PowerNight  myEinstein
TerraSky PowerNight myEinstein
 
TerraSky PowerNight Soql performance explained
TerraSky PowerNight  Soql performance explainedTerraSky PowerNight  Soql performance explained
TerraSky PowerNight Soql performance explained
 
セールスフォース的開発メソッドのススメ 須山洋輔
セールスフォース的開発メソッドのススメ 須山洋輔セールスフォース的開発メソッドのススメ 須山洋輔
セールスフォース的開発メソッドのススメ 須山洋輔
 
Xivelyで楽々IoT 岩井哲郎
Xivelyで楽々IoT 岩井哲郎Xivelyで楽々IoT 岩井哲郎
Xivelyで楽々IoT 岩井哲郎
 
これだけは押さえておきたいDreamforceを楽しむための英語力 下川原章仁
これだけは押さえておきたいDreamforceを楽しむための英語力 下川原章仁これだけは押さえておきたいDreamforceを楽しむための英語力 下川原章仁
これだけは押さえておきたいDreamforceを楽しむための英語力 下川原章仁
 
Dreamforce2016から読み解く、これからのit 大友幹
Dreamforce2016から読み解く、これからのit 大友幹Dreamforce2016から読み解く、これからのit 大友幹
Dreamforce2016から読み解く、これからのit 大友幹
 
12 power night2014 miyanishi
12 power night2014 miyanishi12 power night2014 miyanishi
12 power night2014 miyanishi
 
11 power nignt_furuta
11 power nignt_furuta11 power nignt_furuta
11 power nignt_furuta
 
10 power night2014_uematsu
10 power night2014_uematsu10 power night2014_uematsu
10 power night2014_uematsu
 
9 power night2014_iwai
9 power night2014_iwai9 power night2014_iwai
9 power night2014_iwai
 
8 power night2014_nakamura
8 power night2014_nakamura8 power night2014_nakamura
8 power night2014_nakamura
 
7 power night2014_kanbayashi
7 power night2014_kanbayashi7 power night2014_kanbayashi
7 power night2014_kanbayashi
 
6 power night2014_sasaki
6 power night2014_sasaki6 power night2014_sasaki
6 power night2014_sasaki
 
5 power night2014_totsuka
5 power night2014_totsuka5 power night2014_totsuka
5 power night2014_totsuka
 
4 power night2014_yoshikawa
4 power night2014_yoshikawa4 power night2014_yoshikawa
4 power night2014_yoshikawa
 
3 power nignt2014_yamamoto
3 power nignt2014_yamamoto3 power nignt2014_yamamoto
3 power nignt2014_yamamoto
 
2 power night2014_erp
2 power night2014_erp2 power night2014_erp
2 power night2014_erp
 
1 power night2014_imaoka
1 power night2014_imaoka1 power night2014_imaoka
1 power night2014_imaoka
 
13 power nignt2014_yanase
13 power nignt2014_yanase13 power nignt2014_yanase
13 power nignt2014_yanase
 

Dernier

Portal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russePortal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russe中 央社
 
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...CzechDreamin
 
AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101vincent683379
 
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptxWSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptxJennifer Lim
 
Demystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyDemystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyJohn Staveley
 
A Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System StrategyA Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System StrategyUXDXConf
 
ECS 2024 Teams Premium - Pretty Secure
ECS 2024   Teams Premium - Pretty SecureECS 2024   Teams Premium - Pretty Secure
ECS 2024 Teams Premium - Pretty SecureFemke de Vroome
 
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi IbrahimzadeFree and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi IbrahimzadeCzechDreamin
 
Intro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераIntro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераMark Opanasiuk
 
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlPeter Udo Diehl
 
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...marcuskenyatta275
 
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...panagenda
 
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...FIDO Alliance
 
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdfSimplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdfFIDO Alliance
 
Enterprise Knowledge Graphs - Data Summit 2024
Enterprise Knowledge Graphs - Data Summit 2024Enterprise Knowledge Graphs - Data Summit 2024
Enterprise Knowledge Graphs - Data Summit 2024Enterprise Knowledge
 
Powerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara LaskowskaPowerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara LaskowskaCzechDreamin
 
Easier, Faster, and More Powerful – Notes Document Properties Reimagined
Easier, Faster, and More Powerful – Notes Document Properties ReimaginedEasier, Faster, and More Powerful – Notes Document Properties Reimagined
Easier, Faster, and More Powerful – Notes Document Properties Reimaginedpanagenda
 
Designing for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at ComcastDesigning for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at ComcastUXDXConf
 
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
 

Dernier (20)

Portal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russePortal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russe
 
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
 
AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101
 
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptxWSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
 
Demystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyDemystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John Staveley
 
Overview of Hyperledger Foundation
Overview of Hyperledger FoundationOverview of Hyperledger Foundation
Overview of Hyperledger Foundation
 
A Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System StrategyA Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System Strategy
 
ECS 2024 Teams Premium - Pretty Secure
ECS 2024   Teams Premium - Pretty SecureECS 2024   Teams Premium - Pretty Secure
ECS 2024 Teams Premium - Pretty Secure
 
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi IbrahimzadeFree and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
 
Intro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераIntro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджера
 
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
 
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
 
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
 
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
 
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdfSimplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
 
Enterprise Knowledge Graphs - Data Summit 2024
Enterprise Knowledge Graphs - Data Summit 2024Enterprise Knowledge Graphs - Data Summit 2024
Enterprise Knowledge Graphs - Data Summit 2024
 
Powerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara LaskowskaPowerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara Laskowska
 
Easier, Faster, and More Powerful – Notes Document Properties Reimagined
Easier, Faster, and More Powerful – Notes Document Properties ReimaginedEasier, Faster, and More Powerful – Notes Document Properties Reimagined
Easier, Faster, and More Powerful – Notes Document Properties Reimagined
 
Designing for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at ComcastDesigning for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at Comcast
 
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...
 

4 TSPN_Apex 10 Commandments

  • 1. TerraSky Power Night 2013/12/05 Apex 10 Commandments
  • 4. #1 Thou shalt not put queries in for loops 3
  • 5. #2 Thou shalt not put DML in for loops 4
  • 6. #3 Thou shalt have a happy balance between clicks & code 5
  • 7. #4 Thou shalt only put one trigger per object #5 Thou shalt not put code in triggers other than calling methods and managing execution order 6
  • 8. #6 Thou shalt utilize maps for queries wherever possible 7
  • 9. #7 Thou shalt make use of relationships to reduce queries wherever possible 8
  • 10. #8 Thou shalt aim for 100% test coverage In general test your methods for:  Positive effects. • Given proper input it should act like this. • Not just happy path, but all logic branches.  Negative effects. • Given bad data it should error like this.  Role/Profile/User effects • Given a user with X profile and Y role it should act like this. 9
  • 11. #9 Thou shalt write meaningful and useful tests It’s not a test without assertions.  Assert(A==B, “Reason for Assert failure”)  AssertEquals(A,B, “Reason for Assert failure”)  AssertNotEquals(A,B, “Reason for Assert failure”) 10
  • 12. #10 Thou shalt limit future calls and use asynchronous code where possible In general bias towards batch apex  Ensure it runs as efficiently as possible.  If you need @future methods. 11
  • 13. #11 Research the session content beforehand If you go to Dreamforce・・・ 12