Hi, Klaus Bernhard contributed the ThinComponent package to Thinlet - a tiny XUL motor in Java.
Klaus writes: I came across Thinlet a few month ago and found it very appealing. * Its XML format * Its size. Not the usual multi-MB dinosaur (Apache et.al.) * Its nice appearance I also found some critical postings in the Java community complaining about the lack of object-orientation, which causes a limited acceptance with hardcore Java developers. In my opinion, this is partially true. Especially, due to Thinlet's API, users are forced to use untyped Object.s in their own code, with is a fallback into (good?) old times, and disables the compiler from reporting most of the programming errors. So I spent some time to find a way to transform the public interface, but still keep the old functionality intact. This proved to be possible. The new user interface adds * a new class ThinComponent, having public methods that correspond to Thinlet's "method (component, ...)", which can now be expressed as "component.method(...)" * ThinComponent wrapps Thinlet's component representation (the Object[]). It has static methods to switch between old and new representation. * all methods (also the existing methods) issue ThinComponent objects when a component is returned, and accept ThinComponent parameters where a component is exspected. * the logic of Thinlet's public methods is moved into the ThinComponent class I have now completed this work, and Calculator and Demo demos still work without any change (due to the upward-compatibility efforts). The solution is not a total wrapper, I updated Thinlet.java (version Oct.2003) and added a new class named ThinComponent. Changes to Thinlet, however, are of rather formal character, not touching the (often complicated) logic itself, except when I run into null pointer exceptions (2 or 3 times), and except for createImpl(name) and getMethod(...). I have tested it with Calculator, Demo, and Drafts in unchanged form, and Calculator and Demo with Object parameters replaced by ThinComponent ones and metho(component,..) calls replaced by component.method(..) calls. Everything seems ok. I intend to upload Thinlet.java, ThinComponent.java, Demo.java Please note that package statements are commented for easy living. Good luck! If you got curious, you can grab the ThinComponent package online @ https://thinlet.dev.java.net/servlets/ProjectDocumentList?folderID=459 You can find more info about Thinlet online @ http://www.thinlet.com - Gerald ------------------------------------------------------- This SF.net email is sponsored by: SF.net Giveback Program. Does SourceForge.net help you be more productive? Does it help you create better code? SHARE THE LOVE, and help us help YOU! Click Here: http://sourceforge.net/donate/ _______________________________________________ xul-announce mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/xul-announce