This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Hi guys. I'm using GuiController class to obtain data class reference and to perform operations needed for GUI like searching records or booking rooms. I can't make my DataRemote class to be DB(data class interface) , because of exceptions that are thrown in the DB interface.
So in the GuiControler class I have one reference to the Data class and other reference to the DataRemote. So in order to avoid many if statements I decided to make Connection class
How do you think about this approach ? Is it ok for the SCJD or should I rethink my design.
Well I believe what Alecsandru believed (let me know if I am wrong) is that you may be able to use the Strategy Pattern (Having the interface DB implemented on the directConnection and remoteConnection) and the Adapter Pattern together (Having an instance of directConnection inside remoteConnection and calling the methods from directConnection inside remoteConnection)