Recommended: Sing it, brah! 5 fabulous songs for developers
JW's Top 5
Back to:
www.javaworld.com/javaworld/jw-01-2006/jw-0109-soa.html.
(ii) The following fragments of Java code are part of a Clinic system. For each
fragment a. to d. below discuss briefly whether or not it is consistent with the
Law of Demeter.
a. this.setDoctor(.Fabian Romanesco.);
b. Patient p1 = new Patient(.Eleni Smith., 26172);
p1.setDOB(21/07/46);
c. Clinic patientList =
this.getDoctor().getClinic().getPatientList();
d. System.out.println(this.dob);