This project is read-only.


The ListController and SaveController use the concrete ContactManagerRepository. They are tie to that concrete implementation. Replace ContactManagerRepository repository; by IContactManagerService contactService. Replace repository by contactService The 2 controllers now deal with service interface. The concrete implementation will be injected using constructor. Edit the ListController and SaveController so that their constructor takes the IContactManagerService as argument.

IContactManagerService contactService;

public SaveController(IContactManagerService service)
{
    //Injecting the service
    contactService = service;
}
//Service Interface
IContactManagerService contactService;

public ListController(IContactManagerService service)
{
    //Injecting the concrete implementation
    contactService = service;
}

Last edited Jun 23, 2009 at 12:13 AM by koossery, version 2

Comments

No comments yet.