Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Urgent in java please The Law of Demeter or principle of least knowledge is a design guideline for developing software, particularly object-oriented programs. Formally definition,

Urgent in java please

image text in transcribed

The Law of Demeter or principle of least knowledge is a design guideline for developing software, particularly object-oriented programs. Formally definition, the Law of Demeter requires that a method m of an object O may only invoke the methods of the following kinds of objects: - O itself. - m's parameters. - Any objects created/instantiated within m. - O's direct component objects. - A global variable, accessible by O, in the scope of m. Demeter's law is known as "don't talk to strangers" because: Each unit should have only limited knowledge about other units - only units "closely" related to the current unit. Each unit should only talk to its friends - don't talk to strangers. Only talk to your immediate friends. Figure 1: The Law of Demeter 2 Problem Description In this lab, you are going to implement a Java program that a HouseBuyer can take information from a RealEstateAgent about a specific House. You are expected to implement your program as you seen in figure of class diagram below (you are free to design your program.). Please be careful not to violate the law of Demeter. In your program, when you invoke requestHouseInfo(id) method, program should print information about house according to its id

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

Main Memory Database Systems

Authors: Frans Faerber, Alfons Kemper, Per-Åke Alfons

1st Edition

1680833243, 978-1680833249

More Books

Students also viewed these Databases questions

Question

=+h. Do all of the related materials project one cohesive message?

Answered: 1 week ago

Question

Solve for x: 2(3x 1)2(x + 5) = 12

Answered: 1 week ago

Question

LO1 Summarize the organizations strategic planning process.

Answered: 1 week ago