Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #17073

Re: Type of a generic class?

From "Lew" <lew@1:261/38.remove-yy0-this>
Subject Re: Type of a generic class?
Message-ID <501C1566.56032.calajapr@time.synchro.net> (permalink)
Newsgroups comp.lang.java.programmer
References <501C1565.56029.calajapr@time.synchro.net>
Date 2012-08-03 18:54 +0000
Organization tds.net

Show all headers | View raw


  To: Donkey Hottie
From: Lew <lewbloch@gmail.com>

Donkey Hottie wrote:
> markspace kirjoitti:
>> ...

> I am trying to convert a simple { String name, String value } pair in

How about a Map<String, Global<?>>

Also, you should move that if-chain reflection out of your app and use 
polymorphism instead.

> database to a Global<T>(name) so that it will convert the Java simple
> datatypes to a string and back. This is for system parameters,
> configuration parameters.
>
>> It is indeed kind of spooky and strange idea, after all what is so wrong
>> about simple
>     String value = SystemProperties.getString("ParamName") ;
>
> It is OK, but I'm kind of toying with idea of strong typing of System
> Parameters: A Date can not be stored as Long or Double etc..

Using strings to look up types is not strong typing.

>
> The back end of the system parameters is simply
>
>
>
> CREATE TABLE SystemParameters
> (
>     name varchar(64) not null primary_key,
>     value varchar(512)
> ) ;
>
>
> That's it. That is have the table is given to me. But I want to make the
> Java code bit more pedantic on the types of the parameters it uses and
> maintains.

JPA does that for you, too.

Anyway, your use of reflection is anti-pedantic.

--
Lew

--- BBBS/Li6 v4.10 Dada-1
 * Origin: Prism bbs (1:261/38)
--- Synchronet 3.16a-Win32 NewsLink 1.98
Time Warp of the Future BBS - telnet://time.synchro.net:24

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Type of a generic class? "Donkey Hottie" <donkey.hottie@1:261/38.remove-yy0-this> - 2012-08-03 18:54 +0000
  Re: Type of a generic class? "Lew" <lew@1:261/38.remove-yy0-this> - 2012-08-03 18:54 +0000
  Re: Type of a generic class? "markspace" <markspace@1:261/38.remove-yy0-this> - 2012-08-03 18:54 +0000
    Re: Type of a generic class? "Donkey Hottie" <donkey.hottie@1:261/38.remove-yy0-this> - 2012-08-03 18:54 +0000
      Re: Type of a generic class? "Lew" <lew@1:261/38.remove-yy0-this> - 2012-08-03 18:54 +0000
      Re: Type of a generic class? "markspace" <markspace@1:261/38.remove-yy0-this> - 2012-08-03 18:54 +0000
        Re: Type of a generic class? "Donkey Hottie" <donkey.hottie@1:261/38.remove-yy0-this> - 2012-08-03 18:54 +0000
  Re: Type of a generic class? "Donkey Hottie" <donkey.hottie@1:261/38.remove-5qr-this> - 2012-08-04 18:41 +0000

csiph-web