[Yanel-dev] Best Practice Data Object Read/Write

Michael Wechner michael.wechner at wyona.com
Fri Jan 20 10:17:15 EST 2017


Hi Balz

Agreed!

I would put the create/save logic either into an independent library
referenced by the various resources or put it into a *shared* resource,
which can also be referenced from the other resources. The *shared*
resource is not really used as a resource to process requests.

Hope that helps

Michael

Am 20.01.17 um 09:51 schrieb basZero:
> Hi,
>
> as of my knowledge, yanel currently is heavily relying on the
> ResourceInput object when it comes to create and save a data document
> (XML) to Yarep. see create(ResourceInput input) methods.
>
> I see one big disadvantage in this:
> If you have a java class that also want to create data objects (XMLs)
> of a certain type, it can not just fill in a data bean and then store
> it to yarep (via JAXB). Because the logic for storing the XML is
> inside the Resource responsible for that type of data.
>
> Am I missing something or how do you deal with this?
>
> Concrete question:
> From a java class not being a yanel resource, I want to reuse the
> create/save logic of a certain data type that currently gets handled
> by a resource in the create() method. 
>
> I have the feeling that resources should just contain the business logic. 
> data handling should be disconnected via the facade pattern.
>
> Any comments on this?
> Cheers, Balz
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mx2.wyona.com/pipermail/yanel-development/attachments/20170120/4d22c71f/attachment.html>


More information about the Yanel-development mailing list