SRP - Principle of Single Liability
Single Responsibility Principle (SRP), or, Single Responsibility Principle. This principle says that classes must be cohesive, that is, have a single responsibility. Classes like this tend to be more reusable, simpler, and propagate fewer changes to the rest of the system.
Therefore:
- Item
- Discount
- Save Data
- Reprogram Delivery
- Cancel
The method Cancel is part of the request.
The method Discount is part of the request.
The method Save data is part of the application, provided that it is specifically part of the application.
The method Addendum is part of the application, provided that it is specifically part of the application.
Reprogramming viola, this method should be within the delivery class, with the related order, and not within the order.
I closed it wide because without knowing the requirements there’s no way to know. Note that the two answers posted interpret differently, because the question gives room for this. I could answer that
SalvarDados()
is that it violates and would be right from a certain point of view.– Maniero