jeudi 14 avril 2016

Which pattern to use for sending a change of a model over a protocol

We have a model of a real-live object like lets say a car. A car has two axis with two wheels each. The idea is that the model always has the same values as the car that is remote controlled.

Now we have a communication protocol over an asynchronous socket that can send messages like "WHEEL, WHEELID, 100". The other side will confirm the message.

Where should I place the Socket-Connection? Inside each of the wheels, would result in a lot of "use"-relationships to the socket-connection. Or is there a pattern that deals with this kind of situation?

Aucun commentaire:

Enregistrer un commentaire