Reputation
1,086
Next privilege 2,000 Rep.
Edit questions and answers
Badges
5 10
Newest
 Enlightened
Impact
~10k people reached

  • 0 posts edited
  • 0 helpful flags
  • 26 votes cast
6h
awarded  Enlightened
9h
awarded  Nice Answer
9h
revised Why would a type be coupled with its builder?
Reword "upon" to "on" and make some small formatting changes. Also note that the Builder can be consumed from a different construction utility.
12h
comment Why would a type be coupled with its builder?
@Mat'sMug Within the package, either String consumes StringBuilder, StringBuilder consumes String, or they're colocated in the same top-level class. Outside the package, it doesn't really matter; they're both integral parts of the same API surface. And, for a lot of relevant commentary, see this API design talk by Josh Bloch where he explains his advice and (like in Effective Java 2nd Edition) he critiques the bad API design choices in the Java libraries. Link goes to 36:41, but the whole talk is worth watching.
12h
comment Why would a type be coupled with its builder?
@Mat'sMug My post above takes it as a given that the class needs that many constructor arguments. I'd likewise treat it as a design smell if we were talking about an arbitrary business logic component, but for a data object, it's not of the question for a type to have ten or twenty direct attributes. It's no violation of SRP for an object to represent a single strongly-typed record in a log, for instance.
13h
revised Why would a type be coupled with its builder?
Add note about the mutable Car example, and extend the benefits regarding constructor control to include serializability or validity.
13h
answered Why would a type be coupled with its builder?
Apr
14
awarded  Nice Answer
Apr
14
revised How to return warnings alongside result of calculation to caller of a Java method?
correct spelling mistake and clarify options
Apr
13
answered How to return warnings alongside result of calculation to caller of a Java method?
Mar
25
awarded  Critic
Nov
12
comment Are (database) integration tests bad?
@dodgethesteamroller Whether something is contrarian IS a matter of opinion or perspective; in a few years it may be the dominant line of thinking, for all I know. Don't read into my punctuation; my point is specifically not to judge it and merely to say that that if you think it's contrarian, and expound on it in 2 (now 3) comments, it's time for it to be an answer.
Nov
5
awarded  Yearling
Nov
4
revised Are (database) integration tests bad?
added 22 characters in body
Nov
3
comment Are (database) integration tests bad?
@dodgethesteamroller In-depth discussions of a "contrarian school" like that are probably best suited to their own answer. Personally, I find that the Google Testing Blog does a pretty good job describing the virtues of fast, tightly-scoped automated tests alongside system-in-context tests. In case you found it unclear, I list the test pyramid here as a useful model or starting point, not as an excuse to stop thinking as an engineer.
Nov
3
awarded  Editor
Nov
3
revised Are (database) integration tests bad?
Choose better words.
Nov
3
awarded  Mortarboard
Nov
3
awarded  Yearling
Nov
3
awarded  Good Answer