Question: 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
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
Get step-by-step solutions from verified subject matter experts
