Avatar of Rohit Bajaj
Rohit Bajaj
Flag for India

asked on 

Modeling a class in java

HI,
I have a web application in which user can enter a rich text note.
Along with that there is also an option to write a message .
This application is used inside another chat application.
And so the rich text note that is created by user is shared with the another user along with Message.

Now the message does not seems to be logically part of a note...
I have created a note class to model it :
Note {

String body;
String title;

}

Now should i put String message also inside the note object ??
As the whole thing will be shared as a json....
If i put the message inside note its very easy to deserialize it.

On the other hand i feel that message actually is not part of the note... in that case what should i do how do i model this into a class ?

Thanks
JavaJava EE

Avatar of undefined
Last Comment
ste5an

8/22/2022 - Mon