3
votes
7answers
294 views

Naming guard clauses that throw exceptions

I have a function evaluate() that parses a String for some variables and replaces them with their corresponding value: public String evaluate() { String result = templateText; for ...
20
votes
5answers
973 views

Pass ID or Object?

When providing a business logic method to get a domain entity, should the parameter accept an object or an ID? For example, should we do this: public Foo GetItem(int id) {} or this: public Foo ...
6
votes
4answers
529 views

Design pattern for handling a response

Most of the time when I'm writing some code that handles the response for a certain function call I get the following code structure: example: This is a function that will handle the authentication ...
5
votes
2answers
755 views

What to do with private fields with getters and setters in Java

When are Getters and Setters Justified is an excellent question which focuses on using getters and setters as part of the external interface. What I am struggling with is ... by having getters and ...