Archived

This forum has been archived. Please start a new discussion on GitHub.

Help required with Slice design

Greetings :)

Our team is designing a fairly huge system and we would like to get our slice design just right so that our jobs aren't made any more difficult than they are already. We're all new to ICE so we're still getting our feet wet and have been running through the manual, but its time for is to dive in at the deep end.

For this, we're going ahead and designing our account creation and login systems for a virtual world. We read in Chapter 4.6 of the manual that we can nest modules and this could really make things easy for us. In the documentation for 4.6, the slice looks like this...
module ZeroC {
    module Client {
        // Definitions here...
    };
    module Server {
        // Definitions here...
    };
};

One of the questions we're wondering is that if we arrange our modules likewise, would we best having it so that for Server, that contains the definitions that are required to talk TO the server? Would the following example be a good way of doing things?
#ifndef _ACCOUNT_ICE
#define _ACCOUNT_ICE

module AccountService{
	module Server{
		interface Account{
			bool createNewAccount();
			string getServerBulletin();
			int getOnlineUserCount();
			void login();
			
		};
	};
	module Client{
		interface Account{
			string getSomethingFromClient();
		};
	};
};

#endif _ACCOUNT_ICE

Any advise would sure be appreciated! :D

Comments

  • benoit
    benoit Rennes, France
    Hi,

    Yes, this is a good way to separate Slice definitions which are going to be used by the client only and Slice definitions used internally by servers. It is much clearer to separate Slice types this way.

    Cheers,
    Benoit.
  • Thank you Benoit :) Wanted to make sure that my assumptions were correct.