You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
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
The text was updated successfully, but these errors were encountered: