// the public method called by the driver public double DoSum(int theValue) { if (theComputer == null) { GenerateCode(theValue); } return(theComputer.ComputeSum()); }
// check if the interface is null // if so, call Setup. public double DoSum(int theValue) { if (theComputer == null) { GenerateCode(theValue); } // call the method through the interface return(theComputer.ComputeSum()); }