Using SignalR, I am wondering what the best way to set up my Hubs is under the following scenario: Say I have a web casino app (just for fun) and it has three games, Poker, Blackjack, and Slots. Poker and Blackjack are both multi-player so they have a chat feature and Slots does not. Okay, to support this I was thinking of setting up my Hubs in the following way.
BaseHub (Handles connection stuff that is common to Poker, Blackjack, and Slots)
PokerHub : BaseHub (Handles Poker game play)
BlackjackHub : BaseHub (Handles Blackjack game play)
SlotsHub : BaseHub (Handles Slots game play)
ChatHub (Handles chat features)
I was the thinking of having the Poker page of this web app connect to the PokerHub as well as the ChatHub and the Blackjack page would do something similar. The Slots page would obviously only connect to the SlotsHub.
Now, The things I am unsure about are: Should the Poker/Blackjack pages connect to both the PokerHub/BlackjackHub and the ChatHub or is there some way I could have them only connect to the PokerHub/BlackjackHub and delegate the chat features to the Chat hub? In that case I might create like an interface IHasChat or something like that. In either case should the ChatHub also extend the BaseHub? Currently the BaseHub only implements IConnected, IDisconnect and also handles basic Group functions (JoinGroup, LeaveGroup). Also, should the BaseHub be a shared instance (singleton)?
Lastly, if you think I am just going about it totally wrong please let me know. This is my first SignalR project and I know I am not an expert on it. Also, I know that there are actually several questions here. If you can answer any or all of them, either way I really appreciate it.
Thank You, Tom