Your SlideShare is downloading. ×
  • Like
4 TSPN_Apex 10 Commandments
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Now you can save presentations on your phone or tablet

Available for both IPhone and Android

Text the download link to your phone

Standard text messaging rates apply

4 TSPN_Apex 10 Commandments

  • 703 views
Published

2013/12/05 開催のTerraSky Power Night のLT資料です。

2013/12/05 開催のTerraSky Power Night のLT資料です。

Published in Technology , Business
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
703
On SlideShare
0
From Embeds
0
Number of Embeds
5

Actions

Shares
Downloads
1
Comments
0
Likes
0

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. TerraSky Power Night 2013/12/05 Apex 10 Commandments
  • 2. 最初に自己紹介 やまむろ あつし 1
  • 3. Apex 10 Commandments 2
  • 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