Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #17015
| Path | csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!news-out.readnews.com!transit3.readnews.com!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail |
|---|---|
| From | Lew <lewbloch@gmail.com> |
| Newsgroups | comp.lang.java.programmer |
| Subject | Re: Type of a generic class? |
| Date | Thu, 2 Aug 2012 16:51:46 -0700 (PDT) |
| Organization | http://groups.google.com |
| Lines | 46 |
| Message-ID | <7828b4d7-9c03-484f-8853-7ab541c4395e@googlegroups.com> (permalink) |
| References | <qivqe9-k9.ln1@whirlwind.fredriksson.dy.fi> <jveq7j$2mo$1@dont-email.me> <j0fre9-61u.ln1@whirlwind.fredriksson.dy.fi> |
| NNTP-Posting-Host | 69.28.149.29 |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=ISO-8859-1 |
| X-Trace | posting.google.com 1343951615 32660 127.0.0.1 (2 Aug 2012 23:53:35 GMT) |
| X-Complaints-To | groups-abuse@google.com |
| NNTP-Posting-Date | Thu, 2 Aug 2012 23:53:35 +0000 (UTC) |
| In-Reply-To | <j0fre9-61u.ln1@whirlwind.fredriksson.dy.fi> |
| Complaints-To | groups-abuse@google.com |
| Injection-Info | glegroupsg2000goo.googlegroups.com; posting-host=69.28.149.29; posting-account=CP-lKQoAAAAGtB5diOuGlDQk0jIwmH0T |
| User-Agent | G2/1.0 |
| Xref | csiph.com comp.lang.java.programmer:17015 |
Show key headers only | View raw
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
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Type of a generic class? Donkey Hottie <donkey@fredriksson.dy.fi> - 2012-08-02 22:04 +0300
Re: Type of a generic class? Lew <lewbloch@gmail.com> - 2012-08-02 14:01 -0700
Re: Type of a generic class? markspace <-@.> - 2012-08-02 14:08 -0700
Re: Type of a generic class? Donkey Hottie <donkey@fredriksson.dy.fi> - 2012-08-03 02:27 +0300
Re: Type of a generic class? Lew <lewbloch@gmail.com> - 2012-08-02 16:51 -0700
Re: Type of a generic class? markspace <-@.> - 2012-08-02 20:08 -0700
Re: Type of a generic class? Donkey Hottie <donkey@fredriksson.dy.fi> - 2012-08-03 17:25 +0300
Re: Type of a generic class? Donkey Hottie <donkey@fredriksson.dy.fi> - 2012-08-04 13:46 +0300
csiph-web