Hi Sergey, Thanks for your response -- I'll look into this as a possible solution.
Tom From: Sergey Beryozkin <[email protected]> To: [email protected] Sent: Thu, 3 February, 2011 17:49:07 Subject: Re: Question about adding the domain object into the response Hi On Thu, Feb 3, 2011 at 4:44 PM, Thomas P. Fuller < [email protected]> wrote: > Hi, > > I'm developing some web services using CXF and in a few places it would be > dead > easy to simply return the entity object. The problem with doing this is > that: > > > 1.) Sending the domain object could result in a lot of unnecessary > information > being sent to the client. > 2.) It will expose our data model (ie. inner workings of our application) > to > the client, which means if the data model changes, then the clients will > need > to change as well. > indeed > 3.) We will need to fiddle the data model to deal with a marshalling > issues on > the client side (we have one low profile device and we already know this is > going to be a problem). > Another solution is to have an external data model that is used > specifically for > calls to and responses from the web services. The trouble with this > approach is > that it requires quite a bit of work because we'll need to map one set of > objects to another. > > that would be ideal but if a lot of information needs to be exposed then I can see your point... > Am I correct in the way I view this or have I missed something? > > If the mapping layer and external data model are required, would anyone > have any > suggestions on how to tackle the mapping effort quickly? > > Perhaps another option is the server-side transformation ? The transformer can strip off the fields the client does not need to know about... Cheers, Sergey > Thanks for your help, > > Tom
