Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!news-in-01.newsfeed.easynews.com!easynews.com!easynews!news-out.news.tds.net!newsreading01.news.tds.net!53ab2750!not-for-mail From: "Lew" Subject: Re: Type of a generic class? Message-ID: <501C1566.56032.calajapr@time.synchro.net> X-Comment-To: Donkey Hottie Newsgroups: comp.lang.java.programmer In-Reply-To: <501C1565.56029.calajapr@time.synchro.net> References: <501C1565.56029.calajapr@time.synchro.net> X-FTN-AREA: COMP.LANG.JAVA.PROGRAMMER X-FTN-MSGID: 1:261/38 408916e5 X-FTN-REPLY: 1:261/38 cd329b9a Content-Type: text/plain; charset=IBM437 Content-Transfer-Encoding: 8bit X-Gateway: time.synchro.net [Synchronet 3.16a-Win32 NewsLink 1.98] Lines: 54 Date: Fri, 03 Aug 2012 18:54:17 GMT NNTP-Posting-Host: 69.21.70.65 X-Complaints-To: news@tds.net X-Trace: newsreading01.news.tds.net 1344020057 69.21.70.65 (Fri, 03 Aug 2012 13:54:17 CDT) NNTP-Posting-Date: Fri, 03 Aug 2012 13:54:17 CDT Organization: tds.net X-Received-Bytes: 2382 Xref: csiph.com comp.lang.java.programmer:17073 To: Donkey Hottie From: Lew Donkey Hottie wrote: > markspace kirjoitti: >> ... > I am trying to convert a simple { String name, String value } pair in How about a Map> Also, you should move that if-chain reflection out of your app and use polymorphism instead. > database to a Global(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