Newsletter sign-up
View all newsletters

Enterprise Java Newsletter
Stay up to date on the latest tutorials and Java community news posted on JavaWorld

JavaWorld Daily Brew

software engineering with objects



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);

Your rating: None