Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 4B9A0200B66 for ; Thu, 18 Aug 2016 14:50:51 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 48840160AAE; Thu, 18 Aug 2016 12:50:51 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 6739E160AAB for ; Thu, 18 Aug 2016 14:50:50 +0200 (CEST) Received: (qmail 92723 invoked by uid 500); 18 Aug 2016 12:50:49 -0000 Mailing-List: contact dev-help@felix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@felix.apache.org Delivered-To: mailing list dev@felix.apache.org Received: (qmail 92711 invoked by uid 99); 18 Aug 2016 12:50:49 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 18 Aug 2016 12:50:49 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id D24FC1A5CAD for ; Thu, 18 Aug 2016 12:50:48 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.429 X-Spam-Level: * X-Spam-Status: No, score=1.429 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, HTML_MESSAGE=2, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd2-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx2-lw-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id xtzV-4TqJ3dm for ; Thu, 18 Aug 2016 12:50:45 +0000 (UTC) Received: from mail-it0-f53.google.com (mail-it0-f53.google.com [209.85.214.53]) by mx2-lw-us.apache.org (ASF Mail Server at mx2-lw-us.apache.org) with ESMTPS id CA07A5F3F5 for ; Thu, 18 Aug 2016 12:50:44 +0000 (UTC) Received: by mail-it0-f53.google.com with SMTP id e63so25531119ith.1 for ; Thu, 18 Aug 2016 05:50:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=CDrRp68o41r/1bIQTcxuION3dgz2CkS/bGujnjpiqkI=; b=YOwvhOo/S1BD+AU5vahXxWo4Qy+xRkVTuTVrTwxJ/ocQ6u3XbdizH4aP6TzQwi1Ft/ sXtgGVXU5uDVech4EVOid25K4YqZT5T/zv5GBZHw32wxVNdJEaKbLCu/VpIjDJTqCm5f XEfw7bwR2D2SENW+dH+OsdzX0OSe9cEQH/roLdxtQJFW2pTtjleWVSYAYwvHoOXZcUGx 6ldgXQYX/N7GJKHgByzKd2984PbwfPyfjJvVIbL7ONswYRdgDDGSnpf7yWv/OEKGHOXm lfIeX2X0QB5wV44TV7yBxvJbJ/G20F1w9IwXiFkdrfQl9i1kRhU9g1CBZOT3RVD8XlRB 4JZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=CDrRp68o41r/1bIQTcxuION3dgz2CkS/bGujnjpiqkI=; b=ljc7zmaWeiVYvoe+j6LAe/DMpG+BUh4wisFKEX28hUpNvFUHcgRqHQMEbpeKHUPw4M uRk7y/rapnxIAsD1t8sqraFCNkcf7uE/D0Hi7/VPDRXEdHjhES88wjaxUs4jvWvErkwZ ORiXkJ1F+W4E0LnAqgyits8ZZ6xgA/JIpvTUC187MfmT4fanWoahRJ9eLUl6dH7ZvZoO pc+cVMW4xPv73CJm3WxUwwEQ1dwmje+FMvACP5uqg6PWioqxfsqy2ZPxC8NPMi2oz1/m W/gHB94BENhC+3h+rSaZaWTNrY0jCtW9H3kYoZuRwpEkSOWw+YwwLYJPhv9LEz/qGYqn MHfw== X-Gm-Message-State: AEkoouvqF6svKM/KxGVqmZsrmVLgleIbkDv9sFM5ynr8UlolpRJgPzZcnCly8YMBCUtkRGVp3hhOcvk7WvwiZQ== X-Received: by 10.36.46.203 with SMTP id i194mr33342798ita.69.1471524644063; Thu, 18 Aug 2016 05:50:44 -0700 (PDT) MIME-Version: 1.0 Received: by 10.50.46.170 with HTTP; Thu, 18 Aug 2016 05:50:43 -0700 (PDT) In-Reply-To: <7BB0FB20-C9C2-4EEF-819C-12EDCC2F395C@leangen.net> References: <7BB0FB20-C9C2-4EEF-819C-12EDCC2F395C@leangen.net> From: David Daniel Date: Thu, 18 Aug 2016 08:50:43 -0400 Message-ID: Subject: Re: [jira] [Commented] (FELIX-5325) Patch for embedded DTO (in DTO) To: dev@felix.apache.org Content-Type: multipart/alternative; boundary=001a114aae5eb00f89053a58079f archived-at: Thu, 18 Aug 2016 12:50:51 -0000 --001a114aae5eb00f89053a58079f Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable So copy could work for immutability but it limits my ability to help the client (which is normally me and I am definitely stupid enough to not think about how I designed the system) but it doesn't help with how to add mutability of data objects transferred between services. I do think I may be trying to do too much with DTO's but I am still trying to wrap my head around where they should be used. Do I just use them as pojo's that come in and out of services and then immediately convert them to domain specific objects or do I let them stick around and try and make use of them. On Thu, Aug 18, 2016 at 8:26 AM, David Leangen wrote: > > David D., > > No! You just need to copy the DTO. Let the client do whatever it wants > with the DTO; it won=E2=80=99t mess up the system. If the client is =E2= =80=9Cstupid=E2=80=9D enough > to change the value of the DTO, then that=E2=80=99s the client=E2=80=99s = problem. > > There is no more worry about immutability / value object. There are only > copies of objects. > > BTW, that is why I suggested that we add a copy() method. > > It does take a change of mindset. I also came from the School of Immutabl= e > Objects. But copying objects works, too. > > > Cheers, > =3DDavid > > > > > On Aug 18, 2016, at 9:16 PM, David Daniel > wrote: > > > > So for the article above what I am struggling with is how to do > > immutability/mutability with the DTO spec. With java beans there is a > get > > and set method for each attribute. If DTO's had this the way I would d= o > it > > is as follows. I would have an attribute for mutability that is either > > true or false. If false I would put an aspect around the get function > that > > returns a clone of the attribute value. I would put an aspect around t= he > > set function that throws an exception. For mutable DTO's my converter > > would delegate deserialization to a CRDT service that would put aspects > > around set that watches for changes and aspects around get/set that > throws > > an exception if called when the DTO is in a conflicted state. The CRDT > > service would then return the DTO to the converter. On update it > modifies > > the CRDT structure as above. In the converter if the DTO is watched th= en > > when serializing it delegate serialization to the CRDT service. I am n= ot > > sure how to model immutability with the current DTO standard because > there > > are no get or set functions that I can put aspects around. > > > > On Thu, Aug 18, 2016 at 6:40 AM, David Daniel < > david.daniel.1979@gmail.com> > > wrote: > > > >> For me helps by having the schema that allows for something some other > >> service uses to do the automatic merging using the tools available in > >> dosgi, but I understand that nothing can be really automatic because i= t > can > >> require merges and there is garbage collection that will need to happe= n > on > >> the objects during reconciliation. If the DTO's are just public field= s > >> they do not offer anything over using a pojo. Where they start to be > >> useful to me is by defining in a standard way how the data can be turn= ed > >> into an object. Examples would be a way to define a key so that index= es > >> and equality can be determined, or defining relationships between sub > >> objects so when doing a deep clone the user can decide how many links = to > >> traverse. Scoping rules could also be defined so the converter has > >> information that could be used in determining which type of object to > >> serialize to in different situations. The standard can choose not to > >> define these things and let the application decide in order to be more > >> flexible or it can try to define some of these things in order to make > >> services or tools around DTO's more standardized. I think I am trying > to > >> follow what schema elements will be in DTO's and make sure that I take > >> advantage of them rather than writing my own. As of right now that I = am > >> just using them as pojo's though so I don't have any feelings or advic= e > on > >> the way to go and what types of schema things I would be able to take > >> advantage of. > >> > >> On Thu, Aug 18, 2016 at 4:23 AM, David Bosschaert < > >> david.bosschaert@gmail.com> wrote: > >> > >>> Hi Davids, > >>> > >>> What is it exactly from that article that you think would make sense = in > >>> the > >>> context of OSGi? The automatic merging of concurrent data updates? > >>> > >>> Thanks, > >>> > >>> David > >>> > >>> On 18 August 2016 at 07:50, David Leangen wrote: > >>> > >>>> > >>>> That is interesting, indeed! I only quickly skimmed through the > article, > >>>> but it does indeed appear to be a potentially interesting property f= or > >>>> dosgi. > >>>> > >>>> If I believe what the authors write in the abstract, it provides a > >>>> relatively simple and deterministic method that could be implemented > in > >>>> code. > >>>> > >>>> Cheers, > >>>> =3DDavid > >>>> > >>>> > >>>>> On Aug 17, 2016, at 10:21 PM, David Daniel < > >>> david.daniel.1979@gmail.com> > >>>> wrote: > >>>>> > >>>>> read an interesting article this morning > >>> http://arxiv.org/abs/1608.03960 > >>>>> Something like this would be an interesting property to have for > dosgi > >>>>> which is one of the use cases for DTO's > >>>>> > >>>>> On Wed, Aug 17, 2016 at 6:47 AM, David Leangen (JIRA) < > >>> jira@apache.org> > >>>>> wrote: > >>>>> > >>>>>> > >>>>>> [ https://issues.apache.org/jira/browse/FELIX-5325?page=3D > >>>>>> com.atlassian.jira.plugin.system.issuetabpanels:comment- > >>>>>> tabpanel&focusedCommentId=3D15424288#comment-15424288 ] > >>>>>> > >>>>>> David Leangen commented on FELIX-5325: > >>>>>> -------------------------------------- > >>>>>> > >>>>>> Awesome. Thank you! :-) > >>>>>> > >>>>>>> Patch for embedded DTO (in DTO) > >>>>>>> ------------------------------- > >>>>>>> > >>>>>>> Key: FELIX-5325 > >>>>>>> URL: https://issues.apache.org/jira > >>> /browse/FELIX-5325 > >>>>>>> Project: Felix > >>>>>>> Issue Type: Improvement > >>>>>>> Components: Converter > >>>>>>> Reporter: David Leangen > >>>>>>> Assignee: David Bosschaert > >>>>>>> Priority: Minor > >>>>>>> Attachments: patch.diff > >>>>>>> > >>>>>>> > >>>>>>> This patch adds support for converting a DTO that contains an > >>> embedded > >>>>>> DTO. It uses recursive calls to Converter.convert() to accomplish > >>> this. > >>>>>> > >>>>>> > >>>>>> > >>>>>> -- > >>>>>> This message was sent by Atlassian JIRA > >>>>>> (v6.3.4#6332) > >>>>>> > >>>> > >>>> > >>> > >> > >> > > --001a114aae5eb00f89053a58079f--