-
Notifications
You must be signed in to change notification settings - Fork 761
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
Hello! Prototype Pattern is right? #14
Comments
That's what I thought.Sometimes,clone a object is more efficient than new,so we can use Prototype Pattern |
Wow, Time is getting too fast! I think this example actually is the factory pattern... |
yes,it is a factory pattern.And i write the ptototype pattern demo like this https://github.com/jacksplwxy/DesignPatterns_TypeScript/blob/master/src/Prototype%EF%BC%88%E5%8E%9F%E5%9E%8B%EF%BC%89/demo.ts. |
I done it with Typescript at last year too |
I think prototype pattern is reduce resource consumption.
Use
Object.create(Prototype.prototype)
wouldn't it be better?The text was updated successfully, but these errors were encountered: