Answered step by step
Verified Expert Solution
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
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 idStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started