Creational Design Patterns in Java: A Practical Approach

Verified

Added on  2025/05/02

|10
|1637
|230
AI Summary
Desklib provides solved assignments and past papers to help students succeed.
Document Page
OBJECT-ORIENTED SOFTWARE DEVELOPMENT
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
Contents
Introduction...........................................................................................................................................2
Q1: Describe how software development productivity can be accomplished by the application of
various Creational Design Patterns........................................................................................................3
Q2: UML diagram.................................................................................................................................6
2.1: Use UML diagram to design Compute Price class and complete Java class...............................6
2.2 Use UML diagram to design Checkout class and Java class........................................................7
Conclusion.............................................................................................................................................8
Reference:.............................................................................................................................................9
Table of figure
Figure 1: Compute Price........................................................................................................................6
Figure 2: Checkout.................................................................................................................................7
Document Page
Introduction
This assessment shows the creational design pattern which provides the way to solve the
pattern problems and in this the application the forms of the basic object give the productivity
of the application. This deals with the creation of the object as well as the mechanism of the
object. There is discussion in detail about the creational design and the types of the object
created. There is a diagram build which is UML diagram which acts as the static diagram
and the nature of the diagram helps the developer to develop the system. This comes under
the object-oriented analysis which helps to understand the concept of the UML diagram.
Document Page
Q1: Describe how software development productivity can be accomplished
by the application of various Creational Design Patterns.
Creational pattern design is a concern for the object creation method. How the object can be
created by different methods. The object created is the method that which type of method has
to be used for the time of instantiation of the class. This work is done in the programming o
the system in JAVA language (Sunitha, E.V., and Samuel, P., 2019). In this, the hardcoded
code is not used whereas the object creation is used to call the method or the class in
anywhere in the program. To initiate the development of the software there is the use of
SDLC model which consist of different phase to complete the model and they include the
steps such as resource requirements, design of the prototype, testing of the design and the
maintenance of the project. The JAVA class consist of the inheritance process in which one
class method can be called in other class so there is need to create the object for the class to
call its method (Yildiz, O., 2019). So here the creational design is created represented and
then composed it. This consists of the pattern to solve the particular problem there are
different patterns of different problems. The creational design is an abstract process which
helps to solve the application result on the basis of the forms and the object. To get the
productive result of the application there is the use of the creational design. This deals with
the creation of the object as well as the mechanism of the object (Yildiz, O., 2019). The
object created is the method that which type of method has to be used for the time of
instantiation of the class. There can be a mechanism to create productivity software by using
the creational design and the SDLC design.
The creational design consists of various patterns:
1. Singleton: As this is the part of the creational design so this will also deal with the
creations of the object but in this, the instance of the object will be single only, it does not
support the multiple object creation. It is used in the thread pools, setting of configuration,
caching, etc. (Sunitha, E.V., and Samuel, P., 2019). This helps to save memory and give less
complexity. This has the instantiation which are of two types:
1. Lazy instantiation: This provides the need for instantiation
2. Early instantiation: This has the time load creation instant.
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
2. Factory method: it consists of the user interface and the abstract class to build the project
which is independent and then compose them. It helps in the java application to build the
object and here the object type is not defined or not known to the application. It deals with
the mechanism of the object creation the priority of the subclasses. It deals with the
subclasses which are of the main class. Let us understand the factor method by example:
Class XYZ ()
{
Public:
Xyz ()
Virtual xyz ()
{Return new w};
}
3. Object Pool Pattern: This has the there process of the object:
1. Creating the object
2. Validate the object
3. Destroy the object
This helps to manage the pattern of the resources to have the expense of creating the object
which can be affordable to the person. It consists of the effective rate of the initialization of
classes which passes over the three steps create, validate and destroy. The resources are
managed according to the pool pattern (Nanthaamornphong, A. and Leatongkam, A., 2019).
It consists of the involvement of the databases which has a large connection and creates a
long time. The class which takes a long time to be created give as the result of the overloaded
database.
4. Builder: The basic function of the builder is to build the new classes by the help of
conversion. There are converters which convert the classes into the separate objects. For
converting the need of the algorithm which resembles the less complexity of the particular
object. The object represents the different types of construction with different representation
Document Page
also. It helps the mechanism to design the class application in a very effective way. This
consists of the pattern to solve the particular problem there are different patterns of different
problems by the help of the algorithms and the different subclasses.
5. Prototype: The design is created and the product is independently composed of the
methods and represent it. They also deal with the subclasses only which are the child of the
parent class. It is used in the thread pools, setting of configuration, caching, etc. This helps to
save memory and give less complexity. The creational design is an abstract process which
helps to solve the application result on the basis of the forms and the object. The application
of the design is built in the java with the new objects (Sunitha, E.V., and Samuel, P., 2019).
This consists of the java code which has at least one variable of the object in the class to build
the code of lines. Source code is just the static analysis in the languages such as SQL which
deals with the database of the system. The creational design is an abstract process which
helps to solve the application result on the basis of the forms and the object. The class
definition is not given in the application and is analyzed in the factory method which acts as
the family of the main parent classes. To get the productive result of the application there is
the use of the creational design (Nanthaamornphong, A. and Leatongkam, A., 2019). This
deals with the creation of the object as well as the mechanism of the object. This work is
done in the programming o the system in JAVA language. In this, the hardcoded code is not
used whereas the object creation is used to call the method or the class in anywhere in the
program.
Document Page
Q2: UML diagram
2.1: Use UML diagram to design Compute Price class and complete Java class
Figure 1: Compute Price
This class diagram consists of the Java class which is payment which has two types that is
COD and the Card, there are also bill class, customer class, and the place class. This consists
of the attributes and the methods of the respected class as shown in the diagram.
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
2.2 Use UML diagram to design Checkout class and Java class
Figure 2: Checkout
This class diagram consists of the Java class which is bill class, customer class ProductName,
and the offeronproduct. This consists of the attributes and the methods of the respected class
as shown in the diagram (Nanthaamornphong, A. and Leatongkam, A., 2019).
Document Page
Conclusion
The above report consists of the creational design process which is to develop the software
product. This deals with the creation of the object as well as the mechanism of the object. To
initiate the development of the software there is the use of SDLC model which consist of
different phase. It helps the mechanism to design the class application in a very effective
way. The creational design is an abstract process which helps to solve the application result
on the basis of the forms and the object. The diagram is also present which the UML diagram
which is statics and helps the coder to design the system. Here the implementation of the
UML is done with the online software which is draw.io. This report consists of a simple
understanding of the things.
Document Page
Reference:
Sunitha, E.V., and Samuel, P., 2019. Automatic Code Generation From UML State Chart
Diagrams. IEEE Access, 7, pp.8591-8608.
Yildiz, O., 2019. Object-based modeling of restrictions on the sale of agricultural land. Land
Use Policy, 82, pp.538-549.
Nanthaamornphong, A. and Leatongkam, A., 2019. Extended ForUML for Automatic
Generation of UML Sequence Diagrams from Object-Oriented Fortran. Scientific
Programming, 2019.
Perello, M., 2019. DOTTORATO DI RICERCA IN SISTEMI DI PRODUZIONE E
DESIGN INDUSTRIALE CICLO XXVII.
Owens, L., Razet, B., Smith, W.B. and Tanner, T.C., 2019, January. Inter-family
Communication in Hyperledger Sawtooth and Its Application to a Crypto-Asset Framework.
In International Conference on Distributed Computing and Internet Technology (pp. 389-
401). Springer, Cham.
Feitosa, D., Ampatzoglou, A., Avgeriou, P., Chatzigeorgiou, A. and Nakagawa, E.Y., 2019.
What can violations of good practices tell about the relationship between GoF patterns and
run-time quality attributes?. Information and Software Technology, 105, pp.1-16.
Leng, K., Jing, L., Lin, I.C., Chang, S.H. and Lam, A., 2019. Research on mining
collaborative behavior patterns of dynamic supply chain network from the perspective of big
data. Neural Computing and Applications, 31(1), pp.113-121.
chevron_up_icon
1 out of 10
circle_padding
hide_on_mobile
zoom_out_icon
[object Object]