Expert Spring MVC and Web Flow

(Dana P.) #1
Listing 4-5.FlightLeg Class

public class FlightLeg {

private Airport departFrom;
private Date departOn;
private Airport arriveAt;
private Date arriveOn;

public FlightLeg(Airport departFrom, Date departOn, Airport arriveAt,
Date arriveOn) {
this.arriveAt = arriveAt;
this.arriveOn = arriveOn;
this.departFrom = departFrom;
this.departOn = departOn;
}

public Airport getArriveAt() {
return arriveAt;
}

public Date getArriveOn() {
return arriveOn;
}

public Date getDepartOn() {
return departOn;
}

public Airport getDepartFrom() {
return departFrom;
}

}

Service Interface
Once the domain model is flushed out, it is now time to define the service interface (see List-
ing 4-6). This interface provides easy access to the use cases through the façade pattern. These
methods are coarse grained and stateless (i.e., multiple calls into the methods may happen
concurrently without side effects). We say they are coarse grained to indicate that a single
method call will accomplish the use case, instead of many small calls.

48 CHAPTER 4 ■JUMP INTO SPRING MVC

Free download pdf