2015-07-24 11:32:22 +03:00
|
|
|
package com.iluwatar.business.delegate;
|
2015-07-22 23:20:28 +03:00
|
|
|
|
2015-07-23 00:01:39 +03:00
|
|
|
/**
|
|
|
|
*
|
2015-08-18 21:40:11 +03:00
|
|
|
* BusinessDelegate separates the presentation and business tiers
|
2015-07-23 00:01:39 +03:00
|
|
|
*
|
|
|
|
*/
|
2015-07-22 23:20:28 +03:00
|
|
|
public class BusinessDelegate {
|
|
|
|
|
|
|
|
private BusinessLookup lookupService = new BusinessLookup();
|
|
|
|
private BusinessService businessService;
|
|
|
|
private ServiceType serviceType;
|
|
|
|
|
|
|
|
public void setServiceType(ServiceType serviceType) {
|
|
|
|
this.serviceType = serviceType;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void doTask() {
|
|
|
|
businessService = lookupService.getBusinessService(serviceType);
|
|
|
|
businessService.doProcessing();
|
|
|
|
}
|
|
|
|
}
|