Apex Design Patterns

Harness the power of Apex design patterns to build robust and scalable code architectures on the Force.com platform

Apex Design Patterns

This ebook is included in a Mapt subscription
Jitendra Zaa, Anshul Verma

1 customer reviews
Harness the power of Apex design patterns to build robust and scalable code architectures on the Force.com platform
$0.00
$18.00
$44.99
$29.99p/m after trial
RRP $35.99
RRP $44.99
Subscription
eBook
Print + eBook
Start 30 Day Trial
Subscribe and access every Packt eBook & Video.
 
  • 5,000+ eBooks & Videos
  • 50+ New titles a month
  • 1 Free eBook/Video to keep every month
Start Free Trial
 
Preview in Mapt

Book Details

ISBN 139781782173656
Paperback256 pages

Book Description

Apex is an on-demand programming language providing a complete set of features for building business applications – including data models and objects to manage data. Apex being a proprietor programming language from Salesforce to be worked with multi tenant environment is a lot different than traditional OOPs languages like Java and C#. It acts as a workflow engine for managing collaboration of the data between users, a user interface model to handle forms and other interactions, and a SOAP API for programmatic access and integration.

Apex Design Patterns gives you an insight to several problematic situations that can arise while developing on Force.com platform and the usage of Design patterns to solve them. Packed with real life examples, it gives you a walkthrough from learning design patterns that Apex can offer us, to implementing the appropriate ones in your own application. Furthermore, we learn about the creational patterns that deal with object creation mechanism and structural patterns that helps to identify the relationship between entities. Also, the behavioural and concurrency patterns are put forward explaining the communication between objects and multi-threaded programming paradigm respectively. We later on, deal with the issues regarding structuring of classes, instantiating or how to give a dynamic behaviour at a runtime, with the help of anti-patterns. We learn the basic OOPs principal in polymorphic and modular way to enhance its capability. Also, best practices of writing Apex code are explained to differentiate between the implementation of appropriate patterns. This book will also explain some unique patterns that could be applied to get around governor limits.

By the end of this book, you will be a maestro in developing your applications on Force.com for Salesforce

Table of Contents

Chapter 1: An Introduction to Apex Design Pattern
Innovation
Design patterns and learning
Object-Oriented Programming (OOP)
OOPs in play
An interface
An abstract class
Advantages of design patterns
Design patterns and Apex
Gang of Four (GoF)
The SOLID principle
Summary
Chapter 2: Creational Patterns
Factory method pattern
Abstract factory pattern
The singleton pattern
The builder pattern
The prototype pattern
Summary
Chapter 3: Structural Patterns
The facade pattern
The adapter pattern
The bridge pattern
The composite pattern
The decorator pattern
The flyweight pattern
Summary
Chapter 4: Behavioral Patterns
The chain of responsibility pattern
The command pattern
The interpreter pattern
The iterator pattern
The visitor pattern
The memento pattern
The observer pattern
The state pattern 
The strategy pattern
Summary
Chapter 5: Handling Concurrency in Apex
Understanding concurrency issues
Reproducing concurrency problems in Apex
The active object pattern
Summary
Chapter 6: Anti-patterns and Best Practices
Over usage of formula fields
Functional decomposition
Ignoring the equals() and hashcode() methods while performing object comparison
Circular dependencies
The ignoring toString() method
Avoid the God class
Error hiding
Hard-coding
Magic strings and numbers
Inheritance hell
SOQL inside a loop
DML inside a loop
Summary

What You Will Learn

  • Apply OOPs principal in Apex to design a robust and efficient solution to address various facets to a business problem
  • Get to grips with the benefits and applicability of using different design patterns in Apex
  • Solve problems while instantiating, structuring and giving dynamic behavior to Apex classes
  • Understand the implementation of creational, structural, behavioral, concurrency and anti-patterns in your application
  • Follow the Apex best practices to resolve governor limit issues
  • Get clued up about the Inheritance, abstract classes, polymorphism in Apex to deal with the object mechanism
  • Master various design patterns and determine the best out of them
  • Explore the anti patterns that could not be applied to Apex and their appropriate solutions

Authors

Table of Contents

Chapter 1: An Introduction to Apex Design Pattern
Innovation
Design patterns and learning
Object-Oriented Programming (OOP)
OOPs in play
An interface
An abstract class
Advantages of design patterns
Design patterns and Apex
Gang of Four (GoF)
The SOLID principle
Summary
Chapter 2: Creational Patterns
Factory method pattern
Abstract factory pattern
The singleton pattern
The builder pattern
The prototype pattern
Summary
Chapter 3: Structural Patterns
The facade pattern
The adapter pattern
The bridge pattern
The composite pattern
The decorator pattern
The flyweight pattern
Summary
Chapter 4: Behavioral Patterns
The chain of responsibility pattern
The command pattern
The interpreter pattern
The iterator pattern
The visitor pattern
The memento pattern
The observer pattern
The state pattern 
The strategy pattern
Summary
Chapter 5: Handling Concurrency in Apex
Understanding concurrency issues
Reproducing concurrency problems in Apex
The active object pattern
Summary
Chapter 6: Anti-patterns and Best Practices
Over usage of formula fields
Functional decomposition
Ignoring the equals() and hashcode() methods while performing object comparison
Circular dependencies
The ignoring toString() method
Avoid the God class
Error hiding
Hard-coding
Magic strings and numbers
Inheritance hell
SOQL inside a loop
DML inside a loop
Summary

Book Details

ISBN 139781782173656
Paperback256 pages
Read More
From 1 reviews

Read More Reviews