A user can mention another user on my page.. That is he just writes something like hello @rohit.
So i need to save this comment in Database. If i save the exact comment "hello @rohit" the problem is that if the user changes its display name from rohit to rohit1 This wont get reflected on the page..
So i need to store hello someId which corresponds to the user.. And while returning the response i need to replace the id's with the name.
Please suggest exact ways how i can accomplish this... As obviously in the above the user may actually type in hello someId and so there should not be any parsing.
I have one approach but dont know if its effecient or work well..
a cooment like hello @rohit will go in the db like hello <user>id</user>
Basically we will use a xml tag . And also convert the rest of the string which is hello here... may be encode it so that it doesnt mix with xml...And then while returning the response we just parse the user tag and replace every id with name.
Please suggest pros and cons of the above. And any alternative ways.