364 reputation
1512
bio website
location
age
visits member for 3 years, 5 months
seen Aug 20 at 12:50

Android freak, but still a noob.


Sep
24
awarded  Autobiographer
Sep
15
awarded  Famous Question
Sep
4
awarded  Nice Question
Aug
24
awarded  Good Question
Aug
20
comment Project structure: where to put business logic
Still there can be a lot of operations that do not belong in the entity, hence my concern about having too many classes and the problem of naming them. Such classes are just the encapsulation of a method, so why not just merge all the methods in a single class, whose single responsibility would be to manage operations related to the entity but depending on other classes.
Aug
20
revised Project structure: where to put business logic
added 17 characters in body
Aug
20
comment Project structure: where to put business logic
So you'd create a dedicated OrderTotalCalculator class stateless and with only one method. I like the naming, but if we create a class per domain operation needed, wont they proliferate and became hard to find? Would you consider merging this class with all the different OrderXXXOperation classes? If so, how would you name it? And finally, would you put those classes in the same package as the entity classes?
Aug
20
revised Project structure: where to put business logic
added 1 character in body
Aug
20
asked Project structure: where to put business logic
Aug
12
awarded  Notable Question
Jun
7
awarded  Popular Question
Mar
21
awarded  Scholar
Mar
21
accepted Why were default and static methods added to interfaces in Java 8 when we already had abstract classes?
Mar
21
comment Why were default and static methods added to interfaces in Java 8 when we already had abstract classes?
I've found this paper where Goetz explains the problem. So i'll be marking this answer as the solution for now.
Mar
21
comment Why were default and static methods added to interfaces in Java 8 when we already had abstract classes?
Sadly, this looks like the most plausible explanation. Maybe they wanted to have "cooler" collection classes, sort of what you have in C#, but they didn't want to or couldn't afford to rewrite or adapt most java.util classes.
Mar
21
comment Why were default and static methods added to interfaces in Java 8 when we already had abstract classes?
I don't think multiple inheritance is the main reason behind the change. It was deliberately not included in the language for a reason. Even Gosling stated in 1995 that "JAVA omits many rarely used, poorly understood, confusing features of C++ that in our experience bring more grief than beneļ¬t".
Mar
20
asked Why were default and static methods added to interfaces in Java 8 when we already had abstract classes?
Sep
11
comment Mutual observer pattern in Java
After reading the question a couple of times, and having no idea on how real applications of this kind are actually implemented, I'd suggest you to ditch the Exchange class, conceptually I find it too abstract. There could be a central "hub" system delivering stuff to clients but to abstract each communication act in a class sounds a bit odd to me. The Observer and Proxy patterns applied to the Client class sounds ok to me though.
Mar
5
comment You're hired to fix a small bug for a security-intensive site. Looking at the code, it's filled with security holes. What do you do?
You are assuming 1) he's going to be fired; and 2) once he's fired, he will not be able to find another job ever.
Feb
26
awarded  Constituent