Seeking thoughts on the following design. I know the design could be lot simpler if use Sockets. But I wanted to think of a design with pure POJO classes.


string id;
string displayname;


User user;
ChatManager room; //interface to access ChatRoom
readDeliveryReceipts  boolean;
LinkedHashMap<id-userid, AcknowledgeMessage>messages;
Message currentMessage;
displayMessage(Message message);//Adds an entry to logs 
acknowledgeMessage (String messageId);
acceptAcknowledgement(String messageId);

Message → TextMessage , Video Message , Audio Message (inheritance)

-string id;
-DateTime timestamp;
-User user;
-string text;

AcknowledgeMessage (use decorator Pattern) //Store Message logs

-Message msg;
-Type (ServerAccepted , SentToClient);

ChatManager //An Adapter Class to interact with ChatRoom

ChatRoom room;
sendMessage(Message message);
register(ChatWindow window);
deregister(ChatWindow window);
acknowledgeMessage(String messageId);

ChatRoom (Chat Session)

List<ChatWindow> chatWindows;
BlockedQueue<Messages> messagesToSend;

//Listener Pattern
register(ChatWindow window);
deregister(ChatWindow window); 

receivingMessage(Message); //will add it to the Queue and send acknowledgement
//Listener Pattern
sendMessage(Message);   //Will iterate all the chatwindows

closed as too broad by MichelHenrich, Ixrec, JeffO, user22815, user40980 Mar 1 '16 at 16:29

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • This isn't Code Review, but I suppose your interface definitions (???) aren't "code" (particularly with the strange inconsistent semi-colon usage). Please clarify what it is that you are asking. – Tersosauros Feb 29 '16 at 6:28
  • 1
    What do sockets have to do with anything? They are a mechanism of delivering messages, there is nothing about them that would not allow you do have a POJO-based application... – JDT Feb 29 '16 at 12:14
  • Please read: Are Design Review questions on-topic? – user22815 Feb 29 '16 at 22:34