Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [qvto-dev] QVT 1.2 RTF Ballot 3 preview 2

Hi

 

If we define

 

Collection::asList() and

Element::clone()

 

isn’t it just the particularity of List that the implementations for both are identical?

 

Doesn’t the same argument hold for other collection types like Sequence? It also supports clone() and asSequence(), which are two operations that I would implement identically by just returning self.

 

Sorry if there is something I really don’t understand.

 

 

Regards

Christopher

 

 

 

Von: qvto-dev-bounces@xxxxxxxxxxx [mailto:qvto-dev-bounces@xxxxxxxxxxx] Im Auftrag von Sergey Boyko
Gesendet: Donnerstag, 6. Februar 2014 21:29
An: QVTOML developer mailing list
Betreff: Re: [qvto-dev] QVT 1.2 RTF Ballot 3 preview 2

 

Hi,

 

I don't think that cross-version compatibility of script is a real issue. Moreover statement 'list->reject(…)->clone()' is more self self-descriptive. Operation 'clone()' is defined for all Collections. 

Intentional duplication (unlike unintentional when duplicates appear as the result of evolution) is doubtful decision.

 

Regards,

  Sergey.

 

On Wed, Feb 5, 2014 at 9:10 PM, Christopher Gerking <christopher.gerking@xxxxxxxxxxxxxxxx> wrote:

Hi

 

> Operation 'List::asList()' duplicates 'List::clone()'. Duplication always has 'bad smell' and should be avoided to not confusing users. Since both operation are

> really the same then the first should be removed.

 

All other concrete collections support asList(). Thus, it seems only consequent to declare Collection::asList() and redefine it for List. This is especially helpful with respect to your latest fix that changes the return type of List::reject(…) from List to Sequence. Hence, the statement list->reject(…)->asList() is a sensible approach to support different versions of Eclipse QVTo. It requires asList() to be available not only on Sequence, but also on List.

 

 

Regards

Christopher

 

 


Back to the top