Hi Forrest,
Sorry for the seeming lack of info in the above reply, but the edit feature here at javaranch SUX worse than the search engine.
The edit ate half my reply! So let me try to reconstruct the first half:
1) For local database, I use Data class which implements IData that has all database method. for remore databse, the database class I used implements IData. So local/remote database is an object of IData. Based on local mode and remote mode, I get a IData object. Does it mean
I use abstract factory pattern?
I would say yes to that.
2) For remote database, I wrap the Data class.
Does it mean I use adapter pattern?
Well, that depends. The purpose of the Adapter pattern is to convert the interface a class to an interface that clients expect. Why would your clients expect an interface different from Data's public methods? It could be that you are using a Facade pattern instead. For example, if you never call the primative methods like getRecord(), modify(), lock(), etc., from the client but instead call methods like searchDB(), bookFlight(), etc., on the wrapper class which in turn calls the primative methods on Data, then that would be a Facade pattern.
3) To create an unique database instance, I think
I use singleton pattern?
That depends too. If you did something like this:
(See above for remainder of reply) Michael Morris
[ September 11, 2002: Message edited by: Michael Morris ]