Samual Harvey<br />SCJP2<br />SCJD2
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
I was wondering if these two could be combined into one class called DataAccessManager which contains all the methods of DataAccessFacade and can also determine whether the connection requested in local or remote.
Samual Harvey<br />SCJP2<br />SCJD2
1. If we run the client with command line localhost parameter then the client knows if it is local/remote.
in case of local it can create data object directly and for remote it can do a lookup using the localhost, get the reference... So you may not need a Factory class on the server side.
Samual Harvey<br />SCJP2<br />SCJD2
No here by localhost I meant the parameter to the client, absence of which means local and presence mean remote.
Samual Harvey<br />SCJP2<br />SCJD2
OK that I can understand but can you put your thoughts the question that I still have.
Samual Harvey<br />SCJP2<br />SCJD2
Mark is in Bangladesh on a mission, but I think he would say something like this:
"Well, I want to be a math teacher, but if I were a CS teacher, I would stress that the first OO principle is to give each class a narrow, highly focused set of responsibilities. The factory is a creational pattern and the facade is a structural pattern, so don't mix the two, instead use a combination".
Ashik Uzzaman
Director of Engineering, Twin Health, Mountain View, CA, USA