|
From: <php...@li...> - 2009-07-03 08:45:09
|
Thank you. Now I see how it has to be done. Although it's not as fluffy as I would have wished but I guess it will work. :-) Cheers, Alexander Thomas Am 02.07.2009 um 14:54 schrieb php...@li... : > You could use the visitor- or the decorator design pattern to > intercept the > method calls from your Java class. > > It all depends on your requirements. If your java class is a data > structure > with a few methods, I would use a visitor. To override specific > methods from > the superclass I would use a decorator. > > Please see a standard text book or wikipedia.org for details. > > As far as the bridge is concerned, all you need is java_closure() to > convert > your PHP object into a Java object. After that you can apply whatever > pattern you prefer to merge the two java instances. > > Regards, > Jost Boekemeier > > 2. Jul 2009 12:52 nachm. schrieb am < > php...@li...>: > > Hi everybody, > > first of all thanks for this great piece of software that makes it > easy to use powerful Java libs in a PHP based application. That's > really awesome. > > Currently I'm working on a PDF generation using iText and I'm > surprised that it's quite easy to find my way around. But of course I > wouldn't post this if there wasn't this one thing that is not working > for me: writing a PHP class that derives from a Java class. > > Before you guys scream "RTFM!", I really tried to find this out myself > but all I could find was the FAQ file in the documentation. This > points to java_closure() and to an example in the file script_api.php > in the tests folder. > > Reading the documentation of java_closure() and the example only the > implementation of java interfaces in a PHP class is described (which > will definitely be useful for me later - I'm sure). > > So my question: can someone please explain how a PHP class can extend > a Java class? > > Any hint would be appreciated. > > Thank you very much. > > Regards, > Alexander Thomas > > ------------------------------------------------------------------------------ > _______________________________________________ > php-java-bridge-users mailing list > php...@li... > https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users > ------------------------------------------------------------------------------ > _______________________________________________ > php-java-bridge-users mailing list > php...@li... > https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users |