Example 4-4 Pseudo client code to invoke the interface from Example 4-3 on page115
...
float arg1 = 1;
float arg2 = 2;
float result = 0;
iCalculator2 objCalculator = new calculator();
result = objCalculator.add(arg1, arg2);
delete objCalculator;
assert(3 == result);
...
Figure 4-4 A stateless interface (implied)
Example4-5 illustrates an alternative pseudo interface definition. This definition
also implies a stateless interaction semantic between the client code that drives
the interface and the service code that implements the interface. This differs from
Example4-3 on page 115 in that it passes a
state object instance ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month, and much more.