You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Doug Cutting (JIRA)" <ji...@apache.org> on 2009/09/01 20:34:33 UTC

[jira] Created: (AVRO-110) make GenericData, & ReflectData implement singleton pattern

make GenericData, & ReflectData implement singleton pattern
-----------------------------------------------------------

                 Key: AVRO-110
                 URL: https://issues.apache.org/jira/browse/AVRO-110
             Project: Avro
          Issue Type: Improvement
          Components: java
            Reporter: Doug Cutting
            Assignee: Doug Cutting


Currently GenericData has only static methods.  ReflectData used to follow that pattern, but in AVRO-104 was converted into a normally instantiable class, with a public constructor.

Better for both would be the singleton pattern.  A static get() method would return the single, statically-allocated instance.  Instances could thus implement long-lived caches (a feature of ReflectData that was lost in AVRO-104, adversely affecting performance).  A protected constructor would be provided so that singleton subclasses can be implemented that override methods.


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (AVRO-110) make GenericData, & ReflectData implement singleton pattern

Posted by "Doug Cutting (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AVRO-110?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Doug Cutting resolved AVRO-110.
-------------------------------

       Resolution: Fixed
    Fix Version/s: 1.1.0

I just committed this.

> make GenericData, & ReflectData implement singleton pattern
> -----------------------------------------------------------
>
>                 Key: AVRO-110
>                 URL: https://issues.apache.org/jira/browse/AVRO-110
>             Project: Avro
>          Issue Type: Improvement
>          Components: java
>            Reporter: Doug Cutting
>            Assignee: Doug Cutting
>             Fix For: 1.1.0
>
>         Attachments: AVRO-104.patch
>
>
> Currently GenericData has only static methods.  ReflectData used to follow that pattern, but in AVRO-104 was converted into a normally instantiable class, with a public constructor.
> Better for both would be the singleton pattern.  A static get() method would return the single, statically-allocated instance.  Instances could thus implement long-lived caches (a feature of ReflectData that was lost in AVRO-104, adversely affecting performance).  A protected constructor would be provided so that singleton subclasses can be implemented that override methods.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (AVRO-110) make GenericData, & ReflectData implement singleton pattern

Posted by "Doug Cutting (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AVRO-110?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Doug Cutting updated AVRO-110:
------------------------------

    Attachment: AVRO-104.patch

Here's a patch that implements this.

> make GenericData, & ReflectData implement singleton pattern
> -----------------------------------------------------------
>
>                 Key: AVRO-110
>                 URL: https://issues.apache.org/jira/browse/AVRO-110
>             Project: Avro
>          Issue Type: Improvement
>          Components: java
>            Reporter: Doug Cutting
>            Assignee: Doug Cutting
>         Attachments: AVRO-104.patch
>
>
> Currently GenericData has only static methods.  ReflectData used to follow that pattern, but in AVRO-104 was converted into a normally instantiable class, with a public constructor.
> Better for both would be the singleton pattern.  A static get() method would return the single, statically-allocated instance.  Instances could thus implement long-lived caches (a feature of ReflectData that was lost in AVRO-104, adversely affecting performance).  A protected constructor would be provided so that singleton subclasses can be implemented that override methods.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.