[
https://issues.apache.org/jira/browse/FELIX-5678?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16853473#comment-16853473
]
David Leangen commented on FELIX-5678:
--------------------------------------
Hey [~bosschaert],
Hmmm, you may be right. It could be because I am using the Converter for
something much greater than what it was intended to be.
It is, in my framework, a central integration tool, allowing the front-end to
work seamlessly with the back end and data tiers, since all data is
communicated via DTOs == JSON. It turns out that, thanks to the Converter, this
kind of full-stack integration has a beautiful simplicity to it. No ORM etc.
required, just the plain old Converter. I would have thought that everybody
does this, which is why this functionality makes sense to me. If I am alone,
then indeed it would likely be out-of-scope of the original intention.
I'll have to give this some thought and get back to you. Perhaps what I need is
a higher level of abstraction based on the Converter. Then again, but for the
patch operation, the abstraction would probably be identical!
I'll put this on hold again for now. I'll first build what I need outside of
the Converter as you suggest, then decide whether or not it's worth trying to
integrate with the Converter, and how. After prototyping, I'll consider making
a proposal on the Felix list. Perhaps a paper to explain what I'm doing would
be in order as well.
Thanks, as always, for your comments.
> Allow merging of objects
> ------------------------
>
> Key: FELIX-5678
> URL: https://issues.apache.org/jira/browse/FELIX-5678
> Project: Felix
> Issue Type: Bug
> Components: Converter
> Reporter: David Leangen
> Priority: Major
>
> Given a typed object O1 and a "partial" representation of an object O2 (for
> instance in the form of a Map), allow O2 to be merged into O1.
> Example:
> {code}
> public class Foo {
> public String a;
> public String b;
> public String c;
> }
> Foo f = new Foo();
> a = "Eh!";
> b = "Be cool.";
> c = "See you later?";
> Map<String, String> m = new Map<>();
> m.put("b", "Be there or be square");
> Foo f2 = Converter.convert(f).merge(m);
> {code}
> I am sure there are many ways to skin this cat.
> If the Converter API cannot be changed, what would be the best way to tackle
> this problem?
> (In the meantime, while awaiting comments form [~bosschaert], I'll try to run
> a few experiments to see if I can come up with something reasonable.)
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)