Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

URLyBird standalone/server design  RSS feed

Diego Manilla Su�rez
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi. I'm working on my standalone/server design. My first approach would be to have one interface, Server, which would extend Remote, and one implementation, ServerImpl, which would extend UnicastRemoteObject (and implement Server, of course). If the client/server mode were to be selected, I would create a ServerImpl instance and bind it in the RMI registry. Then I would get that instance through Naming.lookup() and pass it to the clients.

So far, so good. My problem/doubt comes with the standalone mode. To keep things simple, I had thought of creating the ServerImpl instance and passing it to the Client instance directly. No RMI involved, but the Server interface would then be extending Remote for no apparent Reason. The same goes with ServerImpl, the extension of UnicastRemoteObject would be completely superfluous, since no RMI would be used.

My question is: do you think this is an acceptable decission or should I spend more time working on a better class hierarychy? I'm not convinced of using it, but the instructions mention that we should keep things as clear as possible and the design mentioned above would be pretty straightforward.

Thanks in advance.
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!