Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

Question

Assume we have three classes: AlarmClock, Beeper, and AlarmWindow. In following you see an interaction showing an AlarmClock sending show message to an AlarmWindow and the beep message to Beepers when it receives alarm message (i.e. when the clock's alarm event occurs, it sends these messages).

Now assume you have been asked to change these classes so they collaborate according to the Observer pattern. Suppose that AlarmClocks are publishers and Beepers and AlarmWindows are observers.

a. What is an interface (name each method and give a short description of each method) that AlarmClocks must implement?

b. What is an interface (name each method and give a short description of each method) that Beepers and AlarmWindows must implement?

c. illustrate a class diagram to show the relevant classes, methods, associations, and navigability for your adaptation to Observer pattern.

d. Rewrite above interaction to show how clock, b1, b2, and window interact according to an Observer pattern.

 

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M9718889

Have any Question?


Related Questions in Computer Engineering

As noted in chapter 14 of aampa distribution of income

As noted in Chapter 14 of A&A, distribution of income among various population groups followed roughly the same patterns in the USA, Sweden, and the former Soviet Union, despite the very different forms of economic organ ...

A banks assets equal its liabilities under a both

A bank's assets equal its liabilities under a. both 100-percent-reserve banking and fractional-reserve banking. b. 100-percent-reserve banking but not under fractional-reserve banking. c. fractional-reserve banking but n ...

Question suppose that someone tells you that an attribute

Question : Suppose that someone tells you that an attribute that is part of a composite primary key is also a candidate key. How would you respond to that statement? Explain.

A video movie store owner finds that 30 of the customers

A video movie store owner finds that 30% of the customers entering the store ask an assistant for help and that 20% of the customers make a purchase before leaving. It is also found that 15% of all customers both ask for ...

My kids love playing uno and we just finished up an intense

My kids love playing UNO and we just finished up an intense round. Lets say that the deck has 80 cards. 20 red, 20 blue, 20 green and 20 yellow.  What is the probability of pulling 3 green cards if the first 2 are replac ...

Systems analysis project 5can you answer the 4questions

Systems Analysis project 5: Can you answer the 4questions please. Personal Trainer, Inc. owns and operates fitness centers in a dozen Midwestern cities. The centers have done well, and the company is planning an internat ...

An array a1 n is said to have a majority element if more

An array A[1 . . . n] is said to have a majority element if more than half of its entries are the same. Given an array, the task is to design an efficient algorithm to tell whether the array has a majority element, and, ...

The switch statementhere is the question in its entirety

The switch statement Here is the question in its entirety, but the actual problem is at the end. I just felt that I would give an overview of what I am asking. The program has to be in c++ (.cpp) and must compile as such ...

On a string s we have the following elementary operations i

On a string s, we have the following elementary operations: i) Insertion of a single letter into the string s, e.g., BT ? BAT. ii) Deletion of a single letter in the string s, e.g., CAT E ? CAT. iii) Substitution of one ...

Question suppose you want to perform two sums one is a sum

Question : Suppose you want to perform two sums: one is a sum of 10 scalar variables, and one is a matrix sum of a pair of two-dimensional arrays, with dimensions 10 by 10. What speed-up do you get with 10 versus 100 pro ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As