Implementing JDK profiles (Was: Re: [kaffe] KeyEvent -> JDK 1.4 patch (And longer explanation;))
Dalibor Topic
robilad at yahoo.com
Fri Oct 25 05:33:01 PDT 2002
Hi Jukka,
--- Jukka Santala <jsantala at morphine.tml.hut.fi>
wrote:
> On Mon, 7 Oct 2002, Dalibor Topic wrote:
> > That means we'd have to operate on bytecode level.
> > There are many toolkits for such projects. I
> believe
> > that's preferable to writing a java parser and
> doing a
> > source-to-source translation on all java library
> > source code.
>
> Admittedly the preprocessor approach does have its
> disadvantages. However,
> how do you do conditional specification on bytecode
> level, especially with
> optimization? I guess you could just specify that
> optimization always
> happens after the conditional selection. I still
> remain somewhat
> suspicious; this toolkit would likely need to be
> able to generate
> alternative code etc. and certainly preprocessors
> for source-code are much
> more common/available than bytecode managers.
This is a question of what kind of granularity you
need. If you need to be able to select different
packages, classes, interfaces, fields, and methods as
belonging to a profile, a bytecode level tool to do
that should be feasible with todays bytecode
management tools (jopt, for example).
If, on the other hand, you need to be able to select
different behaviours within methods depending on the
profile (for example: use java 1.0 security mechanisms
if we are running under 1.0 profile, use 1.1 security
mechanisms if we are running under a 1.1 profile, use
1.2 security mechanisms if we are running under a 1.2+
profile), then you have a problem. You could use a
preprocessor, with all the code management problems
that brings, or you could split the code off for
different profiles, with all the code management
problems that brings.
That's the crucial question in my opinion: what kind
of granularity do we need to allow for decribing a
profile? I assume that selecting methods & fields is
enough for most applications. What would you need?
best regards,
dalibor topic
__________________________________________________
Do you Yahoo!?
Y! Web Hosting - Let the expert host your web site
http://webhosting.yahoo.com/
More information about the kaffe
mailing list