Comp150CPA: Clouds and Power-Aware Computing
Classroom Exercise 4
Stubbing and binding
Spring 2011

group member 1: ____________________________ login: ______________

group member 2: ____________________________ login: ______________

group member 3: ____________________________ login: ______________

group member 4: ____________________________ login: ______________

group member 5: ____________________________ login: ______________

In class we have studied the concepts of binding, stubbing, and deferred development. Let's explore a bit more about these concepts.

  1. Although we have only studied the case in which one servlet service is defined in a project, there is no problem with creating multiple servlet services for one project. Why might you want to do this?

  2. Based upon the discussion of the User service, how would you store the preferences of a specific user, e.g., background color of the site?
  3. Suppose you are developing the SimplePersistence example and (justifiably) want to defer development of the PersistentThingServiceImpl class until later. Recall that the structure of this class is:
    public class PersistentThingServiceImpl 
        extends RemoteServiceServlet 
        implements PersistentThingService {
        static final long serialVersionUID=1;
        public String getThing(); 
        public String setThing(String s); 
        public String clearThing(); 
    Give a reasonable set of stubs for this class, and explain why using these stubs as temporary definitions of the methods allows debugging other classes before writing this one.

  4. Under what conditions is stubbing a class to defer development a bad idea?

  5. (Advanced) Why is it possible to define a servlet with a different relative web address than the address that the web server knows about?