This is a matter of philosophy of philosophy on how to closely tie messaging to your data model.
Given the pojo object, I can annotate it with Hibernate, JAXB, and JSON annotations so that the same class can be written to the database, as well as serialized / deserialized for messaging. The convenience factor is really high, because it means that I do not need to write translation classes to convert messages to classes that are used for the database (which is important for boredom and maintenance).
However, this has always bothered me, because it links your interface and messages to the structure and design of your data model. For certain types of applications, messages may be exactly what you want to save in the database, and in other cases it is a subset of the database fields.
Is there a better way to separate them without exposing myself to the tedious translation / conversion classes? Is there a pattern that I can use to at least better combine message and data?
I completely agree with your concern ... this is one gray area, because it really depends on the problems of your domain that you are trying to solve.
, . , (, Javascript) , . JSON/XML , .
, -, , ( ). JSON/XML, . , . , beans, , , beans. , JSON/XML .
@XmlPath EclipseLink JAXB (MOXy), ( MOXy):
Source: https://habr.com/ru/post/1792374/More articles:How to use jQuery slideDown () to set new rows added to a table? - javascriptHow does python program check its own md5sum? - pythonGet events from the Android calendar - 2.2 - androidhttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1792372/jquery-if-div-has-display-none-addclass-to-parent-class&usg=ALkJrhhnuosdnwz1U0M8mZCjqCxkQde6iAScaling UIScrollView in MonoTouch - c #Error: "Error converting bulk data (type mismatch or invalid character for the specified code page) for row 2, column 1 (date)." - sqlhttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1792376/how-to-observe-changes-to-the-items-contained-by-an-nsarraycontroller&usg=ALkJrhhbVfnXPtBNXFJ3X-YvwLRFS9ZzXAPassing a Lua variable to C - c ++How can I exclude quotation marks around parameters in an R function? - functionI use JSP with NetBeans and I get the following error - javaAll Articles