I am very indecisive (and confused) about this issue.
Having 3 or more b4j websocket servers, each of which manages a game (with a common user database), would it be better if the client (B4A-Android app) had a websocket for each server or one only?
I'm also arguing with myself to decide which objects to create and where to put them (in the app, of course). Surely they will have to work in a foreground service, but I don't know whether to create a "websocket handler" object (for each websocket) and put it directly in the service or, having a class for each game, put it in this one and the instance of this class in the service... or maybe in a different way yet (for example no "websocket handler" class at all, its code directly inside the game class).
If these doubts weren't enough... if in the future I wanted to make a B4I-iOS version of the app I wouldn't know how to "fix" the lack of services here - After all, I don't know iOS nor B4I at all.
Having 3 or more b4j websocket servers, each of which manages a game (with a common user database), would it be better if the client (B4A-Android app) had a websocket for each server or one only?
I'm also arguing with myself to decide which objects to create and where to put them (in the app, of course). Surely they will have to work in a foreground service, but I don't know whether to create a "websocket handler" object (for each websocket) and put it directly in the service or, having a class for each game, put it in this one and the instance of this class in the service... or maybe in a different way yet (for example no "websocket handler" class at all, its code directly inside the game class).
If these doubts weren't enough... if in the future I wanted to make a B4I-iOS version of the app I wouldn't know how to "fix" the lack of services here - After all, I don't know iOS nor B4I at all.
Last edited: