{"id":78099,"date":"2025-05-04T21:52:32","date_gmt":"2025-05-04T21:52:32","guid":{"rendered":"http:\/\/bangla.sitestree.com\/?p=78099"},"modified":"2025-05-04T21:52:33","modified_gmt":"2025-05-04T21:52:33","slug":"java-creational-design-patterns","status":"publish","type":"post","link":"http:\/\/bangla.sitestree.com\/?p=78099","title":{"rendered":"Java Creational Design Patterns"},"content":{"rendered":"\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"types-of-creational-design-patterns\">5 types of creational design patterns:<\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Factory Design Patterns: Purpose: Create Objects, Keep Object Creation Centralized<\/li>\n\n\n\n<li>Abstract Factory Design Patterns <\/li>\n\n\n\n<li>Singleton Design Pattern: Limit instantiation\u00a0 of a clas to only one instance<\/li>\n\n\n\n<li>Prototype Design Patterns: Object creation based on Prototype Object Instance; Simpler Object Creation than Factory.<\/li>\n\n\n\n<li><strong>Builder Design Patterns:<\/strong> Object Creation, Complex Object Creation, Keep Complex Object Creation separate from it&#8217;s representation.<\/li>\n<\/ol>\n\n\n\n<p><\/p>\n\n\n\n<p>For Factory: Simple Factory, Factory Method, Abstract Factory<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>Factory Method:<\/strong> Construction separated from implementation. Objects can be created without defining the exact class of object to be created. <\/p>\n\n\n\n<p><strong>Abstract Factory:<\/strong> One layer above Factory Method. Super Factory. Creates other\u00a0Factories to create objects.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>Builder Design Patterns:<\/strong> Helps to create complex objects. Uses construction methods\/processes that can be used to create different representations of Objects. Step by step construction.<\/p>\n\n\n\n<p>Ref: <a href=\"https:\/\/www.geeksforgeeks.org\/creational-design-pattern\/\">https:\/\/www.geeksforgeeks.org\/creational-design-pattern\/<\/a> <\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>Builder Pattern: Ref: Wikipedia<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"700\" height=\"240\" src=\"https:\/\/i0.wp.com\/bangla.sitestree.com\/wp-content\/uploads\/2025\/05\/image-1.png?resize=700%2C240\" alt=\"\" class=\"wp-image-78100\" style=\"width:840px;height:auto\" srcset=\"https:\/\/i0.wp.com\/bangla.sitestree.com\/wp-content\/uploads\/2025\/05\/image-1.png?w=700 700w, https:\/\/i0.wp.com\/bangla.sitestree.com\/wp-content\/uploads\/2025\/05\/image-1.png?resize=300%2C103 300w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>Factory Method Design Pattern:<\/strong> (Wikipedia)<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"500\" height=\"240\" src=\"https:\/\/i0.wp.com\/bangla.sitestree.com\/wp-content\/uploads\/2025\/05\/image-2.png?resize=500%2C240\" alt=\"\" class=\"wp-image-78101\" srcset=\"https:\/\/i0.wp.com\/bangla.sitestree.com\/wp-content\/uploads\/2025\/05\/image-2.png?w=500 500w, https:\/\/i0.wp.com\/bangla.sitestree.com\/wp-content\/uploads\/2025\/05\/image-2.png?resize=300%2C144 300w\" sizes=\"auto, (max-width: 500px) 100vw, 500px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>Abstract Factory Design Pattern:<\/strong> (Wikipedia)<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"700\" height=\"240\" src=\"https:\/\/i0.wp.com\/bangla.sitestree.com\/wp-content\/uploads\/2025\/05\/image-3.png?resize=700%2C240\" alt=\"\" class=\"wp-image-78102\" style=\"width:840px;height:auto\" srcset=\"https:\/\/i0.wp.com\/bangla.sitestree.com\/wp-content\/uploads\/2025\/05\/image-3.png?w=700 700w, https:\/\/i0.wp.com\/bangla.sitestree.com\/wp-content\/uploads\/2025\/05\/image-3.png?resize=300%2C103 300w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/><\/figure>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>5 types of creational design patterns: For Factory: Simple Factory, Factory Method, Abstract Factory Factory Method: Construction separated from implementation. Objects can be created without defining the exact class of object to be created. Abstract Factory: One layer above Factory Method. Super Factory. Creates other\u00a0Factories to create objects. Builder Design Patterns: Helps to create complex &hellip; <\/p>\n<p><a class=\"more-link btn\" href=\"http:\/\/bangla.sitestree.com\/?p=78099\">Continue reading<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-78099","post","type-post","status-publish","format-standard","hentry","category-root","item-wrap"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":78427,"url":"http:\/\/bangla.sitestree.com\/?p=78427","url_meta":{"origin":78099,"position":0},"title":"Builder Pattern vs \u2699\ufe0f Factory Pattern in Java","author":"Sayed","date":"August 28, 2025","format":false,"excerpt":"From AI Tools\/Open AI\/ChatGPT \" Perfect \ud83d\udc4d Here\u2019s a copyright-free comparison table of the Builder Pattern vs Factory Pattern in Java, styled for easy posting on Facebook\/Blog: \ud83c\udfd7\ufe0f Builder Pattern vs \u2699\ufe0f Factory Pattern in Java AspectBuilder PatternFactory PatternTypeCreational design patternCreational design patternPurposeTo construct complex objects step by step with\u2026","rel":"","context":"In &quot;Java Design Patterns and OOP&quot;","block_context":{"text":"Java Design Patterns and OOP","link":"http:\/\/bangla.sitestree.com\/?cat=1962"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/bangla.sitestree.com\/wp-content\/uploads\/2025\/08\/image-27.png?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/bangla.sitestree.com\/wp-content\/uploads\/2025\/08\/image-27.png?resize=350%2C200 1x, https:\/\/i0.wp.com\/bangla.sitestree.com\/wp-content\/uploads\/2025\/08\/image-27.png?resize=525%2C300 1.5x, https:\/\/i0.wp.com\/bangla.sitestree.com\/wp-content\/uploads\/2025\/08\/image-27.png?resize=700%2C400 2x"},"classes":[]},{"id":78425,"url":"http:\/\/bangla.sitestree.com\/?p=78425","url_meta":{"origin":78099,"position":1},"title":"Factory Design Pattern: Examples in Java","author":"Sayed","date":"August 28, 2025","format":false,"excerpt":"Observe the code below: ShapeFactory factory = new ShapeFactory(); Shape shape1 = factory.getShape(\"circle\"); Shape shape2 = factory.getShape(\"square\"); Shape shape3 = factory.getShape(\"rectangle\"); shape1.draw(); shape2.draw(); shape3.draw(); We wanted to create objects such as shape1, shape2, and shape 3. We did not directly (create and) call the class for the required objects. We\u2026","rel":"","context":"In &quot;Java Design Patterns and OOP&quot;","block_context":{"text":"Java Design Patterns and OOP","link":"http:\/\/bangla.sitestree.com\/?cat=1962"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":78423,"url":"http:\/\/bangla.sitestree.com\/?p=78423","url_meta":{"origin":78099,"position":2},"title":"Builder Design Pattern: Example in Java","author":"Sayed","date":"August 28, 2025","format":false,"excerpt":"Observe these two examples of Object Creation from the Student Class Student student1 = new Student.Builder(\"Alice\") .age(12) .grade(\"7th\") .email(\"alice@email.com\") .build(); Student student2 = new Student.Builder(\"Bob\") .grade(\"5th\") .build(); We did not call the constructor with the property values, but we built the object step by step with only the properties and\u2026","rel":"","context":"In &quot;Java Design Patterns and OOP&quot;","block_context":{"text":"Java Design Patterns and OOP","link":"http:\/\/bangla.sitestree.com\/?cat=1962"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":78393,"url":"http:\/\/bangla.sitestree.com\/?p=78393","url_meta":{"origin":78099,"position":3},"title":"Java Design Patterns Simplified","author":"Sayed","date":"August 24, 2025","format":false,"excerpt":"From AI Tools\/OpenAI\/Internet \" Here\u2019s a short, copyright-free version suitable for Facebook or a blog post: Java Design Patterns Simplified Design patterns are proven solutions to common programming problems. They make code more reusable, flexible, and easier to maintain. 1\ufe0f\u20e3 Creational Patterns \u2013 How objects are created.Examples: Singleton, Factory, Builder,\u2026","rel":"","context":"In &quot;Anything JAVA&quot;","block_context":{"text":"Anything JAVA","link":"http:\/\/bangla.sitestree.com\/?cat=1975"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":23311,"url":"http:\/\/bangla.sitestree.com\/?p=23311","url_meta":{"origin":78099,"position":4},"title":"Laravel Design Patterns &#8211; Sure, I did Check them #Root #By Sayed Ahmed","author":"Author-Check- Article-or-Video","date":"March 29, 2021","format":false,"excerpt":"Laravel Design Patterns - Sure, I did Check them...Will create videos in near future... https:\/\/laracasts.com\/discuss\/channels\/laravel\/what-design-patterns-used-for-laravel-framework https:\/\/www.dunebook.com\/brief-overview-of-design-patterns-used-in-laravel\/ http:\/\/www.mahmoudzalt.com\/blog\/software-design-patterns\/ http:\/\/stackoverflow.com\/questions\/30569727\/using-design-patterns-in-laravel-5 http:\/\/stackoverflow.com\/questions\/27349154\/using-the-factory-pattern-in-php-and-laravel https:\/\/en.wikipedia.org\/wiki\/SOLID_(object-oriented_design) http:\/\/www.oodesign.com\/dependency-inversion-principle.html http:\/\/7php.com\/php-interview-taylor-otwell\/ http:\/\/stackoverflow.com\/questions\/757743\/what-is-the-difference-between-builder-design-pattern-and-factory-design-pattern https:\/\/www.quora.com\/What-are-the-best-design-patterns-to-use-in-Laravel-4 http:\/\/www.dofactory.com\/topic\/1590\/factory-pattern-vs-abstract-factory-pattern.aspx http:\/\/www.dofactory.com\/topic\/1590\/factory-pattern-vs-abstract-factory-pattern.aspx http:\/\/code.tutsplus.com\/tutorials\/design-patterns-the-strategy-pattern--cms-22796 https:\/\/msdn.microsoft.com\/en-us\/library\/ff649690.aspx From: http:\/\/sitestree.com\/?p=3953 Categories:Root, By Sayed AhmedTags: Post Data:2016-09-01 22:26:37 Shop Online: https:\/\/www.ShopForSoul.com\/ (Big Data, Cloud, Security, Machine Learning): Courses: http:\/\/Training.SitesTree.com In Bengali:\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":66312,"url":"http:\/\/bangla.sitestree.com\/?p=66312","url_meta":{"origin":78099,"position":5},"title":"Java Design Patterns and Examples #Java Short Notes","author":"Author-Check- Article-or-Video","date":"July 18, 2021","format":false,"excerpt":"J2EE core design patterns: Click on a pattern rectangle to explore Data Access Object Transfer Object From: http:\/\/sitestree.com\/?p=4934 Categories:Java Short NotesTags: Post Data:2007-06-04 16:27:01 Shop Online: https:\/\/www.ShopForSoul.com\/ (Big Data, Cloud, Security, Machine Learning): Courses: http:\/\/Training.SitesTree.com In Bengali: http:\/\/Bangla.SaLearningSchool.com http:\/\/SitesTree.com 8112223 Canada Inc.\/JustEtc: http:\/\/JustEtc.net (Software\/Web\/Mobile\/Big-Data\/Machine Learning) Shop Online: https:\/\/www.ShopForSoul.com\/ Medium: https:\/\/medium.com\/@SayedAhmedCanada","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/78099","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=78099"}],"version-history":[{"count":1,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/78099\/revisions"}],"predecessor-version":[{"id":78103,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/78099\/revisions\/78103"}],"wp:attachment":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=78099"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=78099"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=78099"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}