If this is just a data object being shared by two apps, i'd define a base class with the shared information and extend it where needed. If operations are needed as well (or the data structure is different), I'd define an interface of the shared information and use two different implementations of that interface on the client and the service.
Also not sure why you want to use CustomData as a member, it makes more sense to extend it. On Thursday, October 17, 2013 1:40:07 PM UTC+3, Richard Zhao wrote: > > It's a special case. Client doesn't have the right to access db. > > On Tuesday, October 15, 2013 3:22:11 PM UTC+8, Jacky.Liu wrote: >> >> Your question make me think of OO database, you can make C/S both >> operate the database. >> Why bother to send the "CustomeData" back and forth . >> >> >> 在 2013年10月14日星期一UTC+8下午3时35分33秒,Richard Zhao写道: >>> >>> Hi there, >>> >>> I'm designing a client / service software. client / service are both on >>> some android. client and service communicate using messenger and data >>> format is class CustomeData. CustomeData also has some inner classes which >>> define detail structure. >>> >>> Do I need to make CustomeData as thin as possible? I intent to use it as >>> data format only recognized by both client and service. Service has >>> additional operations on CustomeData, and may store other info to it too, >>> for example _ID in DB. But client don't care what _ID is. >>> >>> I'm not sure whether I need to attach more operations on CustomeData or >>> create new objects in Service using CustomeData inner classes as a member. >>> >>> Thanks >>> Richard >>> >> -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en --- You received this message because you are subscribed to the Google Groups "Android Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.