Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

How would I reimplement this voice mail system so that the Law of Demeter holds? In particular, the MailSystem class should NOT give out Mailbox

image text in transcribed

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

How would I reimplement this voice mail system so that the Law of Demeter holds? In particular, the MailSystem class should NOT give out Mailbox Objects. Instead, you need to add additional methods to the MailSystem class. Critique the java.io.file class. Where is it inconsistent? Where does it lack clarity? Where is it not cohesive?

ch02/mail/Message.java 2 A message left by the caller 4 public class Hessage Construct a Message object @param messageText the message text 1 public Message(String nessageText) text nessageText; 12 13 14 Get the nessage text greturn nessage text 16 17 18 ' 19 public String getText() 21 return text; 23 24 private String text; ch02/mail/MessageQueue.java 1inport java.util.ArrayList; 4A first-in, first-out collection of messages. This 5 inplementation is not very efficient. We will consider 6 a more efficient inplenentation in chapter 3 8 public class MessageQueue Constructs an empty message queue 12 13 public MessageQueue() 14 ch02/mail/Message.java 2 A message left by the caller 4 public class Hessage Construct a Message object @param messageText the message text 1 public Message(String nessageText) text nessageText; 12 13 14 Get the nessage text greturn nessage text 16 17 18 ' 19 public String getText() 21 return text; 23 24 private String text; ch02/mail/MessageQueue.java 1inport java.util.ArrayList; 4A first-in, first-out collection of messages. This 5 inplementation is not very efficient. We will consider 6 a more efficient inplenentation in chapter 3 8 public class MessageQueue Constructs an empty message queue 12 13 public MessageQueue() 14

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

More Books

Students also viewed these Databases questions

Question

Food supply

Answered: 1 week ago