Closed xufei56789 closed 4 months ago
@iluwatar I think it would be best if we use Visitor Design Pattern
@iluwatar I believe the Factory design pattern better matches this business model (and if you plan on using encapsulation to determine the category of the object, this is the best pattern).
Take a look at this link for more information about Factory Pattern (https://refactoring.guru/design-patterns/factory-method)