Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Which SOLID principle is violated here?
- class EmailSender {
- public void sendEmail(String recipient, String message) {
- // Code to send email
- System.out.println("Sending email to: " + recipient);
- System.out.println("Message: " + message);
- }
- }
- class NotificationService {
- private EmailSender emailSender;
- public NotificationService() {
- emailSender = new EmailSender();
- }
- public void sendNotification(String recipient, String message) {
- emailSender.sendEmail(recipient, message);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement