flex-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mihai Chira (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (FLEX-34880) Place Sort and SortField state setters behind mx_internal
Date Sun, 06 Nov 2016 14:55:58 GMT

     [ https://issues.apache.org/jira/browse/FLEX-34880?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Mihai Chira updated FLEX-34880:
-------------------------------
    Description: 
h1. The change
(Both mx and spark) {{Sort}} and {{SortField}} will be transitioned to immutable objects to
prevent bugs like FLEX-34853. In this step we are:
# _removing the state setters from the interfaces_ ({{ISort}} and {{ISortField}}).
# _hiding the state setters behind the {{mx_internal}} namespace_. This also implies renaming
them (because a getter and a setter with different namespaces throw a compile error). The
pattern is: {{public function set compareFunction(c:Function):void}} becomes {{mx_internal
function set compareFunction_(c:Function):void}}.

h1. Usage
h3. Before
{code}
var sortField:ISortField = new SortField();
sortField.compareFunction = someCompareFunction;
{code}

h3. After. Version 1 (preferred)
{code}
var sortField:ISortField = new SortField(someCompareFunction);
{code}

h3. After. Version 2
{code}
var sortField:ISortField = new SortField();
SortField(sortField).mx_internal::compareFunction_ = someCompareFunction;
{code}

  was:
h1. The change
(Both mx and spark) {{Sort}} and {{SortField}} will be transitioned to immutable objects to
prevent bugs like FLEX-34853. In this step we are:
# _removing the state setters from the interfaces_ ({{ISort}} and {{ISortField}}).
# _hiding the state setters behind the {{mx_internal}} namespace_. This also implies renaming
them (because a getter and a setter with different namespaces throw a compile error). The
pattern is: {{public function set compareFunction(c:Function):void}} becomes {{mx_internal
function set compareFunction_(c:Function):void}}.

h1. Usage
h3. Before
{code}
var sortField:SortField = new SortField(groupingField.name, 
                        groupingField.caseInsensitive, 
                        groupingField.descending, groupingField.numeric);
sortField.compareFunction = groupingField.compareFunction;
{code}

h3. After
{code}
var sortField:SortField = new SortField(groupingField.name, 
                        groupingField.caseInsensitive, 
                        groupingField.descending, groupingField.numeric);
sortField.mx_internal::compareFunction_ = groupingField.compareFunction;
{code}


> Place Sort and SortField state setters behind mx_internal
> ---------------------------------------------------------
>
>                 Key: FLEX-34880
>                 URL: https://issues.apache.org/jira/browse/FLEX-34880
>             Project: Apache Flex
>          Issue Type: Sub-task
>          Components: Spark: Sort and SortField
>    Affects Versions: Apache Flex 4.15.0
>            Reporter: Mihai Chira
>            Assignee: Mihai Chira
>             Fix For: Apache Flex 4.16.0
>
>
> h1. The change
> (Both mx and spark) {{Sort}} and {{SortField}} will be transitioned to immutable objects
to prevent bugs like FLEX-34853. In this step we are:
> # _removing the state setters from the interfaces_ ({{ISort}} and {{ISortField}}).
> # _hiding the state setters behind the {{mx_internal}} namespace_. This also implies
renaming them (because a getter and a setter with different namespaces throw a compile error).
The pattern is: {{public function set compareFunction(c:Function):void}} becomes {{mx_internal
function set compareFunction_(c:Function):void}}.
> h1. Usage
> h3. Before
> {code}
> var sortField:ISortField = new SortField();
> sortField.compareFunction = someCompareFunction;
> {code}
> h3. After. Version 1 (preferred)
> {code}
> var sortField:ISortField = new SortField(someCompareFunction);
> {code}
> h3. After. Version 2
> {code}
> var sortField:ISortField = new SortField();
> SortField(sortField).mx_internal::compareFunction_ = someCompareFunction;
> {code}



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

Mime
View raw message