• Post Reply Bookmark Topic Watch Topic
  • New Topic

local and network mode

 
Beny Na
Ranch Hand
Posts: 159
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,


i am trying to design URLBi assignment by creating another DBMain interface to support network operation(assumed DBMain(network)), and the design will have two different data class for both local and network.
roughtly like below code:

<<DBMain(network)>> extends <<DBMain>>(original from sun)
Data(network) extends <<DBMain(network)>>
Data(local) extends <<DBMain(local>>

is there a way to avoid having two data class for local and network since the code does not have any difference(the code inside data class(local) and data class(network) is exactly the same, except it must extends remote and throws RemoteException)?




thanks

kaizen
 
Diego Amicabile
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You might consider using composition instead of (or along with ) inheritance
[ March 20, 2005: Message edited by: Diego Amicabile ]
 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!