• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Fbn question about design

 
mao lao
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello, friends:
I have 4 question about the design choice.
1. the security manager,
because I do not want dynamic download, so no policy file will be used.
Do I still need the following code in server side?

2. Exception handling
I decide to use DataInterface extends remote, both local and remote implements it, so client need to handle RemoteException even in locale mode. It is OK? I think it is same as someone just use Exception in both mode.
3. Book seat
I want to put doBook() in Data class or in server side, so do not need to care about if client crash or not, even though I think for this assignment there is no need to handle client crash, becaurse otherwise maybe we have to rollback the transaction , but in case SUN suddenly test this case, if one client dead when read, modify, the whole server will freeze
of cause put business logic in Data class is not a good idea, but it is clear and simple. in reality put business logic in server side is ok, it that correct?
4 about lockManager
I think subclass Data class in remote side that have lock and unlock is similiar with a new class LockManger if not use singleton(I think singleton is not necessary in this case),
Is that ok for me to implement it like this?
Thanks for any help
[ September 02, 2003: Message edited by: mao lao ]
 
Andrew Monkhouse
author and jackaroo
Marshal Commander
Pie
Posts: 12007
215
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Mao,
because I do not want dynamic download, so no policy file will be used.
Do I still need the following code in server side?

No, you do not need that code.
I decide to use DataInterface extends remote, both local and remote implements it, so client need to handle RemoteException even in locale mode. It is OK? I think it is same as someone just use Exception in both mode.

That should be OK. It is nicer if you can abstract the connection process on the client side, so that only one class is aware of whether you are connecting locally or remotely (factory or facade). Then most of your GUI will not need to worry about RemoteException.
I want to put doBook() in Data class or in server side

Hmmm. Think about the instruction "The remote client code that you write must provide all the public methods of the suncertify.db.Data class." Are you still meeting this requirement? So even if you don't call lock() remotely, could a client written by someone else call lock() from remote code?
I think for this assignment there is no need to handle client crash

You are not alone there. Others have argued that this is not necessary, and have received good marks without it. Personally I am not sure - since if we allow remote clients to lock records, then any crash could render a record permanently locked. I think this is bad design.
I think subclass Data class in remote side that have lock and unlock is similiar with a new class LockManger if not use singleton(I think singleton is not necessary in this case),

Singleton is not required, and may be undesirable.
But having multiple instances of Data class can cause problems as well - especially with the add() method.
Regards, Andrew
[ September 02, 2003: Message edited by: Andrew Monkhouse ]
 
mao lao
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you, Andrew.
I will rethink about the client crash.
 
mao lao
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, Andrew
After reread the specification I realized that client id should be used and yes, the unreferenced is a good idea
SUN: If an attempt is made to unlock a record that has not been locked by this connection, then no action is be taken
so it implies that ConnectionFactory is the design they want. right?
 
Andrew Monkhouse
author and jackaroo
Marshal Commander
Pie
Posts: 12007
215
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Mao,
Connection factory is the most common way to meet this requirement.
Regards, Andrew
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic