You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sis.apache.org by Martin Desruisseaux <ma...@geomatys.fr> on 2014/11/19 18:58:47 UTC

Common interface for Enum and CodeList?

Hello all

As a side effect of ISO 19115:2014 upgrade, we have an increasing need
for a common interface between CodeList and the Enum defined by GeoAPI.
(Reminder: a CodeList is basically an Enum which allow new elements to
be added at runtime). I have trouble finding a good interface name which
can be applied to both "true enum" and "extensible enum" (i.e. "code
list"). We can not use "Enum", "Enumeration" or "CodeList" since they
are already used. I found "Enumerated" used in some other API (e.g.
javax.persistence.Enumerated) so I took that name for now:

http://www.geoapi.org/snapshot/javadoc/org/opengis/util/Enumerated.html

However I don't think it is a good name for us, since "enumeration"
suggest a closed universe (we enumerated all possible elements), while
"code list" is an open universe.

I though about "Universe", but this is probably too big. Some other
words are "catalog", "inventory", "register", "dictionary", "listing",
and more. Does someone has an idea for a better interface name?

    Martin


Re: [Geoapi-devel] Common interface for Enum and CodeList?

Posted by Jody Garnett <jo...@gmail.com>.
Yep that would be fine, my preference is always shorter when we can :)

--
Jody Garnett

On 13 March 2015 at 13:04, Martin Desruisseaux <
martin.desruisseaux@geomatys.fr> wrote:

> Hello Jody and all
>
> I had an opportunity to discuss briefly about this naming issue during
> the OGC meeting. "Vocabulary" seems a good start. But I also got the
> "ControlledVocabulary" and "SharedVocabulary" suggestions.
> "ControlledVocabulary" has a definition on wikipedia that seems close to
> what we mean:
>
> http://en.wikipedia.org/wiki/Controlled_vocabulary
>
> Does it sound a good name for a type common to both Enumeration and
> CodeList?
>
>     Martin
>
>
>
> Le 26/02/15 23:06, Martin Desruisseaux a écrit :
> > Hello Jody
> >
> > Thanks for the feedback. Yours proposal sound great. I also like
> > "Vocabulary", I think it is better than the current "Enumerated". There
> > is an OGC meeting in 2 weeks, hopefully I could also get some advices
> there.
> >
> >     Martin
> >
> >
> >
> > Le 26/02/15 22:48, Jody Garnett a écrit :
> >> Tricky question, I liked code-list :(
> >> - Domain, Formal, Definition ...
> >> - Vocabulary Vocab etc..
> >>
> >> I think I prefer Vocab out.
> >>
> >> class Foo extends CodeList implements Vocabulary {
> >>    ...
> >> }
> >>
> >> enum Bar implements Vocabulary {
> >>    A, B, D;
> >> }
> >>
> >> --
> >> Jody Garnett
>
>

Re: [Geoapi-devel] Common interface for Enum and CodeList?

Posted by Martin Desruisseaux <ma...@geomatys.fr>.
Hello Jody and all

I had an opportunity to discuss briefly about this naming issue during
the OGC meeting. "Vocabulary" seems a good start. But I also got the
"ControlledVocabulary" and "SharedVocabulary" suggestions.
"ControlledVocabulary" has a definition on wikipedia that seems close to
what we mean:

http://en.wikipedia.org/wiki/Controlled_vocabulary

Does it sound a good name for a type common to both Enumeration and
CodeList?

    Martin



Le 26/02/15 23:06, Martin Desruisseaux a écrit :
> Hello Jody
>
> Thanks for the feedback. Yours proposal sound great. I also like
> "Vocabulary", I think it is better than the current "Enumerated". There
> is an OGC meeting in 2 weeks, hopefully I could also get some advices there.
>
>     Martin
>
>
>
> Le 26/02/15 22:48, Jody Garnett a écrit :
>> Tricky question, I liked code-list :(
>> - Domain, Formal, Definition ...
>> - Vocabulary Vocab etc.. 
>>
>> I think I prefer Vocab out.
>>
>> class Foo extends CodeList implements Vocabulary {
>>    ...
>> }
>>
>> enum Bar implements Vocabulary {
>>    A, B, D;
>> }
>>
>> --
>> Jody Garnett


Re: [Geoapi-devel] Common interface for Enum and CodeList?

Posted by Martin Desruisseaux <ma...@geomatys.fr>.
Hello Jody

Thanks for the feedback. Yours proposal sound great. I also like
"Vocabulary", I think it is better than the current "Enumerated". There
is an OGC meeting in 2 weeks, hopefully I could also get some advices there.

    Martin



Le 26/02/15 22:48, Jody Garnett a écrit :
> Tricky question, I liked code-list :(
> - Domain, Formal, Definition ...
> - Vocabulary Vocab etc.. 
>
> I think I prefer Vocab out.
>
> class Foo extends CodeList implements Vocabulary {
>    ...
> }
>
> enum Bar implements Vocabulary {
>    A, B, D;
> }
>
> --
> Jody Garnett
>
> On 19 November 2014 at 12:58, Martin Desruisseaux
> <martin.desruisseaux@geomatys.fr
> <ma...@geomatys.fr>> wrote:
>
>     Hello all
>
>     As a side effect of ISO 19115:2014 upgrade, we have an increasing need
>     for a common interface between CodeList and the Enum defined by
>     GeoAPI.
>     (Reminder: a CodeList is basically an Enum which allow new elements to
>     be added at runtime). I have trouble finding a good interface name
>     which
>     can be applied to both "true enum" and "extensible enum" (i.e. "code
>     list"). We can not use "Enum", "Enumeration" or "CodeList" since they
>     are already used. I found "Enumerated" used in some other API (e.g.
>     javax.persistence.Enumerated) so I took that name for now:
>
>     http://www.geoapi.org/snapshot/javadoc/org/opengis/util/Enumerated.html
>
>     However I don't think it is a good name for us, since "enumeration"
>     suggest a closed universe (we enumerated all possible elements), while
>     "code list" is an open universe.
>
>     I though about "Universe", but this is probably too big. Some other
>     words are "catalog", "inventory", "register", "dictionary", "listing",
>     and more. Does someone has an idea for a better interface name?
>
>         Martin
>
>
>     ------------------------------------------------------------------------------
>     Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
>     from Actuate! Instantly Supercharge Your Business Reports and
>     Dashboards
>     with Interactivity, Sharing, Native Excel Exports, App Integration
>     & more
>     Get technology previously reserved for billion-dollar
>     corporations, FREE
>     http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk
>     _______________________________________________
>     Geoapi-devel mailing list
>     Geoapi-devel@lists.sourceforge.net
>     <ma...@lists.sourceforge.net>
>     https://lists.sourceforge.net/lists/listinfo/geoapi-devel
>
>


Re: [Geoapi-devel] Common interface for Enum and CodeList?

Posted by Jody Garnett <jo...@gmail.com>.
Tricky question, I liked code-list :(
- Domain, Formal, Definition ...
- Vocabulary Vocab etc..

I think I prefer Vocab out.

class Foo extends CodeList implements Vocabulary {
   ...
}

enum Bar implements Vocabulary {
   A, B, D;
}

--
Jody Garnett

On 19 November 2014 at 12:58, Martin Desruisseaux <
martin.desruisseaux@geomatys.fr> wrote:

> Hello all
>
> As a side effect of ISO 19115:2014 upgrade, we have an increasing need
> for a common interface between CodeList and the Enum defined by GeoAPI.
> (Reminder: a CodeList is basically an Enum which allow new elements to
> be added at runtime). I have trouble finding a good interface name which
> can be applied to both "true enum" and "extensible enum" (i.e. "code
> list"). We can not use "Enum", "Enumeration" or "CodeList" since they
> are already used. I found "Enumerated" used in some other API (e.g.
> javax.persistence.Enumerated) so I took that name for now:
>
> http://www.geoapi.org/snapshot/javadoc/org/opengis/util/Enumerated.html
>
> However I don't think it is a good name for us, since "enumeration"
> suggest a closed universe (we enumerated all possible elements), while
> "code list" is an open universe.
>
> I though about "Universe", but this is probably too big. Some other
> words are "catalog", "inventory", "register", "dictionary", "listing",
> and more. Does someone has an idea for a better interface name?
>
>     Martin
>
>
>
> ------------------------------------------------------------------------------
> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
> from Actuate! Instantly Supercharge Your Business Reports and Dashboards
> with Interactivity, Sharing, Native Excel Exports, App Integration & more
> Get technology previously reserved for billion-dollar corporations, FREE
>
> http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk
> _______________________________________________
> Geoapi-devel mailing list
> Geoapi-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geoapi-devel
>

Re: Common interface for Enum and CodeList?

Posted by Martin Desruisseaux <ma...@geomatys.fr>.
Hello Adam

Thanks for the feedback. A CodeListFactory could be an option
(especially for new items defined by authorities other than OGC/ISO).
But the current issue is more about using Enum/CodeList than creating
them. They share many common methods: name(), ordinal(), etc. If we
could insert a common parent class, what would be the name of that
class? Enumerated, Inventory, Dictionary, Listing, Catalog, Universe (of
discussion), I don't know...

Martin



Le 20/11/14 23:38, Adam Estrada a écrit :
> Martin,
>
> Why not make a CodeListFactory?
>
> Adam
>
> On Wed, Nov 19, 2014 at 12:58 PM, Martin Desruisseaux
> <ma...@geomatys.fr> wrote:
>> Hello all
>>
>> As a side effect of ISO 19115:2014 upgrade, we have an increasing need
>> for a common interface between CodeList and the Enum defined by GeoAPI.
>> (Reminder: a CodeList is basically an Enum which allow new elements to
>> be added at runtime). I have trouble finding a good interface name which
>> can be applied to both "true enum" and "extensible enum" (i.e. "code
>> list"). We can not use "Enum", "Enumeration" or "CodeList" since they
>> are already used. I found "Enumerated" used in some other API (e.g.
>> javax.persistence.Enumerated) so I took that name for now:
>>
>> http://www.geoapi.org/snapshot/javadoc/org/opengis/util/Enumerated.html
>>
>> However I don't think it is a good name for us, since "enumeration"
>> suggest a closed universe (we enumerated all possible elements), while
>> "code list" is an open universe.
>>
>> I though about "Universe", but this is probably too big. Some other
>> words are "catalog", "inventory", "register", "dictionary", "listing",
>> and more. Does someone has an idea for a better interface name?
>>
>>     Martin
>>


Re: Common interface for Enum and CodeList?

Posted by Adam Estrada <es...@gmail.com>.
Martin,

Why not make a CodeListFactory?

Adam

On Wed, Nov 19, 2014 at 12:58 PM, Martin Desruisseaux
<ma...@geomatys.fr> wrote:
> Hello all
>
> As a side effect of ISO 19115:2014 upgrade, we have an increasing need
> for a common interface between CodeList and the Enum defined by GeoAPI.
> (Reminder: a CodeList is basically an Enum which allow new elements to
> be added at runtime). I have trouble finding a good interface name which
> can be applied to both "true enum" and "extensible enum" (i.e. "code
> list"). We can not use "Enum", "Enumeration" or "CodeList" since they
> are already used. I found "Enumerated" used in some other API (e.g.
> javax.persistence.Enumerated) so I took that name for now:
>
> http://www.geoapi.org/snapshot/javadoc/org/opengis/util/Enumerated.html
>
> However I don't think it is a good name for us, since "enumeration"
> suggest a closed universe (we enumerated all possible elements), while
> "code list" is an open universe.
>
> I though about "Universe", but this is probably too big. Some other
> words are "catalog", "inventory", "register", "dictionary", "listing",
> and more. Does someone has an idea for a better interface name?
>
>     Martin
>