Design Pattern Lab_Exp-3
Design Pattern Lab_Exp-3
DIVISION : D6 (G-11)
In the context of the Builder design pattern, OOPS stands for "Object-Oriented
Programming Principles" rather than an error. The Builder pattern is indeed
rooted in these principles. It's a creational design pattern that separates the
construction of a complex object from its representation, allowing the same
construction process to create different representations.
PROBLEM STATEMENT :
In the financial sector, the investments and many other things depends on
fluctuating factors. There are different things which keep changing in the
finance sector and all are interconnected. In this, we have used builder pattern
as we have many fluctuating factors. Here, investment return rate, profit rate
and currency values all keep changing and are never stable.
Builder Design pattern: The Builder Design Pattern is a creational pattern that
addresses the construction of complex objects by separating the construction
process from the actual representation. The pattern involves several key
components: the Product, which is the complex object being built; the Builder,
an interface or abstract class defining construction steps; the ConcreteBuilder,
a class implementing the Builder interface to construct specific products; the
Director, an optional class that orchestrates the construction process; and the
Client, responsible for creating a director, a builder, and initiating the
construction process.
The Builder design pattern can be applied in the finance sector to simplify the
creation of complex objects and improve code readability and maintainability. In
the finance sector, where complex financial instruments and transactions are
often modeled, the Builder pattern can be beneficial for creating these intricate
objects.
SOURCE CODE :
Flexibility: The Builder pattern offers a flexible way to construct objects with
varying configurations. It allows clients to construct objects step by step,
providing control over each aspect of the object's construction.
The Builder pattern is a valuable tool for building complex objects in a flexible
and maintainable manner. It promotes separation of concerns by separating
the construction process from the representation of the object. By
encapsulating the construction logic within builder classes and providing a
clear interface for object construction, it enhances code readability and
maintainability. Additionally, it offers flexibility in object creation, allowing
clients to construct objects with different configurations using the same
construction process. Overall, the Builder pattern is a powerful design pattern
that facilitates the creation of complex objects while adhering to object-
oriented principles.