[ 
https://issues.apache.org/jira/browse/FELIX-5335?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15473093#comment-15473093
 ] 

David Leangen commented on FELIX-5335:
--------------------------------------

Those are all very good arguments. I suppose that it comes down to precision 
vs. convenience, because IIUC either way, the behaviour would have to be 
documented in the API doc.

Since it is only a very minor convenience anyway, and the target audience is 
technical people, I have no problem with choosing precision over convenience. 
:-)

> Addition of copy() method to API
> --------------------------------
>
>                 Key: FELIX-5335
>                 URL: https://issues.apache.org/jira/browse/FELIX-5335
>             Project: Felix
>          Issue Type: New Feature
>          Components: Converter
>            Reporter: David Leangen
>
> Just to keep a record of this somewhere... here is the request I posted to 
> the mail list.
> ----
> bq. Is there a simple way to transform a DTO into an immutable value object?
> To put my question into context: on the bndtools list, I asked this question, 
> and got this response Peter K.:
> bq.Not in enRoute and not in the new spec that was inspired by this service. 
> In general you pass copies so they can do whatever they like with them.
> Fine. But I am not seeing a simple way of creating such copy. Is there a 
> “clone” method of some sort, or do I just convert an object to another object 
> of its own type? Like this:
>  MyDTO copy = cnv.convert( dto ).to( MyDTO.class );
> If making copies is indeed how this service is intended to be used, it would 
> be nice to have a more explicit method for this, maybe:
>  MyDTO copy = cnv.copy( dto );



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to