Hello Jacky, thank you for your response. SRP is a concept where each class has only one reason to change. One of these reasons could be a usecase or an entity. If this one reason is only for a use case, it will indeed be more difficult to maintain because there are a lot of files. But if this one reason is an entity, it will be easier because the most important thing is that each entity is separate so that it doesn't create ambiguity when you want to change something. Imagine if email is a function in every class. When there is a change we have to change every existing class. But if the email is separate, then we only need to change the email class.

Fauzi Fadhlurrohman
Fauzi Fadhlurrohman

Written by Fauzi Fadhlurrohman

Hello there! I'm Fauzi Fadhlurrohman, a seasoned software engineer with a passion for crafting seamless digital experiences.

Responses (1)