shop
shop copied to clipboard
Violations of solid
In this repository several very interesting design patterns are presented, and for educational purposes I was able to identify the violation of several SOLID principles:
Single Responsability Principle
This class could be in violation of the principle
https://github.com/RojerAlone/shop/blob/1161b7b7ad35fbe9afa156ab34f87c0bce065722/src/main/java/cn/cie/services/impl/KindServiceImpl.java#L1-L94
Maybe it could be solved like this
Open/Closed Principle
The principle is violated here:
https://github.com/RojerAlone/shop/blob/1161b7b7ad35fbe9afa156ab34f87c0bce065722/src/main/java/cn/cie/services/impl/UserServiceImpl.java#L1-L106
Maybe it could be solved like this
Interface Segregation Principle
The principle could be violated here:
https://github.com/RojerAlone/shop/blob/1161b7b7ad35fbe9afa156ab34f87c0bce065722/src/main/java/cn/cie/services/OrderService.java#L1-L68
https://github.com/RojerAlone/shop/blob/1161b7b7ad35fbe9afa156ab34f87c0bce065722/src/main/java/cn/cie/services/impl/OrderServiceImpl.java#L1-L165
The solution:
Dependency Inversion Principle
In this class, the principle is violated:
https://github.com/RojerAlone/shop/blob/1161b7b7ad35fbe9afa156ab34f87c0bce065722/src/main/java/cn/cie/services/impl/OrderServiceImpl.java#L1-L79
The possible solution: