stevedlawrence commented on code in PR #1521:
URL: https://github.com/apache/daffodil/pull/1521#discussion_r2251967963


##########
daffodil-core/src/main/scala/org/apache/daffodil/lib/iapi/Diagnostic.scala:
##########
@@ -128,8 +128,6 @@ abstract class Diagnostic protected (
    */
   override def getMessage(): String = message
 
-  override def getMessageOnly: String = message

Review Comment:
   I think without the context out how things used to work, it doesn't feel 
totally clear to me what the difference between `getMessage` and 
`getMessageOnly` would be. Like, from a new users perspective clearly 
`getMessageOnly` returns only the message, but then it's not clear what 
`getMessage` returns? If it also returns just the message (as it does now) that 
feels confusing having two functions that return the same thing. Or if we 
change `getMessage` back so it returns the message + mode + context, then that 
also feels confusing since it's returning more than just the message.
   
   The approach taken here is "getMessage" returns just the message and 
"toString" returns mode + message + context. But maybe that's also not clear 
enough.
   
   I think maybe the core issue is that we used to think of the "message" as 
mode + message + context, but some API users didn't, they wanted just the 
actual message without the mode and context. So "message" has kindof multiple 
meanings depending on who you talk to. So it feels our API wants to resolve 
that potential confusion. With 4.0.0 and other API changes, now feels like a 
good time to correct that since people will have to make changes regardless.
   
   Maybe an alternative solution is `getMessage` returns just the message, and 
some new function returns message + mode + context (i.e. the same as 
toString()). Maybe `getMessageVerbose`,  `getMessageDetailed`, or 
`getMessageWithContext? Or maybe `getMessage` returns the detailed message, and 
we have `getMessageBrief` or something return just the message without context?
   
   I have no strong preference for what we pick, but in hindsight I'm not sure 
getMessage and getMessageOnly was the best choice.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to