This week's book giveaway is in the Mac OS forum. We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line! See this thread for details.
In RMI, I need to create: 1) a interface which extends java.rmi.Remote 2) a class which implement this interface and extends UnicastRemoteObject But, where can I extends Data class at FBN project? or I need to copy and paste the codes from Data.java to the implemention class? Thanks Michael
Michael, Create a separate server class extending UnicastRemoteObject (which implements Remote). This is the remote server that clients somehow attach to. This class can then access Data on behalf of the client. You probably don't want to make Data (or a subclass of it) remoteable. After all, Data will have to be used locally at the client as well, to meet the local-mode requirement. Jerry
Jerry, Separating the Data class from the Remote implementation is a good option to iprovide modular design and to avoid code redundancy. But the requirement for "Data Client" says: To connect with your server, you should create a client program. This implementation should include a class that implements the same public methods as the suncertify.db.Data class, although it will need different constructors to allow it to support the network configuration. Does it means we have to directly implement all the public methods of Data in the client, without any wrap arounds ? Please comment., -Rajesh.
Joined: Sep 19, 2000
Rajesh, I certainly wouldn't reimplement the Data methods in the client class. The way I did local/remote transparency was with an adapter class. In local mode, the adapter holds a reference to a local instance of Data (actually, a subclass of Data). In remote mode, the adapter holds a remote reference to the server. In either case, the client just calls the adapter. Jerry
Joined: Jan 08, 2001
Jerry, Thanks ! Thats exactly what I had in my mind. To have a Client and server implementations holding local and remote references to the "Data" implementations on either side. The actual Data (or its subclass) is hidden. -Rajesh.
Originally posted by Jerry Pulley: Michael, Create a separate server class extending UnicastRemoteObject (which implements Remote). This is the remote server that clients somehow attach to. This class can then access Data on behalf of the client. You probably don't want to make Data (or a subclass of it) remoteable. After all, Data will have to be used locally at the client as well, to meet the local-mode requirement. Jerry
hi, i have a Remote interface and my Data class implements Remote Interface.I have a server class ,which implements Remote Interface and extends UnicastRemoteObject.In this server class , i need a reference to Data class ,so i can write implementation of methods that i am implementing with Remote Interface, but i do not like to make this Data object as remotable.How can i do this. thanks in advance kanwal