logo

Object Oriented Software Development

Research study for MITS4002 OBJECT-ORIENTED SOFTWARE DEVELOPMENT course

11 Pages2016 Words72 Views
   

Added on  2023-03-17

About This Document

This document discusses the concept of object oriented software development and explores the use of creational design patterns such as builder, prototype, singleton, abstract factory, and factory method. It also explains the proxy pattern and composite pattern in the context of compute price and checkout. The document provides pseudocode examples and class diagrams for better understanding.

Object Oriented Software Development

Research study for MITS4002 OBJECT-ORIENTED SOFTWARE DEVELOPMENT course

   Added on 2023-03-17

ShareRelated Documents
Running head: OBJECT ORIENTED SOFTWARE DEVELOPMENT
OBJECT ORIENTED SOFTWARE DEVELOPMENT
Name of the Student:
Name of the University:
Author Note:
Object Oriented Software Development_1
1OBJECT ORIENTED SOFTWARE DEVELOPMENT
Table of Contents
Question 1..................................................................................................................................2
Question 2..................................................................................................................................3
Design problem: Compute price............................................................................................3
Design problem: Checkout.....................................................................................................6
References................................................................................................................................10
Object Oriented Software Development_2
2OBJECT ORIENTED SOFTWARE DEVELOPMENT
Question 1
Creational design patterns are a type of patterns which are used to design and develop a
software in multiple different ways. The main use of these patterns is to abstract the
instantiation process. The creational pattern design process helps in making the system not
dependent on the object’s creation, representation and composition process. To make new
classes via the creational design patterns, inheritance is used and to instantiate new objects
the authority is delegated. The use of creational patterns become more useful as the
application or the system to be developed evolves slowly and when the system becomes more
dependent on inheritance than object composition. These patterns help in creating small
fundamental behaviours that can be used to design more complex classes. This is something
which is much more than just regular class instantiation. There are five types of creational
design patterns. These are abstract factory, builder, factory method, prototype and singleton.
These are discussed below as follows:
1. Builder: This is one of the creational design patterns that make use of the
construction process of the object by separating the process from the representation so
as to use it to create many representations of the product multiple times over. The
pattern is used when the algorithm that is creating the objects is totally independent of
the parts of the object and its assembling process. The builder pattern is also used
when the construction process of an objects requires multiple representations of the
same object to be permitted. The major consequence of using this pattern is that the
internal representation of the product can be changed by the user. The pattern is also
used when a user wants to have a more subtle control over the object’s construction
process. The pattern is also used to separate the construction process of the object
form its representation process.
2. Prototype: The prototype pattern is used when the same type objects need to be
created for classes and a prototype of the objects is provided so as to speed up the
creation process by just copying the prototype. This pattern is used when the classes
to be instantiated is specified by the class during dynamic loading. The pattern is also
used when the user wants to avoid building a factory hierarchies which parallels the
product hierarchies. The prototype pattern also finds its use when a certain number of
combinations are required by class for its state. The consequence of using this pattern
is that it makes the runtime removal and addition of products easier. It also permits
Object Oriented Software Development_3
3OBJECT ORIENTED SOFTWARE DEVELOPMENT
the modifications of values of the objects. Another result of this pattern is that it lets
the user create new objects by changing the structure.
3. Singleton: This pattern is only used when a single instance of a class is needed to be
created along with global access. The pattern helps provide the client with an
individual instance that they can access from common access points. The pattern is
also used to extend the main class of the system with the help of a subclass without
changing the codes. The major consequence of this pattern is that it lets the user have
controlled access to the solo class. It also lets the user create many different instances
of the class. The pattern also helps in reducing the name space of the instances. The
flexibility of the system is increased more than the normal required for class
operations. The pattern also allows for the refinement of operations and representation
of the class.
4. Abstract factory: The pattern allows the creation of an interface which enables the
developer to create multiple families of objects without stating the concrete classes of
those same objects. Kit is another name given to this pattern. The main use of this
pattern is to create an independent system which will work without the composition,
representation and creation of those objects. The pattern is also used when the system
being created must be configured along with the many families of that object. One
main consequence of using this pattern is that it isolates the entire concrete class.
Another consequence is that it helps in exchanging of the families of the product. This
pattern makes the supporting of newer product types harder for the system. The
pattern also helps in increasing the consistency of the products.
5. Factory method: This popular design pattern creates an interface for the object but
shifts the control for the initiation process to its subclass. Virtual constructor is
another name given to this pattern. The main use of this pattern is in scenarios where
the objects to be created are not yet decided by the class. The pattern lets the object to
be created be decided by a subclass. A major consequence of using this pattern is that
it provides placeholders or hooks for the subclasses of the classes. Another
consequence is that using this pattern brings more flexibility to the system.
Question 2
Design problem: Compute price
a. The pattern chosen for this class is the proxy pattern. This pattern is chosen because it
lets the user view or select different items from his cart and their prices without
Object Oriented Software Development_4

End of preview

Want to access all the pages? Upload your documents or become a member.

Related Documents
Object Oriented Software Development
|7
|1021
|93

Object Oriented Software Development
|7
|1034
|90

Object Oriented Software Development
|10
|2054
|50

Design Pattern | Interfaces and Objects
|5
|1267
|11

Object Oriented Design Patterns in Java
|15
|2645
|493

Victorian Institute Of Technology - VIT Intro
|5
|831
|15