REST Api (was Re: Custom UI? )

John Mazzitelli mazz at redhat.com
Mon Jun 20 15:35:26 UTC 2011


On 06/20/2011 11:22 AM, Heiko W.Rupp wrote:
>
> Am 20.06.2011 um 17:12 schrieb John Mazzitelli:
>
>> Make sure those DTOs do not leak into our core domain model, stays
>
> What exactly do you mean with "leak" here?

Meaning these DTO objects are not placed in the core/domain module - 
instead they remain isolated in some special rest webapp module.

>
>> completely isolated within the rest webapp, and core RHQ developers
>> don't have to worry about them.
> One could of course put them into their own module that depends
> on core/domain, so that domain objects can never call into the "REST DTOs".

Yes. That is what I mean from above. Not sure if we even need a special 
module - just put them in whatever REST module you have for the webapp, 
unless there is some dependency issue I am not seeing.

>> If RE is prohibiting us from doing that, we either a) need to get
>> something else other than RE or b) we need to do the same amount of deep
>
> Well, the question on how far to traverse the domain tree when serializing
> the data into json or xml has nothing to directly do with RE.

This sounds like the concept of our "composite" objects which we do have 
on the core/domain. But those composite objects are used mainly as part 
of the SLSB API, and so are directly connected to the remote API. Those 
composites don't mimic the domain objects field-by-field, they have 
their own purposes (like shrinking down the over-the-wire objects to 
avoid sending too much unnecessary data for the particular request being 
made). These composites don't exist for the sole purpose of working 
around serialization issues that exist in the underlying comm layer.

If these REST objects are more like composites, then it could be less of 
a problem (since REST can be considered just another remote API anyway, 
and so matches the design pattern of our composites). But if these are 
DTOs that truly just map to existing domain objects almost 
field-by-field, that is what we have been avoiding.


More information about the rhq-devel mailing list