Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

You read the following (sparsely commented) Java code written by somebody else (in several files), with irrelevant details omitted: a) Write the UML class diagram

You read the following (sparsely commented) Java code written by somebody else (in several files), with irrelevant details omitted:

a) Write the UML class diagram for the design used in the above code. Include multiplicity, attributes and operations.

b) What design pattern is at work in this application? Analyze the intent of the pattern and look at how objects interact. Explain your answer in detail.

image text in transcribed

1 public interface Videoclip t 2 void play (JComponent comp) 3 void stop() // start playing the videoclip // stop playing the videoclip 6 7 public class Lecturevideo implements Videoclip f 8 public LectureVideo (LecturePDFFile notes, Date whenRecorded, Instructor who) / details not relevant 10 12 public void play (JComponent comp) f 13 14 15 16 public void stop) // details not relevant /t details not relevant 18 19 : 20 21 22// class Captionedvideo is a videoclip that also plays closed captions 23 // (stored in class CaptionInfo) 24 public class Captionedvideo implenents Videoclip t 25 public CaptionedVideo(Videoclip clip, CaptionInfo captionsInfo) f 26 27 28 29 30 this. clip clip: this.capInfo captionsInfo; // details omitted 31 public void play (JComponent comp) 32 this.clip.play(comp); this.capInfo.play (comp) 34 35 36 public void stop() 37 38 39 40 41 private Videoclip clip; 42 private CaptionInfo capInfo; 43 this.clip.stop( this.capInfo.stop) 45 46 public class Player [ 47 public static void main(Stringl args) f 48 49 59 Caption Info capinfo-..... // not relevant LectureVideo Lecturevid .. .. CaptionedVideo capLecturevid new CaptionedVideo(lecturevid, capInfo) 52 53 54 JComponent wnd -.... capLecturevid. play (wnd) l not relevant 56 57 H

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Online Market Research Cost Effective Searching Of The Internet And Online Databases

Authors: John F. Lescher

1st Edition

0201489295, 978-0201489293

More Books

Students also viewed these Databases questions