Skip to content

Conversation

@shukebeta
Copy link

@shukebeta shukebeta commented Sep 26, 2021

Main issues found:

  • Shape class has too much responsibility, while Order class is too simple
  • Magic number and hard-coded strings everywhere
  • Inconsistent / unclear method names
  • Too many public methods, even they are only used internal
  • Too much duplicate code between classes
  • Using int type to save price is not wise
  • If you want to define a custom ToString method for a class, it should be an override one
  • No unit test to ensure the correctness of code

Though the project is programmed in OOP style, but the code mainly violates the following two design principals:

  • Single responsibility principle (good code should be high cohesion, lower coupling)
    • Shape class has too much responsibility, while Order class is too simple
  • Open/Close principle: When we add a new shape, we have to modify many places.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant