Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Episode 23 - Design Pattern 3

547 views

Published on

Part 3 of Apex Design Patterns in Salesforce

Published in: Education
  • Be the first to comment

  • Be the first to like this

Episode 23 - Design Pattern 3

  1. 1. Path to Code Begin Your Salesforce Coding Adventure
  2. 2. Episode 23 Design Pattern - Part 3
  3. 3. Jitendra Zaa Salesforce MVP Sr Technical Architect 23x Certified @Jitendra Zaa Speaker
  4. 4. Agenda • Structural Pattern • Q&A
  5. 5. Some House Rules • Please mute your mic • Keep adding questions in Zoom Q&A Window • No question is too small • Questions will be answered in last 15 mins
  6. 6. Gang of Four Patterns Creational Patterns Structural Behavioral 1. Abstract Factory 6. Adapter 13. Chain of responsibility 2. Builder 7. Bridge 14. Command 3. Factory Method 8. Composite 15. Intercepter 4. Prototype 9. Decorator 16. Iterator 5. Singleton 10. Facade 17. Mediator 11. Fly Weight 18. Memento 12. Proxy 19. Observer 20. State 21. Strategy 22. Template Method 23. Visitor
  7. 7. Structural Design Patterns Design patterns in this group focuses on how Classes can be structured.
  8. 8. Problem Apex Class needs to take Credit card information, check if its valid, perform transaction and save Subscription Id for future payments.
  9. 9. Initial Solution
  10. 10. Challenge • Sequence must be followed • Every Client / Apex class would need to make sure exact sequence is being followed properly. • Code is already written and Tested. Changing existing code might cause risk and regression testing.
  11. 11. Facade Pattern • Facade - Face of Building • Helps Encapsulate complex detail and provides simple interaction classes • Focuses on avoiding existing code change
  12. 12. Same Solution using Facade Pattern
  13. 13. Problem In Previous example - Currently payment is being done using Credit Card. What if we want to support more payment types like Debit Card, Paypal etc ?
  14. 14. Strategy Pattern Decide an Algorithm at run time.
  15. 15. Reference • Apex Design Patterns • SOLID Principle • Trigger Factory Pattern
  16. 16. Q&A
  17. 17. Next Episode 24 Open Q&A
  18. 18. Thanks

×