For each of the following scenarios choose the most appropri

For each of the following scenarios choose the most appropriate pattern to use You are writing a program that maintains a grid of objects. Although there are several million objects in the grid, there are only a few hundred distinct objects, but there are many copies of each one. Unfortunately each of the objects require a fair amount of storage and creating several million individual objects is using way too much storage. You have a Point class whose interface uses polar coordinates and you want to provide a wrapper so it can be used to implement a version of Point that uses rectangular coordinates. When new objects of your class are created the new objects should actually have a more appropriate subtype. Add a scroll bar to an existing window object in Swing. We have a computer simulation of a bicycle involving wheels, spokes, and so forth, and we want to be able to treat all of these parts and subassemblies of the bicycle uniformly as bicycle components in some parts of the code. A method in the ATM software at the airport does currency conversions by forwarding the data to an identical method running on a computer at the bank\'s data center downtown where the calculations are done and results returned to the airport ATM computer. A method in the Campus Maps graphical user interface is called whenever a button on the screen is clicked because the method has previously been registered with the button to be notified whenever a click occurs

Solution

1)Flyweight

2)decorator

3)adapter

4)observer

5)composite

6)iterator

7)proxy

1)Flyweight

2)decorator

3)adapter

4)observer

5)composite

6)iterator

7)proxy

 For each of the following scenarios choose the most appropriate pattern to use You are writing a program that maintains a grid of objects. Although there are s

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site