SLIDE 16 Introduction Service Component Architecture Service Data Objects Implementations Summary Overview SCA Component SCA Composite SCA Domain Example
Example with Java - IV
1 @Remotable 2 public interface CalculatorService { 3 String getResult(int n1 , int n2); 4 } 1 public class CalculatorServiceImpl implements CalculatorService { 2 3 @Property 4 public String myProperty ; 5 6 @Reference 7 private AddService addService ; 8 9 public String getResult(int n1 , int n2) { 10 // Note: no instantiation (e.g. addService = new AddServiceImpl ()) 11 return myProperty .concat(addService .add(n1 , n2)); 12 } 13 14 }
Marco Creola, 99-708-174 Service Component Architecture 16