I'm confused by the following code that I'm learning for my class. I'm wondering if someone could break down the following part for me, in an Explain Like I'm Five fashion:
(ICustomerSvc) factory.getService(ICustomerSvc.NAME);
Essentially, I'm confused as to why the ICustomerSvc
and ICustomerSvc.NAME
are in parentheses.
public void create (Customer cust) throws ServiceLoadException, CustomerSvcException {
Factory factory = Factory.getInstance();
ICustomerSvc custSvc = (ICustomerSvc) factory.getService(ICustomerSvc.NAME);
custSvc.store(cust);
}