This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Hi, I am having a small problem and I think I know why. I need someone to verify this. I originally coded my LockManager to use a Connection object reference as clientId. My Connection object extends a UnicastRemoteObject class. Its stub extends a RemoteStub class. On the client side, I tried to access the connection after looking up my ConnectionFactoryImpl by just doing a connectionFactoryImpl.getConnection(). This resulted in a ClassCastException. I think it's because the Connection and Stub extend differnet Remote classes as stated above. I did not use a ConnectionInterface as it seemed unnecessary. Connection implements RemoteDataInterface which inturn extends DataInterface (as Peter suggested in one of his recent answers). As long as I access the Connection itself as DataInterface on the client side, every thing works cool. I also had to put the getLockManager() method on my ConnectionFactoryImpl because my client no longer knows the Connection, it only knows it as a DataInterface. LockManager now takes DataInterface as clientID (under the covers it is still Connection, client just does not know it as such.) Please let me know if you aee any problems with this. Thanks, Aruna.