Peter den Haan | peterdenhaan.com | quantum computing specialist, Objectivity Ltd
Point taken, but with normal termination I would hope that the client will call DataInterface.close(), which in turn should clean up any resources held (such as any outstanding locks), rendering the whole point rather academic.Originally posted by Sai Prasad:
I am not calling System.gc() or setting my remote reference to null. You are right about the garbage collector. Take a look at the link below [...]
Peter den Haan | peterdenhaan.com | quantum computing specialist, Objectivity Ltd
I have only Data instance per table. I also have a server side DataFactory which decides whether to open the db file or return the already opened db file.
You also need to think about synchronizing the calls from multiple clients accessing the same Data instance. You probably will have one remote object which implements the Data interface (Interface with all the methods in the Data class) per client.
If in the future you expand this design to include passenger table, then I will have one more Data instance just to server the passenger table.
Do you have a collection object to store these various Data instances
This is demonstrably wrong.Originally posted by Richard denSeig:
I interpreted the close() to mean that the database should shutdown...
Peter den Haan | peterdenhaan.com | quantum computing specialist, Objectivity Ltd
Originally posted by Uma Yarakaraju:
1. How should the ConnectionFactory be coded for resuse so that there can be multiple Data instances each for a different table. Shouldn't i have a collection object which can store these various Data instances?
Originally posted by Uma Yarakaraju:
2. Also, when the client gets the ConnectionFactory object should it ask for a particular Data instance (say for passenger table or something else). If so how?
Thanks in advance,
Uma
This is demonstrably wrong.
In a good OO design, there is no code that looks like
code:
--------------------------------------------------------------------------------
if (localMode) { db.close();}
--------------------------------------------------------------------------------
which effectively boils down to
code:
--------------------------------------------------------------------------------
if (db instanceof Data) { db.close();}
--------------------------------------------------------------------------------
Polymorphism is the OO architect's favourite mechanism to avoid this type of conditional behaviour
Depends on the effort. I implemented some basic support and, off the top of my head, was not penalised on design.Originally posted by Uma Yarakaraju:
Do you think i might be penalized if I implement it.
Peter den Haan | peterdenhaan.com | quantum computing specialist, Objectivity Ltd
Do you want ants? Because that's how you get ants. And a tiny ads:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
|