Originally posted by Jeff Shen:
Using the Facade pattern to deal with all data related operations is an excellent idea, however my question is if the LocalData dose not implement DataInterface but the RemoteData implements the Datainterface, how can I use unique data object to represent both the LocalData and RemoteData.
Regards,
Jeff
... if the LocalData dose not implement DataInterface but the RemoteData implements the Datainterface, how can I use unique data object to represent both the LocalData and RemoteData.
Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Ernst F. Schumacher
Richard wrote:
What I suggest is that you create some sort of client-side proxy interface and hold the reference to the proxy interface in your code exposing all the methods relevant to the Data class, so what this means is that you would create a common interface and then create two concrete classes:
LocalDataProxy & RemoteDataProxy
There are no great people in this world, only great challenges which ordinary people rise to meet.
There are no great people in this world, only great challenges which ordinary people rise to meet.
My thinking is that by exposing all the public methods of Data class, we are giving full controll to those developing the client to add/ modify and update the data as they like. By exposing only the business methods we ensure that the data in saved into the database correctly cos it's only the server side who will be dealing with the db and this is carried out with proper locking mechanism.
Assuming others are using the FBNServer to develop their own clients and if a developer forgets to call the lock() method when doing the booking... don't u think the db will be messed up...
Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Ernst F. Schumacher