I want to implement a CS application using Sockets. The db query result are of different classes and I don't mean to put those methods handling the result in the server end, I just want the server dealing with db queries, so I decide to pass the resultset through networks. But resultset is not serializable. I wonder whether there are any proper approaches handling this?
Asked
Active
Viewed 403 times
1 Answers
0
It sounds like what you want to use is DTO's (I've heard it defined as both Data Transfer Object and Domain Transfer Object, but the idea is the same). You don't want to pass the actual resultset, all you care about is the data contained in the resultset, so you define classes that represent your data, and return a collection of instances of those classes, not the resultset itself.

Joel C
- 5,547
- 1
- 21
- 31
-
I mentioned in my question that there are many classes and many different querying cases to handle, so I won't put those codes in the server end. If I can pump out data from result set to a plain list similar to the resultset, I will manage this. – PiggyZhu May 09 '11 at 16:38