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.:- M9133637

Have any Question?


Related Questions in Computer Engineering

Three mutually exclusive new designs for an aircraft engine

Three mutually exclusive new designs for an aircraft engine are under consideration. The engine has a ten-year life. The first engine incurs a cost of $1.2 million for a net saving of $300,000 per annum as compared to an ...

Suppose the following matrix represents the number of saws

Suppose the following matrix represents the number of saws ordered from your company each month over the last year. saws = [1,4,5,3,7,5,3,10,12,8, 7, 4] All the numbers should be zero or positive. (a) Use an if statement ...

Suppose a machine has 16 registers and uses 24 bit memory

Suppose a machine has 16 registers and uses 24 bit memory addresses. The opcodes are 8 bits so that the instruction length is 32 bits. Register instructions can have two or three register operands (4 bits to name each re ...

Q2 what layer uses encryptiondecryptiona what is

Q2. What layer uses encryption/decryption? a. What is encryption? Q3. What addressing system is used at Data Link layer? a. How long is the address? Is it Physical or logical? b. Is it unique or not unique?

Write a program to ask the user to eithernbspselect 1 to

Write a program to ask the user to either  Select 1 to print the digits in an integer reversely  Select 2 to print the characters in a string reversely using a switch case, your program will either 1- call the recursive ...

In linux what synchronization methods they use within the

In Linux what synchronization methods they use within the kernel, please dig into your findings for Linux.

Can someone please help me with this examthis is consists

can someone please help me with this exam This is consists of four questions. The questions are designed to test your understanding of certain concepts that were studied over the course of the semester. Please answer all ...

Rocket motors are tested by restraining them on the ground

Rocket motors are tested by restraining them on the ground, firing them with a known amount of propellant, and measuring the thrust over time. A typical curve is shown below. The total impulse is the integral of the thru ...

The standard math library cmath includes a function for

The standard math library cmath includes a function for taking the square root of a number. The heading (prototype) for this function is: double sqrt(double x) Write another function called closer_root that takes two rea ...

Software engineeringanswer each of the following questions

Software Engineering Answer each of the following questions posed for control and data when applied a "stepwise refinement approach" to develop three different levels of procedural abstraction in a simple invoicing syste ...

  • 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