April 2016
Intermediate to advanced
256 pages
4h 57m
English
There are multiple situations where the developer accidentally creates a circular dependency between Apex classes, triggers, or even in object relationships. There are a few programming languages that detect circular dependency between classes during compilation. Unfortunately, Apex can only generate errors at runtime.
We will understand circular dependency using the following two Apex classes:
public class ClassA { public ClassA(){ ClassB b = new ClassB(); System.debug('*** Class A Constructor '); } } public class ClassB { public ClassB() { ClassA a = new ClassA(); System.debug('*** Class B Constructor '); } }
As we can see in the preceding code, a constructor of Class A calls a constructor ...
Read now
Unlock full access