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

missing fields in the Prototype Pattern #7

Open
borcun opened this issue Aug 27, 2023 · 0 comments
Open

missing fields in the Prototype Pattern #7

borcun opened this issue Aug 27, 2023 · 0 comments

Comments

@borcun
Copy link

borcun commented Aug 27, 2023

Hi Jakub,

It might be late, but helpful to anybody. The Prototype Pattern example seems like a factory pattern, at least I think so. Please, correct me if I am wrong.

The class that implements the Prototype Pattern should create an exact copy of the class instance, thus it means that you should not create a new empty object not including data members of the class and need a copy constructor. In your example, there is no data member in the class, but it might be meaningful if you put some there, in particular private or protected ones.

Regards

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

No branches or pull requests

1 participant