{"id":4511,"date":"2023-03-08T21:44:06","date_gmt":"2023-03-08T20:44:06","guid":{"rendered":"https:\/\/rock-the-prototype.com\/uncategorized\/prototype-pattern\/"},"modified":"2023-12-22T08:25:01","modified_gmt":"2023-12-22T07:25:01","slug":"prototype-pattern","status":"publish","type":"encyclopedia","link":"https:\/\/rock-the-prototype.com\/en\/software-architecture\/prototype-pattern\/","title":{"rendered":"Prototype Pattern"},"content":{"rendered":"<p><\/p><div class=\"fusion-fullwidth fullwidth-box fusion-builder-row-1 fusion-flex-container nonhundred-percent-fullwidth non-hundred-percent-height-scrolling\" style=\"--awb-border-radius-top-left:0px;--awb-border-radius-top-right:0px;--awb-border-radius-bottom-right:0px;--awb-border-radius-bottom-left:0px;--awb-flex-wrap:wrap;\"><div class=\"fusion-builder-row fusion-row fusion-flex-align-items-flex-start fusion-flex-content-wrap\" style=\"max-width:1144px;margin-left: calc(-4% \/ 2 );margin-right: calc(-4% \/ 2 );\"><div class=\"fusion-layout-column fusion_builder_column fusion-builder-column-0 fusion_builder_column_1_1 1_1 fusion-flex-column\" style=\"--awb-bg-size:cover;--awb-width-large:100%;--awb-margin-top-large:0px;--awb-spacing-right-large:1.92%;--awb-margin-bottom-large:0px;--awb-spacing-left-large:1.92%;--awb-width-medium:100%;--awb-spacing-right-medium:1.92%;--awb-spacing-left-medium:1.92%;--awb-width-small:100%;--awb-spacing-right-small:1.92%;--awb-spacing-left-small:1.92%;\"><div class=\"fusion-column-wrapper fusion-flex-justify-content-flex-start fusion-content-layout-column\"><div class=\"fusion-text fusion-text-1\"><div id=\"ez-toc-container\" class=\"ez-toc-v2_0_86 counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Inhaltsverzeichnis<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #ffffff;color:#ffffff\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #ffffff;color:#ffffff\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/rock-the-prototype.com\/en\/software-architecture\/prototype-pattern\/#What_is_the_prototype_pattern\" >What is the prototype pattern?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/rock-the-prototype.com\/en\/software-architecture\/prototype-pattern\/#How_does_the_prototype_pattern_work\" >How does the prototype pattern work?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/rock-the-prototype.com\/en\/software-architecture\/prototype-pattern\/#Prototype_pattern_as_a_practical_example_in_JavaScript_code_%E2%80%93_explained_step_by_step\" >Prototype pattern as a practical example in JavaScript code &#8211; explained step by step<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/rock-the-prototype.com\/en\/software-architecture\/prototype-pattern\/#Step_1_We_create_a_prototype_object_for_each_type_of_spaceship_part\" >Step 1: We create a prototype object for each type of spaceship part<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/rock-the-prototype.com\/en\/software-architecture\/prototype-pattern\/#Step_2_%E2%80%93_We_create_a_factory_function\" >Step 2 &#8211; We create a factory function<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/rock-the-prototype.com\/en\/software-architecture\/prototype-pattern\/#Step_3_Apply_factory_function_and_create_prototypes\" >Step 3: Apply factory function and create prototypes<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/rock-the-prototype.com\/en\/software-architecture\/prototype-pattern\/#Step_4_Combining_the_prototype_parts\" >Step 4: Combining the prototype parts<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/rock-the-prototype.com\/en\/software-architecture\/prototype-pattern\/#Advantages_of_the_prototype_pattern\" >Advantages of the prototype pattern<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/rock-the-prototype.com\/en\/software-architecture\/prototype-pattern\/#Flexibility\" >Flexibility<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/rock-the-prototype.com\/en\/software-architecture\/prototype-pattern\/#Resource_efficiency\" >Resource efficiency<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/rock-the-prototype.com\/en\/software-architecture\/prototype-pattern\/#Scalability\" >Scalability<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/rock-the-prototype.com\/en\/software-architecture\/prototype-pattern\/#Encapsulation\" >Encapsulation<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/rock-the-prototype.com\/en\/software-architecture\/prototype-pattern\/#Our_code_challenge\" >Our code challenge!<\/a><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"What_is_the_prototype_pattern\"><\/span>What is the prototype pattern?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>The <strong><a href=\"https:\/\/rock-the-prototype.com\/en\/software-architecture\/prototype-pattern\/\" target=\"_blank\" title=\"The prototype pattern is a design pattern that enables the creation of new objects by cloning an existing object that serves as a prototype. Prototype patterns are a flexible and efficient method for creating new objects and at the same time promote the scalability and encapsulation of our code.\" class=\"encyclopedia\">prototype pattern<\/a><\/strong> is a <strong><a href=\"https:\/\/rock-the-prototype.com\/software-architektur\/design-pattern\/\" target=\"_blank\" rel=\"noopener\">design pattern<\/a><\/strong>&nbsp;that enables the <strong>creation of new objects<\/strong> by <strong>cloning an existing object<\/strong>, which is called a <strong><br>\n<a href=\"https:\/\/rock-the-prototype.com\/prototyping\/was-ist-ein-prototype\/\" target=\"_blank\" rel=\"noopener\">prototype<\/a><\/strong>&nbsp;serves as a prototype. In other words, the <a href=\"https:\/\/rock-the-prototype.com\/en\/learn-programming\/design-pattern\/\" target=\"_blank\" title=\"A design pattern is a design pattern for software as an abstract description. In programming, design patterns are usually object-oriented code drafts. Design patterns solve a class of problems.\" class=\"encyclopedia\">design pattern<\/a> involves creating a new object by copying an existing object rather than creating it from scratch.<\/p>\n\n<p>The <strong>prototype pattern<\/strong> is useful when <strong>the creation of new objects<\/strong> is <strong>expensive<\/strong> or when the <strong>creation process<\/strong> is <strong>complex<\/strong> and <strong>requires many resources<\/strong>. By using an <strong>existing object as a prototype<\/strong>, we can avoid the expensive creation process and simply clone the prototype to create a new object.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"How_does_the_prototype_pattern_work\"><\/span>How does the prototype pattern work?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>To implement the prototype pattern, a <strong>prototype object<\/strong> is first created, which serves as a <strong>blueprint for the creation of new objects<\/strong>. We then create new objects by cloning the prototype object, using either shallow or deep cloning techniques.<\/p>\n<p>With superficial cloning, a new object is created with the same values as the prototype object, but all objects referenced by the prototype object are shared by the new and the original object. Deep cloning, on the other hand, creates a completely new object with all its own references.<\/p>\n<p>By using the prototype pattern, we can reduce the complexity and cost of creating new objects while promoting the flexibility and scalability of our code.<\/p>\n<\/div><a class=\"fusion-modal-text-link\" data-toggle=\"modal\" data-target=\".fusion-modal.Spotify - ENGL - Trailer Rock the Prototype Podcast - Software development &amp; Prototyping\" href=\"#\"><iframe class=\"lazyload\" style=\"border-radius: 12px;\" src=\"data:image\/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%27100%27%20height%3D%27352%27%20viewBox%3D%270%200%20100%20352%27%3E%3Crect%20width%3D%27100%27%20height%3D%27352%27%20fill-opacity%3D%220%22%2F%3E%3C%2Fsvg%3E\" data-orig-src=\"https:\/\/open.spotify.com\/embed\/episode\/3MP9Gtj1JCsX5hw0zNfiwc?utm_source=generator\" width=\"100%\" height=\"352\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/a>\n<div class=\"fusion-text fusion-text-2\"><h2>Prototype pattern as a practical example in JavaScript code &ndash; explained step by step<\/h2>\n<p>The best way to illustrate this design pattern step-by-step is to use a practical code example that depicts a space scenario using simple JavaScript code.<\/p>\n<p>Let&rsquo;s say we want to develop a game in which the player can build his own spaceship by choosing different parts such as engines, weapons and hulls. Each part has its own characteristics, such as speed and durability, and the player can combine these parts to build a unique spaceship.<\/p>\n<p>To implement this game, we can use the prototype pattern as follows:<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Step_1_We_create_a_prototype_object_for_each_type_of_spaceship_part\"><\/span>Step 1: We create a prototype object for each type of spaceship part<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Create this <strong>prototype object<\/strong> for each type of <strong>spaceship part (engine, weapon, hull)<\/strong> with its own properties and methods:<\/p>\n<\/div><a class=\"fusion-modal-text-link\" data-toggle=\"modal\" data-target=\".fusion-modal.Prototype Pattern: Wir erstellen ein Prototype-Objekt f&uuml;r jeden Typ von Raumschiffteil\" href=\"#\"><script src=\"https:\/\/gist.github.com\/Sascha-Block\/99c65c2120420ab7943b03477be2d33d.js\"><\/script><\/a><div class=\"fusion-text fusion-text-3\"><h2>Step 2 &ndash; We create a factory function<\/h2>\n<p>We create a <strong>factory function<\/strong> that can generate new spaceship parts by <strong>cloning the prototype objects<\/strong>. You can see how cloning objects in JavaScript code works here:<\/p>\n<\/div><a class=\"fusion-modal-text-link\" data-toggle=\"modal\" data-target=\".fusion-modal.Factory Function als Bestandteil des Prototype-Pattern\" href=\"#\"><script src=\"https:\/\/gist.github.com\/Sascha-Block\/b17b7223059f2a7065c8192267d07e03.js\"><\/script><\/a><div class=\"fusion-text fusion-text-4\"><h3><span class=\"ez-toc-section\" id=\"Step_3_Apply_factory_function_and_create_prototypes\"><\/span>Step 3: Apply factory function and create prototypes<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>We use our <strong>factory function<\/strong> to create new spaceship parts by <strong>selecting<\/strong> the <strong>desired prototype<\/strong> and <strong>adjusting<\/strong> its <strong>properties as required<\/strong>.<\/p>\n<\/div><a class=\"fusion-modal-text-link\" data-toggle=\"modal\" data-target=\".fusion-modal.Prototype Pattern - Prototypen mit einer Factory Function erstellen\" href=\"#\"><script src=\"https:\/\/gist.github.com\/Sascha-Block\/a50a54b7112d5e5d52ffd1f7cf29c5c9.js\"><\/script><\/a><div class=\"fusion-text fusion-text-5\"><h3><span class=\"ez-toc-section\" id=\"Step_4_Combining_the_prototype_parts\"><\/span>Step 4: Combining the prototype parts<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>We combine the parts to create a new spaceship object:<\/p>\n<\/div><a class=\"fusion-modal-text-link\" data-toggle=\"modal\" data-target=\".fusion-modal.Prototype Pattern - Kombination von Prototype Teilen um neue Objekte von Raumschiffen zu erstellen\" href=\"#\"><script src=\"https:\/\/gist.github.com\/Sascha-Block\/7cdc8a9a88ddf0288f65285aa29aedf8.js\"><\/script><\/a><div class=\"fusion-text fusion-text-6\"><p>In this <strong><a href=\"https:\/\/rock-the-prototype.com\/en\/learn-programming\/programming\/\" target=\"_blank\" title=\"What is programming? When programming, a programmer creates a software program that can run on a machine. The code is created in one of the formally defined computer languages - which are countless, such as Java, PHP, C++ or C#, Perl and many many more.\" class=\"encyclopedia\">programming<\/a> example in JavaScript<\/strong>, we used the <strong>prototype pattern<\/strong> to create new spaceship parts by <strong>cloning prototype objects<\/strong>and <strong>customizing<\/strong> their <strong>properties<\/strong>.<\/p>\n<p>This way, we didn&rsquo;t have to create every part from scratch, which <strong>saves time and resources<\/strong>.<\/p>\n<p>In addition, <strong>by combining the parts<\/strong> we have created a <strong>unique spaceship object with its own methods<\/strong> of <em>flying<\/em>, <em>shooting<\/em> and <em>repairing<\/em>.<\/p>\n<\/div><a class=\"fusion-modal-text-link\" data-toggle=\"modal\" data-target=\".fusion-modal.iTUNES - ENGL - Trailer - Rock the Prototype - Software development &amp; Prototyping\" href=\"#\"><iframe style=\"width: 100%; max-width: 660px; overflow: hidden; border-radius: 10px;\" src=\"https:\/\/embed.podcasts.apple.com\/us\/podcast\/rock-the-prototype-software-development-prototyping\/id1684835330?i=1000610789144\" height=\"175\" frameborder=\"0\" sandbox=\"allow-forms allow-popups allow-same-origin allow-scripts allow-storage-access-by-user-activation allow-top-navigation-by-user-activation\"><\/iframe><\/a>\n<div class=\"fusion-text fusion-text-7\"><h2><span class=\"ez-toc-section\" id=\"Advantages_of_the_prototype_pattern\"><\/span>Advantages of the prototype pattern<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Using the prototype pattern in this room scenario offers you several advantages:<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Flexibility\"><\/span>Flexibility<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>With the prototype pattern, we can easily create new spaceship parts by cloning existing prototypes and customizing their properties as needed. This makes it easy to add new parts or change existing ones without having to create them from scratch.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Resource_efficiency\"><\/span>Resource efficiency<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Using the prototype pattern avoids the need to create new objects from scratch, which can be time-consuming and resource-intensive. Instead, an existing prototype is simply cloned, which saves time and resources.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Scalability\"><\/span>Scalability<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>The prototype pattern makes it easy to create multiple instances of an object with different configurations so that we can scale our application as needed.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Encapsulation\"><\/span>Encapsulation<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>By encapsulating the creation process in a factory function, we can hide the details of object creation from the rest of our code, making it easier to maintain and update.<\/p>\n<p>As programmers, we can make use of the <strong>prototypical approach<\/strong> and the associated advantages in a variety of ways. For example, we can use the prototype pattern to:<\/p>\n<ul>\n<li>Create new objects with similar properties and behaviors without duplicating code<\/li>\n<li>Implementation of object pools to reuse existing objects and reduce memory consumption<\/li>\n<li>Adapt objects at runtime by changing their properties and behaviors<\/li>\n<li>Create complex objects by assembling simpler objects<\/li>\n<\/ul>\n<p>To summarize, the prototype pattern is a flexible and efficient way to create new objects while promoting scalability and encapsulation of our code. For software developers, this design pattern provides an easy-to-use way to <strong>simplify<\/strong> <strong>object creation<\/strong>, <strong>reduce<\/strong> <strong>code duplication<\/strong> and <strong>create<\/strong> <strong>more complex and dynamic applications<\/strong>.<\/p>\n<\/div><div class=\"fusion-text fusion-text-8\"><h2><span class=\"ez-toc-section\" id=\"Our_code_challenge\"><\/span>Our code challenge!<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Welcome to the <strong>intergalactic spaceship design challenge<\/strong>!<\/p>\n<p><em>Your chance:<\/em><\/p>\n<p>As a <strong>spaceship designer<\/strong>, your task is to design a new <strong>prototype spaceship<\/strong> that can explore the vastness of the galaxy. The prototype should consist of three parts: a drive, a weapon and a hull, each with its own characteristics and behavior.<\/p>\n<p>Your task is to create the prototype using the &ldquo;Prototype&rdquo; pattern and customize its parts with unique configurations. Once you have created the prototype, you should test it by flying through space, firing weapons and repairing the hull.<\/p>\n<p>To make it easier for you to get started, we have created a basic prototype for each part. Your task is to create new prototypes by cloning the existing ones and changing their properties and behavior as needed.<\/p>\n<p>Here are the basic prototypes:<\/p>\n<\/div><a class=\"fusion-modal-text-link\" data-toggle=\"modal\" data-target=\".fusion-modal.Code Challenge - Create a Prototype Pattern for a Space Challenge! \" href=\"#\"><script src=\"https:\/\/gist.github.com\/Sascha-Block\/67ea785a686685d10bc325f01497b873.js\"><\/script><\/a><div class=\"fusion-text fusion-text-9\"><p>To create <strong>new prototypes<\/strong>, you should use the <strong>prototype pattern <\/strong>by cloning an existing prototype and adjusting its properties and behaviors as needed.<\/p>\n<p><em>Here is an example in JavaScript for the creation of a new motor prototype:<\/em><\/p>\n<\/div><a class=\"fusion-modal-text-link\" data-toggle=\"modal\" data-target=\".fusion-modal.Code-Beispiel zum Klonen von Prototypen\" href=\"#\"><script src=\"https:\/\/gist.github.com\/Sascha-Block\/f9857243bf6f6cd0eed71b8f1c292524.js\"><\/script><\/a><div class=\"fusion-text fusion-text-10\"><p>In this code example, we clone the <em>enginePrototype object<\/em> with <em>Object.create()<\/em> and then adjust its type and speed properties.<\/p>\n<p>Once you have created the new prototypes, you should create a new spaceship object by combining the parts and adding some methods for flying, shooting and repairing.<\/p>\n<p><span style=\"color: #00ffff;\"><br>\n<strong>Your code challenge<\/strong><br>\n<\/span> is to <strong>create your own new prototypes<\/strong>, customize them with unique configurations, and create a new spaceship prototype using your own methods for flying, shooting, and repairing.<\/p>\n<p>Once you have created your prototype, test it by flying through space, firing weapons and repairing the hull.<\/p>\n<p><strong>Are you ready for the challenge? <span style=\"color: #00ffff;\">Get ready to set off into the vastness of the galaxy!<\/span><\/strong><\/p>\n<\/div><\/div><\/div><\/div><\/div><div class=\"fusion-fullwidth fullwidth-box fusion-builder-row-2 fusion-flex-container has-pattern-background has-mask-background nonhundred-percent-fullwidth non-hundred-percent-height-scrolling\" style=\"--awb-border-radius-top-left:0px;--awb-border-radius-top-right:0px;--awb-border-radius-bottom-right:0px;--awb-border-radius-bottom-left:0px;--awb-flex-wrap:wrap;\"><div class=\"fusion-builder-row fusion-row fusion-flex-align-items-flex-start fusion-flex-content-wrap\" style=\"max-width:1144px;margin-left: calc(-4% \/ 2 );margin-right: calc(-4% \/ 2 );\"><div class=\"fusion-layout-column fusion_builder_column fusion-builder-column-1 fusion_builder_column_1_1 1_1 fusion-flex-column\" style=\"--awb-bg-size:cover;--awb-width-large:100%;--awb-margin-top-large:0px;--awb-spacing-right-large:1.92%;--awb-margin-bottom-large:0px;--awb-spacing-left-large:1.92%;--awb-width-medium:100%;--awb-order-medium:0;--awb-spacing-right-medium:1.92%;--awb-spacing-left-medium:1.92%;--awb-width-small:100%;--awb-order-small:0;--awb-spacing-right-small:1.92%;--awb-spacing-left-small:1.92%;\"><div class=\"fusion-column-wrapper fusion-column-has-shadow fusion-flex-justify-content-flex-start fusion-content-layout-column\"><a class=\"fusion-modal-text-link\" data-toggle=\"modal\" data-target=\".fusion-modal.Rock the Prototype - Software development &amp; Prototyping Podcast iTunes\" href=\"#\"><iframe id=\"embedPlayer\" style=\"width: 100%; max-width: 660px; overflow: hidden; border-radius: 10px; transform: translateZ(0px); animation: 2s ease 0s 6 normal none running loading-indicator; background-color: #e4e4e4;\" src=\"https:\/\/embed.podcasts.apple.com\/us\/podcast\/rock-the-prototype-software-development-prototyping\/id1684835330?itsct=podcast_box_player&amp;itscg=30200&amp;ls=1&amp;theme=auto\" height=\"450px\" frameborder=\"0\" sandbox=\"allow-forms allow-popups allow-same-origin allow-scripts allow-top-navigation-by-user-activation\"><\/iframe><\/a><\/div><\/div><\/div><\/div>\n\n","protected":false},"excerpt":{"rendered":"<p>The prototype pattern is a design pattern that enables the creation of new objects by cloning an existing object that serves as a prototype. Prototype patterns are a flexible and efficient method for creating new objects and at the same time promote the scalability and encapsulation of our code.<\/p>\n","protected":false},"author":1,"featured_media":3499,"template":"","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0},"categories":[1166],"tags":[1144,1169,1296,1464,1142,1147,1148],"class_list":["post-4511","encyclopedia","type-encyclopedia","status-publish","has-post-thumbnail","hentry","category-software-architecture","tag-design-pattern-en","tag-javascript-en","tag-mvp-en","tag-object-orientation","tag-programming","tag-software-architecture","tag-software-development"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Prototype Pattern - Design patterns for clever software development!<\/title>\n<meta name=\"description\" content=\"What is the prototype pattern? How do prototype patterns work? All the advantages of the design pattern explained in an easy-to-understand way with code examples\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/rock-the-prototype.com\/en\/software-architecture\/prototype-pattern\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Prototype Pattern - Design patterns for clever software development!\" \/>\n<meta property=\"og:description\" content=\"What is the prototype pattern? How do prototype patterns work? All the advantages of the design pattern explained in an easy-to-understand way with code examples\" \/>\n<meta property=\"og:url\" content=\"https:\/\/rock-the-prototype.com\/en\/software-architecture\/prototype-pattern\/\" \/>\n<meta property=\"og:site_name\" content=\"Rock the Prototype - Softwareentwicklung &amp; Prototyping\" \/>\n<meta property=\"article:modified_time\" content=\"2023-12-22T07:25:01+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/rock-the-prototype.com\/wp-content\/uploads\/2023\/03\/Prototype-Pattern_Rock_the_Prototype.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1280\" \/>\n\t<meta property=\"og:image:height\" content=\"524\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/rock-the-prototype.com\\\/en\\\/software-architecture\\\/prototype-pattern\\\/\",\"url\":\"https:\\\/\\\/rock-the-prototype.com\\\/en\\\/software-architecture\\\/prototype-pattern\\\/\",\"name\":\"Prototype Pattern - Design patterns for clever software development!\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/rock-the-prototype.com\\\/en\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/rock-the-prototype.com\\\/en\\\/software-architecture\\\/prototype-pattern\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/rock-the-prototype.com\\\/en\\\/software-architecture\\\/prototype-pattern\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/rock-the-prototype.com\\\/wp-content\\\/uploads\\\/2023\\\/03\\\/Prototype-Pattern_Rock_the_Prototype.jpg\",\"datePublished\":\"2023-03-08T20:44:06+00:00\",\"dateModified\":\"2023-12-22T07:25:01+00:00\",\"description\":\"What is the prototype pattern? How do prototype patterns work? All the advantages of the design pattern explained in an easy-to-understand way with code examples\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/rock-the-prototype.com\\\/en\\\/software-architecture\\\/prototype-pattern\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/rock-the-prototype.com\\\/en\\\/software-architecture\\\/prototype-pattern\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/rock-the-prototype.com\\\/en\\\/software-architecture\\\/prototype-pattern\\\/#primaryimage\",\"url\":\"https:\\\/\\\/rock-the-prototype.com\\\/wp-content\\\/uploads\\\/2023\\\/03\\\/Prototype-Pattern_Rock_the_Prototype.jpg\",\"contentUrl\":\"https:\\\/\\\/rock-the-prototype.com\\\/wp-content\\\/uploads\\\/2023\\\/03\\\/Prototype-Pattern_Rock_the_Prototype.jpg\",\"width\":1280,\"height\":524,\"caption\":\"Prototype-Pattern - Rock the Prototype\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/rock-the-prototype.com\\\/en\\\/software-architecture\\\/prototype-pattern\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Startseite\",\"item\":\"https:\\\/\\\/rock-the-prototype.com\\\/en\\\/rock-the-prototype\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Prototyping Wiki\",\"item\":\"https:\\\/\\\/rock-the-prototype.com\\\/en\\\/wiki\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Prototype Pattern\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/rock-the-prototype.com\\\/en\\\/#website\",\"url\":\"https:\\\/\\\/rock-the-prototype.com\\\/en\\\/\",\"name\":\"Rock the Prototype - Softwareentwicklung &amp; Prototyping\",\"description\":\"Prototyping: Software Prototypen, Software entwickeln &amp; Programmieren im Team\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/rock-the-prototype.com\\\/en\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Prototype Pattern - Design patterns for clever software development!","description":"What is the prototype pattern? How do prototype patterns work? All the advantages of the design pattern explained in an easy-to-understand way with code examples","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/rock-the-prototype.com\/en\/software-architecture\/prototype-pattern\/","og_locale":"en_US","og_type":"article","og_title":"Prototype Pattern - Design patterns for clever software development!","og_description":"What is the prototype pattern? How do prototype patterns work? All the advantages of the design pattern explained in an easy-to-understand way with code examples","og_url":"https:\/\/rock-the-prototype.com\/en\/software-architecture\/prototype-pattern\/","og_site_name":"Rock the Prototype - Softwareentwicklung &amp; Prototyping","article_modified_time":"2023-12-22T07:25:01+00:00","og_image":[{"width":1280,"height":524,"url":"https:\/\/rock-the-prototype.com\/wp-content\/uploads\/2023\/03\/Prototype-Pattern_Rock_the_Prototype.jpg","type":"image\/jpeg"}],"twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/rock-the-prototype.com\/en\/software-architecture\/prototype-pattern\/","url":"https:\/\/rock-the-prototype.com\/en\/software-architecture\/prototype-pattern\/","name":"Prototype Pattern - Design patterns for clever software development!","isPartOf":{"@id":"https:\/\/rock-the-prototype.com\/en\/#website"},"primaryImageOfPage":{"@id":"https:\/\/rock-the-prototype.com\/en\/software-architecture\/prototype-pattern\/#primaryimage"},"image":{"@id":"https:\/\/rock-the-prototype.com\/en\/software-architecture\/prototype-pattern\/#primaryimage"},"thumbnailUrl":"https:\/\/rock-the-prototype.com\/wp-content\/uploads\/2023\/03\/Prototype-Pattern_Rock_the_Prototype.jpg","datePublished":"2023-03-08T20:44:06+00:00","dateModified":"2023-12-22T07:25:01+00:00","description":"What is the prototype pattern? How do prototype patterns work? All the advantages of the design pattern explained in an easy-to-understand way with code examples","breadcrumb":{"@id":"https:\/\/rock-the-prototype.com\/en\/software-architecture\/prototype-pattern\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/rock-the-prototype.com\/en\/software-architecture\/prototype-pattern\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/rock-the-prototype.com\/en\/software-architecture\/prototype-pattern\/#primaryimage","url":"https:\/\/rock-the-prototype.com\/wp-content\/uploads\/2023\/03\/Prototype-Pattern_Rock_the_Prototype.jpg","contentUrl":"https:\/\/rock-the-prototype.com\/wp-content\/uploads\/2023\/03\/Prototype-Pattern_Rock_the_Prototype.jpg","width":1280,"height":524,"caption":"Prototype-Pattern - Rock the Prototype"},{"@type":"BreadcrumbList","@id":"https:\/\/rock-the-prototype.com\/en\/software-architecture\/prototype-pattern\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Startseite","item":"https:\/\/rock-the-prototype.com\/en\/rock-the-prototype\/"},{"@type":"ListItem","position":2,"name":"Prototyping Wiki","item":"https:\/\/rock-the-prototype.com\/en\/wiki\/"},{"@type":"ListItem","position":3,"name":"Prototype Pattern"}]},{"@type":"WebSite","@id":"https:\/\/rock-the-prototype.com\/en\/#website","url":"https:\/\/rock-the-prototype.com\/en\/","name":"Rock the Prototype - Softwareentwicklung &amp; Prototyping","description":"Prototyping: Software Prototypen, Software entwickeln &amp; Programmieren im Team","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/rock-the-prototype.com\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/rock-the-prototype.com\/en\/wp-json\/wp\/v2\/encyclopedia\/4511","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/rock-the-prototype.com\/en\/wp-json\/wp\/v2\/encyclopedia"}],"about":[{"href":"https:\/\/rock-the-prototype.com\/en\/wp-json\/wp\/v2\/types\/encyclopedia"}],"author":[{"embeddable":true,"href":"https:\/\/rock-the-prototype.com\/en\/wp-json\/wp\/v2\/users\/1"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/rock-the-prototype.com\/en\/wp-json\/wp\/v2\/media\/3499"}],"wp:attachment":[{"href":"https:\/\/rock-the-prototype.com\/en\/wp-json\/wp\/v2\/media?parent=4511"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rock-the-prototype.com\/en\/wp-json\/wp\/v2\/categories?post=4511"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rock-the-prototype.com\/en\/wp-json\/wp\/v2\/tags?post=4511"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}