Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

a) Draw the class diagram for the current implementation of ClientI, Client2, Client3, Client4 and Person classes b) Current implementation violates some of the OO

image text in transcribed
a) Draw the class diagram for the current implementation of ClientI, Client2, Client3, Client4 and Person classes b) Current implementation violates some of the OO design issues discussed in the class. What are the drawbacks of the design? How can you refactor it? Draw the class diagram for th public class Clienti public static void printPerson (Writer out, Person person) throws IOException t out.write (person.first) out.write("")i if (person.middle-null) f out.write (person.middle) out.write(" out.write (person.last) public class Client2 public static String formatPerson (Person person) String result- person.last +"," person.first: if (person.middlenull) result +"+ person.middle; return result public class Client3 public static void display (Writer out, Person person) throws IOException i out.write (person.last) out.write(", i out.write (person.first); if (person.middle- null) out.write("") out.write (person.middle) public class Client4 public static String toString (Person person) return person.last +","+person.first + ((person.middlenull) ?": person.middle) public class Person public String last; public String first; public String middle; public Person (String last, String first, String middle) this.last last; this.firstfirst this.middle middlei

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

Students also viewed these Databases questions

Question

The fear of making a fool of oneself

Answered: 1 week ago

Question

Decision Making in Groups Leadership in Meetings

Answered: 1 week ago