Home Page Icon
Home Page
Table of Contents for
Table of Contents
Close
Table of Contents
by Anshul Verma, Jitendra Zaa
Apex Design Patterns
Apex Design Patterns
Apex Design Patterns
Credits
About the Authors
About the Reviewer
www.PacktPub.com
eBooks, discount offers, and more
Why subscribe?
Free access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Downloading the color images of this book
Errata
Piracy
Questions
1. An Introduction to Apex Design Pattern
Innovation
Design patterns and learning
Object-Oriented Programming (OOP)
OOPs in play
Static and dynamic dispatch
An interface
An abstract class
Advantages of design patterns
Design patterns and Apex
Gang of Four (GoF)
The SOLID principle
The single responsibility principle (SRP)
The open closed principle (OCP)
The Liskov substitution principle (LSP)
The interface segregation principle (ISP)
The dependency inversion principle (DIP)
Summary
2. Creational Patterns
Factory method pattern
Reflection in Apex
Abstract factory pattern
A new perspective on the abstract factory pattern
The singleton pattern
The builder pattern
The difference between the abstract factory method and the builder pattern
The prototype pattern
The shallow and deep clone
Summary
3. Structural Patterns
The facade pattern
Other use cases
Points to consider
The adapter pattern
Points to consider
The bridge pattern
Points to consider
The composite pattern
Other use cases
Points to consider
The decorator pattern
Other use cases
Points to consider
The flyweight pattern
Other use cases
Points to consider
Summary
4. Behavioral Patterns
The chain of responsibility pattern
Points to consider
The command pattern
Some points to note
The interpreter pattern
Points to consider
The iterator pattern
Points to consider
The visitor pattern
Single dispatch
Double-dispatch
Guidelines to implementing the visitor pattern
Points to consider
The memento pattern
Points to consider
The observer pattern
Point to consider
The state pattern
Points to consider
The strategy pattern
Points to consider
Summary
5. Handling Concurrency in Apex
Understanding concurrency issues
Reproducing concurrency problems in Apex
The active object pattern
Points to consider
Summary
6. Anti-patterns and Best Practices
Over usage of formula fields
The deterministic formula field
The nondeterministic formula field
Functional decomposition
Ignoring the equals() and hashcode() methods while performing object comparison
Circular dependencies
Circular dependency in Apex classes
Circular dependency in triggers
Other examples
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
Search in book...
Toggle Font Controls
Playlists
Add To
Create new playlist
Name your new playlist
Playlist description (optional)
Cancel
Create playlist
Sign In
Email address
Password
Forgot Password?
Create account
Login
or
Continue with Facebook
Continue with Google
Sign Up
Full Name
Email address
Confirm Email Address
Password
Login
Create account
or
Continue with Facebook
Continue with Google
Prev
Previous Chapter
Cover
Next
Next Chapter
Apex Design Patterns
Table of Contents
Apex Design Patterns
Credits
About the Authors
About the Reviewer
www.PacktPub.com
eBooks, discount offers, and more
Why subscribe?
Free access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Downloading the color images of this book
Errata
Piracy
Questions
1. An Introduction to Apex Design Pattern
Innovation
Design patterns and learning
Object-Oriented Programming (OOP)
OOPs in play
Static and dynamic dispatch
An interface
An abstract class
Advantages of design patterns
Design patterns and Apex
Gang of Four (GoF)
The SOLID principle
The single responsibility principle (SRP)
The open closed principle (OCP)
The Liskov substitution principle (LSP)
The interface segregation principle (ISP)
The dependency inversion principle (DIP)
Summary
2. Creational Patterns
Factory method pattern
Reflection in Apex
Abstract factory pattern
A new perspective on the abstract factory pattern
The singleton pattern
The builder pattern
The difference between the abstract factory method and the builder pattern
The prototype pattern
The shallow and deep clone
Summary
3. Structural Patterns
The facade pattern
Other use cases
Points to consider
The adapter pattern
Points to consider
The bridge pattern
Points to consider
The composite pattern
Other use cases
Points to consider
The decorator pattern
Other use cases
Points to consider
The flyweight pattern
Other use cases
Points to consider
Summary
4. Behavioral Patterns
The chain of responsibility pattern
Points to consider
The command pattern
Some points to note
The interpreter pattern
Points to consider
The iterator pattern
Points to consider
The visitor pattern
Single dispatch
Double-dispatch
Guidelines to implementing the visitor pattern
Points to consider
The memento pattern
Points to consider
The observer pattern
Point to consider
The state pattern
Points to consider
The strategy pattern
Points to consider
Summary
5. Handling Concurrency in Apex
Understanding concurrency issues
Reproducing concurrency problems in Apex
The active object pattern
Points to consider
Summary
6. Anti-patterns and Best Practices
Over usage of formula fields
The deterministic formula field
The nondeterministic formula field
Functional decomposition
Ignoring the equals() and hashcode() methods while performing object comparison
Circular dependencies
Circular dependency in Apex classes
Circular dependency in triggers
Other examples
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
Add Highlight
No Comment
..................Content has been hidden....................
You can't read the all page of ebook, please click
here
login for view all page.
Day Mode
Cloud Mode
Night Mode
Reset