From: <php...@li...> - 2006-11-14 09:29:12
|
Am Montag, 13. November 2006 19:30 schrieb > > is it possible to instanciate a PHP class from > > within a J2SE standalone > > application? > > Yes, but that's deprecated. If you want to use Java we > recommend to use a J2EE application server or servlet > engine. For example Apache Geronimo or Sun's > "Glassfish". The problem with this solution is that in my opinion J2EE application don't scale well to the lower end. And the PHP application is ment for intranet use in small networks, so the overhead would be too much. > Well, PHP is all about web development. IMHO PHP > cannot be used in desktop applications; it has several > limitations. It doesn't support threads and it doesn't > have a real garbage collector. This means that > long-running php applications will consume huge > amounts of memory. The PHP reference counter cannot > reclaim cycles for example. I share your opinion here, too, maybe I should tell something about the background of my question. The PHP app has a strict object orientated design and a good separation of business logic, data access and presentation layer. We are thinking now about moving away from the web based model to a rich client. To speed things up we were hoping to reuse the PHP based business logic classes (at least for the first version, if the rich client proves its value, we would think about moving to Java completly for the long term). Since this actually would be a Java application which uses some PHP classes but runs inside the Java VM, the drawbacks of PHP you mentioned shouldn't be present in this solution. > I know that there are some (IMHO insane) attempts to > create desktop bindings, GTK bindings for example. But > in practice these bindings don't really work well due > to PHP's limitations. I had a look at those things and I share your opinion: not usable. > > If not, does somebody know any possibility for this? > > An old version (2.0.8) contained some MONO/NET GTK > examples. I'll have a look at this. Thanks for your answer, Verena |