public int process ( ) { // Calculate the result of the left operation if any if ( leftOperation != null ) { leftOperand = leftOperation . process ( ) ; } // Calculate the result of the right operation if any if ( rightOperation != null ) { rightOperand = rightOperation . process ( ) ; } // Process the operation itself after the composition resolution return calculate ( ) ; }
Process the operation and take care about the composition of the operations