Forums Register Login

Employing polymorphism in client server architecture

+Pie Number of slices to send: Send
I have a client server architecture using tomcat and swing. I am trying to avoid big switch statements on the server side. I am trying to do that using polymorphism but I am running into some difficulties. In short the problem is that the object which implements an interface needs to be instantiated on the client side. The method that it defines uses a Database Access Object ( DAO ). It will be employed on the server side but needs to be defined on the client side b/c that is where we know what it should be. The problem is that I can't compile it as the common code is compiled first then the client and finally the server. I could put all the code in the common side but that does not seem right as the DAO object can only be used on the server side.

Has anyone experienced this type of problem and have any thoughts they could share.

Thanks
+Pie Number of slices to send: Send
I dont know if I have correctly understood your technical requirements. Its a bit difficult to understand with just words. A small sample would have helped. Nevermind, thought I could share few things here:

DAO Objects- Obtain the data and wrap it in to beans and then forward them to the client side (I would be considering some JSPs?). So now which DAO to use on the server side depends on which data you would want to fetch. And that depends on the request from the client.

Always there should be loose coupling between difference components and each component must be highly focused on its operation.

And Am still thinking- client-server architecture using Tomcat and Swing? How is this possible? Or is it an Applet being used?
For my next trick, I'll need the help of a tiny ad ...
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 681 times.
Similar Threads
How to retrieve detached @ManyToOne entities with relationship
My new way to handle timeout lock
getting null response while calling glue webservice
socket read-write-read-write-...
need help on posting xml over http
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 02:15:41.