Essay: Assignment: Design patterns

Essay details:

  • Subject area(s): Information technology essays
  • Reading time: 2 minutes
  • Price: Free download
  • Published on: October 11, 2015
  • File format: Text
  • Number of pages: 2
  • Assignment: Design patterns
    0.0 rating based on 12,345 ratings
    Overall rating: 0 out of 5 based on 0 reviews.

Text preview of this essay:

This page of the essay has 423 words. Download the full version above.

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.

About Essay Sauce

Essay Sauce is the free student essay website for college and university students. We've got thousands of real essay examples for you to use as inspiration for your own work, all free to access and download.

...(download the rest of the essay above)

About this essay:

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

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

Essay Sauce, Assignment: Design patterns. Available from:<https://www.essaysauce.com/information-technology-essays/assignment-design-patterns/> [Accessed 27-05-20].

Review this essay:

Please note that the above text is only a preview of this essay.

Name
Email
Review Title
Rating
Review Content

Latest reviews: