Chapter 3. Service Management Framework Runtime 55
Figure 3-6 Adding a package to the project
12.Enter the package name com.itso.rentals and click Finish. See Figure 3-7
on page 56.
56 WCTME: Application Development and Case Study
Figure 3-7 Naming the new package
13.Select the package just created, right-click. From the pop-up, menu select
New Class.
Chapter 3. Service Management Framework Runtime 57
Figure 3-8 Naming the new class
14.As in Figure 3-8, enter the name Customer, check the box next to
Constructors from superclass and click Finish.
15.Into the Customer.java window that opens, copy the following in Example 3-2:
Example 3-2 Customer information
public final static String PENDING = "pending";
public final static String ARRIVED = "arrived";
public final static String EXITED = "exited";
protected String contractID = "";
protected String customerID = "";
protected String firstName = "";
protected String lastName = "";
protected String flightInfo = "";
58 WCTME: Application Development and Case Study
protected String currentStatus = "";
protected String vehicleLocation = "";
16.Select the contractID field name, right-click, from the menu select Source
Generate Getter and Setter.... See Figure 3-9.
Figure 3-9 Generating methods
17.As in Figure 3-10 on page 59, check the box next to each of the protected
fields and click OK.
Chapter 3. Service Management Framework Runtime 59
Figure 3-10 Select the fields that you want getter and setter methods generated
18.For testing purposes, add the following code in Example 3-3 to the class:
Example 3-3 Sample code for the Customer Class
public Customer(String contract, String id, String first, String last,
String flight, String status, String slot) {
super();
contractID = contract;
customerID = id;
firstName = first;
lastName = last;
flightInfo = flight;
currentStatus = status;
vehicleLocation = slot;
}
public String toString() {
StringBuffer sb = new StringBuffer();
sb.append("Customer ");
sb.append(getFirstName());
sb.append(" ");

Get IBM Workplace Client Technology Micro Edition Version 5.7.1: Application Development and Case Study now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.