Reputation
Top tag
Next privilege 2,000 Rep.
Edit questions and answers
Badges
7 11
Impact
~212k people reached

Apr
30
answered How can I avoid duplicating information in this scenario?
Apr
29
answered How do you address the problem of dealing with an external service that stores your data and you want to keep in sync?
Apr
29
comment Testing properties with private setters
Can't you configure your mock as returning a further set of mocked objects ? Those mocked objects would be set up with districts. Or, just return objects adhering to the same interface (with District fields) that aren't your specific entity objects
Apr
29
answered Testing properties with private setters
Apr
29
revised When to use functions vs methods?
there're -> there are
Apr
29
comment When to use functions vs methods?
What about docs.oracle.com/javase/8/docs/api/java/util/function/… ?
Apr
29
suggested approved edit on When to use functions vs methods?
Apr
27
comment Set data in multi-level objects (may be using Java Reflection)
I assume (!) it's just using reflection, like the original questioner's code, but someone has gone through the development pain in advance. I think the XPath compilation takes some time, but I seem to remember you can do a precompilation of that. To reiterate, I don't think it's a good solution for the above, but rather I've used it when I've want to be able to specify attributes in an object hierarchy that I want to extract configurably. And for unit tests occasionally.
Apr
27
comment Set data in multi-level objects (may be using Java Reflection)
@Laiv - see my answer and the suggestion to use JXPath (I wouldn't normally recommend this, note)
Apr
27
revised Set data in multi-level objects (may be using Java Reflection)
added 375 characters in body
Apr
27
answered Set data in multi-level objects (may be using Java Reflection)
Apr
26
answered Design for a function to skip a step if called multiple times
Apr
26
comment Checking preconditions the proper way
AOP is certainly another approach that would work here, yes
Apr
26
answered Logging an audit trail (Java application)
Apr
26
answered Checking preconditions the proper way
Apr
25
answered Law of Demeter and its applicability
Apr
22
answered Giving a class many constructors and assigning via them as many properties as possible
Apr
22
answered Value of dependency injection in MVC with skinny controllers
Apr
22
answered Understanding client service discovery mechanism
Apr
22
comment Redesigning a builder to make it reusable
I'm sure you can do this without Spring ? I'm not against Spring, but I wouldn't advocate adopting it just for this