September 2013
Intermediate to advanced
142 pages
2h 58m
English
We start our example with a service class in which the concerns are not separated. Then we will improve maintainability step-by-step, by first separating concerns and then programming to interface in order to make our modules loosely coupled. At the final point, we will have our first DI application. The source code for all the examples of this book is available for download on the publisher's website.
The main responsibility of this service is to send an e-mail using the information provided. In order to make the example simple and clear, client initialization is omitted.
class MailService { public void SendEmail(string address, string subject, string body) { var mail = new MailMessage(); mail.To.Add(address); mail.Subject ...Read now
Unlock full access