java - Handling Objects coming from RMI server and delegating to objects in the client -
I am using RMI using an instant chat application the server sends some objects through, I want to handle For example, the server will send a My question is how can I handle classes that come from the server from a class so I do not have to make statements? I.e. Using one of the possible options in your case is the design panoron Make some abstract of potential operators (such as Where Then you can check this field in the solid operators (though in the As a simple example, here is a handler Defense conducts a default implementation In this case your Read the article to get more information connected group operation class. In my client application, I need to identify the class and move my handler (
HandleJoinedGroupOperation ). This class will make a bunch of stuff on the client side.
if (join the server.getResponse (example) group operation) {handeljoint group operation handle = new handlodge group operation (); Handle.foo (); }
HandleJoinedGroupOperation ), then linking those handlers (at the start time) as an example, create an interface
Interface OperationHandler {zero handle (Operation op); }
operation is also a basic type for all possible tasks; in this type (
operation ) the type of type of operation type Can be:
enum operation type {...}
If the statement is included, but those statements will be explained in each specific handler)
class SimpleHandler Opreshnhandlr {private Opreshnhandlr Next; Public Zero Handle (Operation Option) {if (op.getType () == OperationTip.SOMEYOURTYPE} {// some stuff} and {next.handle (op); }}}
server.getResponse () method will simply return the original type of
operation hierarchy
Comments
Post a Comment