Re: reversing java to c enum style mapping



On Sun, 22 Feb 2009 15:11:36 -0800, Mark Space wrote:


My recollection for the enum approach though was that it only actually
yielded an integer. The DB didn't return a string, just an int. You
had to assume on the client side that you knew what string to use for
what int.

I can see a positive demerit - lack of portability. I use PostgresQL, but
would not use its enums because that would make the application non-
portable to Derby or H2.

Similarly, I do use sequences, which are fairly commonly implemented but
accept that would require a rewrite if my code needed to be ported to
MySQL, which only has auto-incrementing columns.


--
martin@ | Martin Gregorie
gregorie. | Essex, UK
org |
.



Relevant Pages

  • Re: Help with class definition for a beginner
    ... Or declare the enum globally and use like so: ... Funny thing is that I had to change the return type of getSizeto int to ... virtual string getDescription; ...
    (microsoft.public.vc.language)
  • Re: Piped delimited string to int
    ... You can just pipe the enums together and cast the enum to int whenever you ... string and it is int32 hexadecimal format. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Piped delimited string to int
    ... string and it is int32 hexadecimal format. ... enum MyEnum:int ... Clearly the flags are separated by commas rather than "|" in the string ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: reversing java to c enum style mapping
    ... I personally like this approach, because it decouples the name from the semantics, but allows the name to be available for use. ... My recollection for the enum approach though was that it only actually yielded an integer. ... The DB didn't return a string, just an int. ... You had to assume on the client side that you knew what string to use for what int. ...
    (comp.lang.java.programmer)
  • Re: Brian Kernighan, maybe Im not worthy, maybe Im scum
    ... conformant string. ... int repeats, reps; ... ref satisfierLength); ...
    (comp.programming)