aspose file tools*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes methods to expose in the remote object Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "methods to expose in the remote object" Watch "methods to expose in the remote object" New topic
Author

methods to expose in the remote object

parthiban subramaniam
Ranch Hand

Joined: May 15, 2002
Posts: 116
Hi guys,
lets say my remote object is a connection
when u have got a refrence to it .. then we assume you are connected to it .. and it exposes only a few methods .. for now only one
getTable(tableName)
which returns a Table object which implements the DataInterface this Table object has two objects one is data and the lockmanager as its private members and exposes all the public methods like add(String values[]) throws DatabaseException, RemoteException;
modify(DataInfo ModifiedDataInfo) throws DatabaseException, RemoteException;
in this way after the user is connected to the remote object he can get anytable which is there in the remote database server served by this obejct for now which has only table which is flights
am i in the right track or
or should i deffnetly expose all my public methods of data in the remote object ?? going by this design it does not make any sense to me
cheers,
parthi.


Even crazy and silly looking problems are sometimes real.
Michael Morris
Ranch Hand

Joined: Jan 30, 2002
Posts: 3451
Hi Parthi,
It looks like a good forward-looking design to me. You are hiding the complexities of interacting with the database and providing the client a means to use multiple tables. My design was different, but like yours, only one class on the client knew the primative Data methods.
Michael Morris


Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Ernst F. Schumacher
Sai Prasad
Ranch Hand

Joined: Feb 25, 2002
Posts: 560
Originally posted by parthiban subramaniam:
or should i deffnetly expose all my public methods of data in the remote object ??

I think there is a requirement to develop a client side class with all the public methods in the Data class.
John Smith
Ranch Hand

Joined: Oct 08, 2001
Posts: 2937

I think there is a requirement to develop a client side class with all the public methods in the Data class.

I think the original poster meant that a connection object should have only one method, getTable(), and that method returns an object that has all the public methods of Data. If so, this is a good design and that's how most of us have done it.
Eugene.
parthiban subramaniam
Ranch Hand

Joined: May 15, 2002
Posts: 116
Originally posted by Eugene Kononov:

I think the original poster meant that a connection object should have only one method, getTable(), and that method returns an object that has all the public methods of Data. If so, this is a good design and that's how most of us have done it.
Eugene.

yes Eugene
that is how my connection object which is the remote object serves its client
cheers,
parthi
Dayanand Kangala
Greenhorn

Joined: Sep 09, 2002
Posts: 26
Originally posted by parthiban subramaniam:
Hi guys,
lets say my remote object is a connection
when u have got a refrence to it .. then we assume you are connected to it .. and it exposes only a few methods .. for now only one
getTable(tableName)
which returns a Table object which implements the DataInterface this Table object has two objects one is data and the lockmanager as its private members and exposes all the public methods like add(String values[]) throws DatabaseException, RemoteException;
modify(DataInfo ModifiedDataInfo) throws DatabaseException, RemoteException;
in this way after the user is connected to the remote object he can get anytable which is there in the remote database server served by this obejct for now which has only table which is flights
am i in the right track or
or should i deffnetly expose all my public methods of data in the remote object ?? going by this design it does not make any sense to me
cheers,
parthi.

Hi,
(a) Shouldn't there be another method called "getTables()" in the remote object which returns the collection of tables available?
getTables() method may return pairs of "type, tablename". Here, type being values like "Flight Booking", "Contractor Booking", etc and tablename being "flights.db", "contractor.db", etc.
(b) I understand that when you add new record, you will call add(String values[]) method. I don't understand how you will identify a user as connected to "flights.db" (or) someother table. Are you passing the tablename and customerid as part of the values array?
Dayanand.
parthiban subramaniam
Ranch Hand

Joined: May 15, 2002
Posts: 116
hi,
well i started of all this looking at real day to day development designs ..
the server gui has the ability to add tables and remove them and view all the tables served by this server
so your getTables() is there ..
right now i dun think there is a need for this in the client side ...
well in the client side he gets a connection in any case be it standalone or remote .. using this connection an object gets a table just b'fore it performs any operation just like we do in jdbc only this time this design forces the filghtbooking controller or the cargobooking controler to get the table and then interact with the table
i dun think a table name in the database will be keep on changing all the time so its hard coded as flights for the booking who is goin to interact with flights table
if they are changing the table name .. as in real world development they haveto change the table name in the controller as well ..
so b'fore you do any operation get the table and interact with it ..
can go without hard coding it .. but thts whole lot of work .. i dont think that much is needed for this assignment
well ill know in 3 weeks time
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: methods to expose in the remote object