Single Responsibility Principle

What is the Single Responsibility Principle?

How can we achieve the Single Responsibility Principle?

public class Invoice {    public void AddInvoice() { }    public void DeleteInvoice() { }    public void SendInvoiceEmail(MailMessage mailMessage) { }    public void ErrorLogging() { }}
public class ErrorLogger {   public void doErrorLogging() { }}
public class InvoiceEmail {   public void SendInvoiceEmail(MailMessage mailMessage) { }
}
public class Invoice {    public void AddInvoice() { }    public void DeleteInvoice() { }}

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Panchal Amit

Panchal Amit

📱 Android Engineer, 📝 Writer, 💻 Open Source Contributor, Techie, IoT, Interactive Projects, ☁ AWS, Google Cloud, Firebase, Python, React.