I have 4 classes which are dependent on each other and i am always running into circular dependencies which is causing the code not to compile. I have a controller which has a reference to a viewstatecontroller class which holds page data. I have a couple of processor classes which have a base called processor base. The processor class would handle page on load, prev and next methods. What is the sequence of flow in which salesforce compiles the classes?
Interface
public interface AB_Processor_INF
{
void setViewstateController(AB_ViewstateController controller);
PageReference page_next();
PageReference page_back();
void setPrimaryController(CTRL_AB_Prime pc);
void page_load();
}
Controller
public with sharing class CTRL_AB_Prime {
public CTRL_AB_Prime()
{
viewstateController = AB_ViewstateController.getInstance();
serviceController = AB_ServiceController.getInstance();
languageCode = 'EN';
}
}
Each page would call a processor class to handle page load, prev and next events
Processor class
public with sharing abstract class Proc_AB_Base implements AB_Processor_INF
{
public CTRL_AB_Prime primaryController;
public void setPrimaryController(CTRL_AB_Prime pc)
{
primaryController = pc;
}
}
Page specific processor class below..
public with sharing class Proc_ABOAQ extends Proc_AB_Base {
private static final Proc_ABOAQ instance = new Proc_ABOAQ();
private Proc_ABOAQ()
{
}
public static Proc_ABOAQ getInstance()
{
return instance;
}
public override PageReference page_back_processing()
{
return null;
}
public override PageReference page_next_processing()
{
}
}