{"id":20347930,"url":"https://github.com/quynhchi1009/prototype","last_synced_at":"2026-05-28T20:31:35.983Z","repository":{"id":150708795,"uuid":"574243236","full_name":"quynhchi1009/Prototype","owner":"quynhchi1009","description":"Prototype is a creational design pattern that lets you copy existing objects without making your code dependent on their classes.","archived":false,"fork":false,"pushed_at":"2022-12-04T21:21:18.000Z","size":2,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-04T16:14:10.443Z","etag":null,"topics":["abstract-class","design-patterns","java"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/quynhchi1009.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-12-04T21:16:28.000Z","updated_at":"2022-12-04T21:17:34.000Z","dependencies_parsed_at":null,"dependency_job_id":"fb7bd595-7fd5-46b4-9ee7-646926579c18","html_url":"https://github.com/quynhchi1009/Prototype","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/quynhchi1009/Prototype","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quynhchi1009%2FPrototype","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quynhchi1009%2FPrototype/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quynhchi1009%2FPrototype/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quynhchi1009%2FPrototype/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/quynhchi1009","download_url":"https://codeload.github.com/quynhchi1009/Prototype/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quynhchi1009%2FPrototype/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33626137,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-28T02:00:06.440Z","response_time":99,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["abstract-class","design-patterns","java"],"created_at":"2024-11-14T22:18:36.441Z","updated_at":"2026-05-28T20:31:35.954Z","avatar_url":"https://github.com/quynhchi1009.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Prototype\nPrototype is a creational design pattern that lets you copy existing objects without making your code dependent on their classes.\n\n- declares a common interface for all objects that support cloning\n\n    Circle(Circle source) {\n        super(source);\n        this.radius = source.radius;\n    }\n    \n    //The method clone() creates an object of the current class and carries over all of the field values of the old object into the new one. \n    public Shape clone() {\n        return new Circle(this);\n    }\n    \n- Prototype registry implementation with HashMap\n- when your code shouldn’t depend on the concrete classes of objects that you need to copy\n- when you want to reduce the number of subclasses that only differ in the way they initialize their respective objects\n\nPrototype:\n- isn’t based on inheritance, so it doesn’t have its drawbacks\n- requires a complicated initialization of the cloned object\nFactory Method:\n- is based on inheritance\n- doesn’t require an initialization step\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquynhchi1009%2Fprototype","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fquynhchi1009%2Fprototype","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquynhchi1009%2Fprototype/lists"}