Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

May I ask what design pattern is best for this kind of business? #2873

Closed
xufei56789 opened this issue Mar 30, 2024 · 2 comments
Closed

May I ask what design pattern is best for this kind of business? #2873

xufei56789 opened this issue Mar 30, 2024 · 2 comments

Comments

@xufei56789
Copy link

未命名文件 (1)

@AritraThakurta
Copy link

@iluwatar I think it would be best if we use Visitor Design Pattern

@SahithyaCherukuri
Copy link

@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)

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

No branches or pull requests

4 participants