How to detect all possible code smells in a class diagram?

I am taking a course about detecting code smells and refactoring bad code. I came across the following class diagram which supposedly have some design/flaws and needs refactoring.

Class Diagram

So far, I have detected the following code smells:

  1. Remove Manager and Associate subclass. Justification - These subclasses do not provide any additional information.

  2. Inline class for Customer and Membership. Justification - Membership class lacks remove method, we would need to remove membership ID object when corresponding Customer object is deleted. I have same thinking process for add method but in doubt.

I have following three questions on this:

  1. Is my thinking process correct, specially regarding justifications?

  2. Are there any other code smells in the diagram?

  3. Is there a structured way/process to detect all code smells in a design/project/code?

0 ответов

Другие вопросы по тегам