Re: SISC in applets
Matthias Radestock <[email protected]>
| Newsgroups | gmane.comp.java.sisc.devel |
|---|---|
| Organization | LShift Ltd |
| Message-ID | <[email protected]> |
Turadg Aleahmad wrote:
> I couldn't get this to work. I put a custom Defaults.class into a
> sisc-override.jar and put that earlier in the class path.
You are right. It looks like constants (i.e. final variables) cannot be
overridden this way. I don't know what the JLS says on the matter, but
it's really odd behaviour.
> BTW, why is
> it an interface instead of an abstract class? I read in Effective Java
> that using interfaces for constants is bad. You can't argue on brevity
> since DEFAULT_PERMIT_INTERRUPTS is just as long as
> Defaults.PERMIT_INTERRUPTS. Ok, one char shorter. :)
I don't think it's a big deal. However, due to the above problem I had
to make Defaults a class anyway (since all vars in interfaces are
final). Fixed in CVS.
> In other news, I added a target that builds sisc-heap.jar. This
> contains sisc/boot/sisc.shp and sisc/boot/HeapAnchor.class.
Can you explain what HeapAnchorClass is for? I've read the comment in
the file but I still do not understand why we need the class.
> This works
> fine for me, but I have another idea that may be better:
> sisc.boot.HeapLoader (or HeapUtil, something like that). It has one
> method getHeap() (or whatever) that returns a SeekableInputStream.
>
> public static SeekableInputStream getHeap() {
> URL heapURL = this.class.getResource("sisc.shp");
> if (heapURL == null) return null;
> return new MemoryRandomAccessInputStream(heapURL.openStream());
> }
>
> The only problem I see with this is creating Java code that depends on
> the JAR that ant builds. But I think it's important for applets to have
> an easy, consistent way to retrieve the heap and I would say that weighs
> more. What do you think?
How an embedded SISC system (applets are just one case of this) locates
and accesses the heap should be up to the programmer. I dislike the idea
of having code in the SISC core that makes as many assumptions as the
code above, e.g.
* that the heap file is called sisc.shp
* that the heap file is available as a resource
* that the heap file lives under sisc/boot
*none* of these assumptions are true when SISC is run from the command line.
Matthias.
-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01