Describe the intent of singleton design pattern

Assignment Help JAVA Programming
Reference no: EM131699862

Provide answers to the following questions.

To answer the questions:
a) Read widely.
b) Provide detailed explanations in your own words with reference to the work you have done in this unit.
c) Insert references to views you have gained though reading appropriate sources
d) Where appropriate you may includeclass diagrams, code examples and images to enhance your answer.

Discussion is allowed with other students but the write up and design must be entirely your own work and should not be shared with others.
Explanations must be in the correct context, i.e. the domain of Object Oriented Programming.

1.
1.1. Describe the Intent of Singleton design pattern.
1.2. Provide an application (with justification) ofSingleton in Project 2/3 and show how it is implemented referring to actual code.
1.3. Discuss the problem of sub classing with Singleton.

2. For the following question refer to specification of Project 2.

In order to provide better services to clients and boost their sales, the vehicle hiring company now providesthe ability to make special types of reservations such as:
- Reservations with extra equipment (extras may include travel accessories such as Baby/ booster seat, GPS, E-tag etc.)
- Reservations with insurance covers (which covers the excess amount in the case of accidents, damages etc.)

It should be possible to make basic reservations (which contains Full Tank Fuel only), as well as mix the above features and make special featured reservations based on customer preference.

You must also anticipate future additions to these extra features and design your system to support enhancedresponsibilities to be added to a basic reservation object,without major changes to the existing classes in the system.

Assume that the following design decisions are made for you:

- The current Reservation class represents a basic reservation that simply provides a vehicle with full tank fuel.

- It is decided to use the Decorator design pattern to add various features to a basic reservation. Apartialclass diagram is provided belowto help you get started withapplying the Decorator design pattern.

- In the below design, addFeatures() method, adds features to a reservation object. (When addFeatures() is calledon a basic reservation object, ‘Full Tank Fuel' will be added to the reservation).

183_figure.jpg

2.1. Discuss how the Decorator pattern observes the Open for extension but Closed for modification principle.

2.2. You are required to use the above assumptions and complete the given class diagram by applying the Decorator design pattern to meet the requirements of the above scenario (to accommodate current and futureadditions for a basic reservation).
- Include a detailed UML class diagram (with required classes/ interfaces, methods, relationships, access modifiers etc.)that shows application of Decorator.
- Your design must be supported with a detailed explanation of how the Decorator pattern work (show actual code where appropriate)

2.3. The extended functionality mentioned above can be achieved using static inheritance (sub classing) as well. In view of the above scenario, discuss why decorator pattern is better than static inheritance.

3.
3.1. Explain how observer design pattern work referring to its class structure and relating an example you have learnt (Java related) in this unit.
3.2. Compare and contrast the two methods for propagating data to observers with the Observer design pattern.

4.
4.1. Discuss an application of Chain of Responsibility design pattern referring to something (Java related) you have learnt in this unit.

Verified Expert

This assignment contains information about the design pattern and also contain the discussion about the various pattern like chain of responsibility, decorator pattern, observer pattern etc.

Reference no: EM131699862

Questions Cloud

Identify two appropriate strategies onboarding team will use : Identify at least two appropriate strategies the onboarding team will use to address resistance to adopting EMRs by the THS staff.
Describe what you would say to persuade another student : Describe what you would say to persuade another student that this class is a valuable elective to take
How a line graph is different from a frequency polygon : From the data for the five U.S. cities that follow, construct a line graph that shows the relationship between elevation above sea level and mean January.
Difference between project charter and team charter : What is the difference between Project Charter and Team Charter? When does a team charter gets developed and by whom?
Describe the intent of singleton design pattern : COS70006 - Object Oriented Programming - Describe the Intent of Singleton design pattern and Discuss the problem of sub classing with Singleton
Explain why our society seems to be embracing green movement : Discuss how the burdens of pollution, waste disposal, and resource extraction come to be unequally distributed among racial
Discuss how you will implement the given initiatives : Discuss how you will implement these initiatives and what change in employee mindset may required to overcome dissention or resistance that is likely to be met.
Discuss the pros which might arise toward the passing bill : There is much opposition to this bill. Using distributive bargaining, discuss the pros and cons which might arise toward the passing or defeating of this bill.
Uniform production and mixed-model sequencing : Chris Riggs, the production manager for Solvo, wants to try uniform production and mixed-model sequencing.

Reviews

inf1699862

3/14/2018 5:22:53 AM

Paper came before deadline and was good writing, Awesome writer paper was excellent. Good and time-conscious writer. Did a fantastic job on assignment, would choose again.

inf1699862

1/8/2018 1:39:23 AM

Deadline 10 hours. I only want, 1.1, 1.3, 2.1, 2.3, 3.1, 3.2, 4.1 exercises, not all lease note I want 1.1, 1.3, 2.1, 2.3, 3.1, 3.2, 4.1 thoroughly. Also note, add references to the contents taken online. Please note it needs to be a quality work with good examples of methods. In 3.2 question, there's a need to compare two methods. add reference to the methods taken from online source Also make sure everythign need to be plagairsm free.

inf1699862

11/13/2017 3:56:24 AM

Please note I want 1.1, 1.3, 2.1, 2.3, 3.1, 3.2, 4.1 thoroughly. Also note, add references to the contents taken online. Please note it needs to be a quality work with good examples of methods. In 3.2 question, there's a need to compare two methods. add reference to the methods taken from online source Also make sure everythign need to be plagairsm free.

len1699862

10/31/2017 8:21:18 AM

Referencing (per unit outline) To avoid plagiarism and to show you have done enough research, you are required to provide sufficient references. Especially, whenever you include information from other sources in your work. Referencing conventions required for this unit are: a) Where a method has been written by someone other than you, place a comment in the documentation for each method acknowledging the source of the code. b) Where a method is an adaption of work done by someone else, place a comment in the documentation for each method acknowledging the source of the code. c) For written work • Place all phrases, sentences, paragraphs, etc., that have not been written by you in quotation marks. • Place a reference to the source of the words in the document • Use Harvard standard for referencing.

len1699862

10/31/2017 8:21:03 AM

Deliverables You need to prepare a detailed report providing answers to the above questions and the report must be uploaded to TurnitIn for originality checking. You need to hand in the printed report with: • Detailed answers to the above questions • TurnitIn originality report and date submitted to TurnitIn Note: Marks will be deducted as follows • The report lacks appropriate detailed answers with UML diagrams/ applications/ code samples • General quality of submission, format, clarity, style and language are below a professional standard. • You have not signed the declaration or provided the originality report. • References not completed or inadequate • Contains the work of others that has been acknowledged (at most half marks) • Contains work of others that has not been acknowledged (No marks for portfolio) • Is the same as another students work (No marks for portfolio) • Is the same as work submitted by another student in a previous semester (No marks for portfolio)

len1699862

10/31/2017 8:11:53 AM

Object Oriented Programming Design Patterns Assignment, Semester 2 15% of your final mark Provide answers to the following questions. To answer the questions: a) Read widely. b) Provide detailed explanations in your own words with reference to the work you have done in this unit. c) Insert references to views you have gained though reading appropriate sources d) Where appropriate you may includeclass diagrams, code examples and images to enhance your answer. Discussion is allowed with other students but the write up and design must be entirely your own work and should not be shared with others.

Write a Review

JAVA Programming Questions & Answers

  Draw a scheduling chart to show how the i/o and cpu

Draw a scheduling chart to show how the I/O and CPU are allocated and compute the average turnaround times for the CPU-bound and I/O bound task. Use the following table to keep track of all events and Ready/Blocked (I/O) queues.

  Write a method named longestword

Write a method named longestWord that accepts a String as its parameter and returns the length of the longest word in the string.

  Your task for this project is to design a program to help a

your task for this project is to design a program to help a videorental store operatorrecord clients transactions.nbsp

  Determine the distance to it from lancre

Project – methods - The program keeps asking for input until the user enters a valid city. Account for errors in capitalization, i.e. QUIrm and quirm and qUirm

  Develop a database driven web application

ITECH6401 Enterprise Programming Assignment. You are required to develop a database driven web application which will be used as a basis for a Postgraduate Student Enrolment Database (PSEDB) application

  Java problem - g queue

A queue is an ordered collection of items in which the removal of items is restricted to the FIFO ( rst in rst out) principle.

  Implements the comparable interface

Create a class called Dog that implements the Comparable interface. Dog will contain a member variable to hold a name, a constructor that sets up the name

  Write program in java-calculate and display mortgage payment

Write the program in Java (with a graphical user interface) and have it calculate and display the mortgage payment amount from user input of the amount of the mortgage.

  Write down several reasons why exception-handling

question 1 give several reasons why exception-handling techniques should not be used for conventional program

  Write the addlast method for linkedlista java

Write the addLast() method for LinkedListA.java. Do not attempt to modify Tester.java. Do NOT delete LinkedList$Node.class, or LinkedList.class from the folder.

  Implement a login window with text fields

Write a program with a graphical interface that implements a login window with text fields for the user name and password.

  Advance programming hi i want two copies of the assignment

hi ltbrgti want two copies of the assignment me and my friend are doing same assignment. ltbrgtwe need both the

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd