Reputation: 689
Example 1:
You're designing an object and you put all the things and configurations required for it to work into the constructor call, so no additional calls needed after it initialized.
Example 2:
You have a Service responsible for a single Entity type, an EntityService. This is a single responsibility. If you then have to map the Entity to another class, you at first decide to use a separate mapper that is responsible to all the mappings in your programm. But then you're like "wait a minute, there is that whatchamacallit principle that commands me to rather gather all the actions related to that Entity class of mine in one place, so I'd better put the Entity class mapping inside the EntityService where it belongs".
So is there actually such a principle?
Upvotes: 0
Views: 31