Factory Method Design Pattern. Bengali-Ep:27

Опубликовано: 05 Июль 2026
на канале: Ajoy Debnath
184
16

Hi,
Hope you are all doing great. Let's learn together.

Join Telegram: 📲 https://t.me/contactajoydebnath

Chapters ❤
0:00 Introduction
02:41 Factory Method Design Pattern Code Implementation

Note:
Java was developed by Sun Microsystems (which is now a subsidiary of Oracle) in the year 1995. James Gosling is known as the father of Java. Before Java, its name was Oak. Since Oak was already a registered company, James Gosling and his team changed the name from Oak to Java.


Document Link -
https://docs.google.com/document/d/1T...

STS Link:
https://spring.io/tools

JDK Link:
https://www.oracle.com/java/technolog...

Video Links:

String Playlist :
   • Spring Framework  

Java Videos Links :
How to create Immutable class in Java? Immutable Design Pattern. --    • How to create Immutable class in Java? Imm...  
Object Cloning, Shallow Copy and Deep Copy. --    • Object Cloning, Shallow Copy, and Deep Cop...  
Excetption, Custom Exception, throw, throws --    • Exception, Custom Exception, throw, throws...  
Excetption, try, catch, finally --    • Exception, Propagation try, catch, finally...  
Exception, Exception Hierarchy, Call Stack, Propagation. Bengali-Ep:22 --    • Exception, Exception Hierarchy, Call Stack...  
Lambda Expression, Functional Interfaces, Anonymous Class. --    • Lambda Expression, Functional Interfaces, ...  
Singleton Pattern. Lazy Instantiation for Multiple Threads.Part-2 Bengali-Ep:20    • Singleton Pattern. Lazy Instantiation for ...  
Singleton Design Pattern in Java. Early & Lazy Instantiation Bengali-Ep:19 :    • Singleton Design Pattern Java. Early & Laz...  
HashSet, Its Methods & How It Works Internally in Java :    • HashSet, Its Methods & How It Works Intern...  
HashSet & How It Works Internally in Java. --    • HashSet & How It Works Internally in Java....  
LinkedList,Methods & How It Works Internally in Java. --    • LinkedList, Methods & How It Works Interna...  
ArrayList, ListIterator, How It Works Internally --    • ArrayList, ListIterator, How It Works Inte...  
Collection Framework ----    • Collections Framework, Collection & Iterat...  
'super' keyword -    • 'super' keyword in Java. Bengali-Ep:13  #b...  
'this' keyword -    • 'this' keyword in Java. Bengali-Ep:12  #be...  
Final Keyword -    • Final keyword, Final variable, method, cla...  
Static Keyword, Static variable, block, method, nested class -    • Static keyword, Static variables, block, m...  
Access Modifier. Private, Public, Default, Protected --    • Access Modifier. Private, Public, Default,...  
Encapsulation, Data Hiding, Setter-Getter method, JavaBean Class --    • Encapsulation, Data Hiding, Setter-Getter ...  
Polymorphism, Method and Constructors Overloading, Method Overriding --    • Polymorphism, Method & Constructors Overlo...  
Inheritance, Is-A relationship, the problem with multiple inheritances --    • Inheritance, 'IS-A' relationship, multiple...  
Abstraction, Interface --    • What is Abstraction? Interface Implementat...  
Abstraction, Abstract Class -    • What is Abstraction? Abstract Class Implem...  
What is Class, Object, Method, Constructors-    • What is  Class, Object, Method, Constructo...  
Environment Setup and why we need to set path in environment variable --    • Environment Setup. Why do you set a Java p...  
First Java Program - "Hello World" --    • First Java Programming "Hello World" Print...  

Spring Video Links:
JDBCTemplate, RowMapper,ResultSetExtractor,BeanPropertyRowMapper Spring --    • JDBCTemplate, RowMapper,ResultSetExtractor...  
Spring JDBCTemplate, JDBC, Statement and PreparedStatement --    • Spring JDBCTemplate, JDBC, Statement and P...  
What if we remove @Configuration annotation in Spring? --    • What if we remove the @Configuration annot...  
@Configuration, @Bean, @Component, @ComponentScan in Spring. --    • @Configuration, @Bean, @Component, @Compon...  
Autowiring, Autowiring Modes - byName, byType & constructor. --    • Autowiring, Autowiring Modes - byName, byT...  
Bean Scope ,Sinton Scope and Prototype Scope. --    • Bean Scope, Singleton Scope, and Prototype...  
IOC Container, BeanFactory, Important APIs, Lazy & Eager Loading. --    • IOC Container, BeanFactory, Lazy & Eager L...  
IOC,Dependency Injection,IOC Container,Coupling -    • IOC,Dependency Injection,IOC Container,Cou...  

Like, Comment, Share, and Subscribe.

Thank you again.

Design pattern:
Design patterns represent the best practices used by experienced object-oriented software developers. Design patterns are solutions to general problems that software developers faced during software development. These solutions were obtained by trial and error by numerous software developers over quite a substantial period of time.

What is a Gang of Four (GOF)?
In 1994, four authors Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides published a book titled Design Patterns - Elements of Reusable Object-Oriented Software which initiated the concept of Design Patterns in Software development.

These authors are collectively known as Gang of Four (GOF).

Factory method design pattern in Java.
A Factory Pattern or Factory Method Pattern says that, just define an interface or abstract class for creating an object but lets the subclasses decide which class to instantiate. In other words, subclasses are responsible for creating the instance of the class.
It is a creational design pattern that talks about the creation of an object.

What is upcasting? Upcasting is the typecasting of a child object to a parent object. Upcasting can be done implicitly.
Parent parent = new Child();