• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

rmi/local approach

 
Markus Hopper
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello,
i'm developing the b&s-project.
i read some approaches how to handle the access to the remote/local db (throwing ioexceptions instead of remote ones, and so on)

my assignment says "your data access class must be called "data.java" and must implement the dbaccess interface."

now my question:
what about the approach to extend dbaccess interface to an interface that additional extend serializable. and my data-class implements it.
the assigment says only "must implement", but not "must directly implement".

(dbaccess <-- dbaccess+serializable <-- data)

with this approach i can implement an remote-dbfactory with one method getDBAccessSerializable().

the advantage would be, to use all the original exception defined in the dbaccess interface.

could someone confirm this approach with the assignment?

thanks in advance.

greetings, markus

ps: sorry for my poor english...
 
John Stone
Ranch Hand
Posts: 332
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Or can't you implement both interfaces in Data class?

Is the extra interface needed?

This way you would implement it directly, and we have other question: "Can Data implement more interfaces?"
 
Markus Hopper
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for your reply,

i found an answer at: http://www.coderanch.com/t/188807/java-developer-SCJD/certification/find-search
(third entry)

i will now adapt the dbaccess-interface in dbaccessremote's implementation.
for the client i will implement something like a data proxy, so the client must not care about local or remote access.

thanks in advance.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic