Essay: Q.No.1: Give one example of each design pattern from software domain.

1. Proxy
2. Adapter
3. Singleton
(a). Discuss how the relevant design pattern is solving the problem in your example [2 Marks]
(b). Draw Class Diagram for each Example [4 Marks]
(c). Identify the Participants in your example according to Design Pattern [4 Marks]

SINGLETON:
Example of singleton design pattern from software domain is the opening of selected multiple files in the media player.
(a). How is it solving problem:
Singleton provides a global access point in all the components of the application and not creating an object each time an operation is to be performed. In this case, if we have more than one file in a folder and we select all of them and open them, more than one instance are created which results in allocation of resources to each file, thus we eliminate this by using singleton design pattern and only one instance is created so one file will be played and the other will be after’s and only one pop-up window will be opened rather than more than one.

(b). CLASS DIAGRAM:
Media Player
Selectfiles()
Playfile()
UniqueFile
MediaData

(c). PARTICIPANTS:
It only has one participant that is the media player.

PROXY:
Example of Proxy design pattern from software domain is a site which works as a proxy between a shopkeeper that is the user and the supplier.
(a). How is it solving problem:
The shopkeeper has to go himself or the supplier has to come to the shop to collect the order but here proxy pattern applies and the online site of goods works as a proxy between shopkeeper and the supplier.
(b). CLASS DIAGRAM:
(d). PARTICIPANTS:
There are three participants with website being the primary and Shopkeeper and Supplier being the secondary.

ADAPTER:
Example adapter design pattern is the Media Player.
(a). How is it solving problem:
An audio media player is only capable of playing mp3 files that is audio files but introducing another interface of video player that extend media player class will make the player play both audio and media player files and hence two incompatible interfaces will be made compatible using adapter that is media adapter.
(b). CLASS DIAGRAM:

(c). PARTICIPANTS:
The participants included in this example are Media Adapter, Media Player, Audio Media Player and Video Media Player.

Source: Essay UK - http://doghouse.net/essays/information-technology/essay-q-no-1-give-one-example-of-each-design-pattern-from-software-domain/


Not what you're looking for?

Search our thousands of essays:

Search:


About this resource

This Information Technology essay was submitted to us by a student in order to help you with your studies.



Word count:

This page has approximately words.


Share:


Cite:

If you use part of this page in your own work, you need to provide a citation, as follows:

Essay UK, Essay: Q.No.1: Give one example of each design pattern from software domain.. Available from: <http://doghouse.net/essays/information-technology/essay-q-no-1-give-one-example-of-each-design-pattern-from-software-domain/> [21-02-19].


More information:

If you are the original author of this content and no longer wish to have it published on our website then please click on the link below to request removal:


Essay and dissertation help


Latest essays in this category:


Our free essays:

badges