Skip to main content

Questions tagged [law-of-demeter]

1 vote
3 answers
978 views

In Python it is very common to see code that uses method chaining, the main difference with code elsewhere is that this is also combined with returning an object of the same type but modified. This ...
Ezequiel Castaño's user avatar
2 votes
4 answers
1k views

Suppose I have a Attendance class public class Attendance { private PersonInfo personInfo; public PersonInfo getPersonInfo() { return personInfo; } } And I want to check if person is ...
user3153970's user avatar
0 votes
2 answers
3k views

My apps commonly have one or more prop holders. These holders contain config data used in the app such as: @Component @ConfigurationProperties(prefix="app.orders") @Data //lombok public class ...
James's user avatar
  • 285
4 votes
6 answers
1k views

I want to display the product, and the product card has a lot of information about the product and the owner. How to deal with Law of Demeter in this product - owner relationship? In controller I ...
vovon's user avatar
  • 57
3 votes
2 answers
2k views

Given this code from the Symfony framework: use Symfony\Component\HttpFoundation\Request; public function indexAction(Request $request) { $request->isXmlHttpRequest(); // is it an Ajax ...
bln_dev's user avatar
  • 189
0 votes
2 answers
191 views

For context, I'm building a GTK+ application in C where a subclass of GtkApplicationWindow creates and displays a subclass of GtkToolbar and a GtkNotebook (a widget with multiple pages that can be ...
Chase Patterson's user avatar
3 votes
2 answers
1k views

Let's say I'd like to perform the following command: house.getFloor(0).getWall(WEST).getDoor().getDoorknob(); To avoid a NullPointerException, I'd have to do the following if: if (house != ...
q126y's user avatar
  • 1,733