开发者

Serializable issues about resultset objects

开发者 https://www.devze.com 2023-03-04 05:06 出处:网络
I want to implement a CS application using Sockets. Th开发者_如何学Pythone 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

I want to implement a CS application using Sockets. Th开发者_如何学Pythone 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?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号