Question : Frame.onMessage evolution capacities

3 messages - 207 views

After a big reflexion about Frame evolution capacities, I want to ask your opinion about a possible change of the onMessage signature :

from Frame.onMessage(String name, Object[] arguments) to Frame.onMessage(Object identifier, Object[] arguments).

In this case, it will be possible to use Frame with a more fexible identifier (instead of name String).

 

This decision could affect your work ... then what do you think about that ?

Yeah, I guess it wouldn't hurt. If using string identifiers only on more cast is needes so sit should work with only minor changes to existing code. If I may enquire as to what is the reason for this change ? Or what can be done with the added flexibility ?

The reason is that Frames aren't only designed to be used with Kuix. I'd like the concept of Frame and I would add the possibility to use it not only to intercept Kuix user actions.

The power of frames is to be able to hide or not special message (event) process in a very simple way. For example, it could be possible to use the frame concept to process Socket or Bluetooth binary réception. In this case the identifier could be an Integer or what else, it depends of the implemented protocol.

In Kuix use, String are needed, because of the XML origin of the actions. But for pure java use we can save memory by using smallest objects.

In an ideal way we could imagine to change te signature to Frame.onMessage(Object identifier, Object data). And in this case data could be a String[] (Kuix use) or byte[] (raw data extract from a socket or BT connection) or everything that could be an Object.