ftsrg / BME-MODES3

Model-based Demonstrator for Smart and Safe Systems
https://inf.mit.bme.hu/research/projects/modes3
16 stars 8 forks source link

Remove the *Callback classes in the network hierarchy and put its functionality directly into the *Client classes #106

Closed benedekh closed 6 years ago

benedekh commented 6 years ago

Because it introduces an unnecessary complexity in the hierarchy network stack.

benedekh commented 6 years ago

The *Client classes cannot be removed as of now due to the IMessageHandler<_MessageType_> design pattern. In Java, due to type erasure, a class cannot implement two interfaces which only differ by their Generic Type binding.

That's why we need a separate Client class for each MessageType. But after that these messages can be handled by the same Callback, since they only need separate handler methods, e.g. on_MessageType_(....) as they are implemented now.