Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] [DSF] FinalLaunchSequence extensibility

 On 26/07/2010 11:48 PM, Alena Laskavaia wrote:
I have another idea.
How about make FinalLaunchSequence an API where all steps "execute"
methods defined as protected methods with certain prefix.
The steps initialization function would form steps array by taking all
method of a current FinalLaunchSequence  class (which could be
overriden)
and instantiate  a Step classes with a method name as a parameter.
Order would be determined by method name. Execute function would call
a method using reflection.

Example:

protected void step_01_fetchGdbBackendService() {...}
...
protected void step_04_loadGdbInitFile(){...}

Client would override this and
1) to change step - override it
2) to remove step - override and make empty
3) to add step (for example between 3 and 4) add a method

protected void step_03_1_establishConnection(){...}


Old cut&  paste method would work too..


Now comments regarding "we never will able be fix it again":
a) For cdt implementation we can make another class that extends FLS
which is not an API - so we can do whatever we want there
b) We can add methods/steps in minor revision change releases
c) In maintenance release if we need to add a step (hell of bug fix)
we can always add private method, and make it protected later

step class for this would look like
FStep extends Step{
     FStep(String executeMethod) {
         this.method = excuteMethod;
     }
      public void execute(RequestMonitor requestMonitor) {
         call_method(method, requestMonitor);
     }
}

and
void protected initializeSteps
{
     String[] method = getSortedMethods();
     fSteps = new Steps[method.length];
     for (i=0;i<method.length;i++) {
        fSteps[i]=new FStep(method);
     }
}


Can you please clarify how can we change the order of existing steps?



Back to the top