Scriptiing The Enterprise With Java And PHP
jontr writes "There are many benefits of using PHP together with Java. In an article about JSR 223, Dejan Bosanac looks at origin of each language and describes future benefits for PHP and Java developers."
What makes PHP great is an impressive set of embedded libraries, easy integration in an already existing plain HTML document and POST, GET, cookie, session management.
Look at this beast: *SQL*, FTP, zip, flash, XML, gettext, image manipulation, LDAP, UNIX process control... all rolled-into-one language. Wow. Perl is, in that respect, with the right CPAN modules, as nice as PHP, but dare I say... easily obfuscated?
PHP had (still has in 5.0?) enormous deficiencies and bugs in its OO model. Works great for quick pages, but as the article says, does not scale well.
So, why insist on keeping PHP for large-scale sites instead of plain java? to use PHP's libraries, HTML integration and web-oriented features, that's it. An artist can draw a page in his favorite application, export to HTML, the coder only has to fill the blanks.
The language in itself has no advantages. If java had all these libraries and "native" web access, why would we consider "merging" these two languages?
Think of it, two interpreted languages joining forces to drain down CPU and memory...
(just my two cents)
I know this article is about combining Java and PHP, but has anyone noticed that JSP has overtaken PHP at least from the standpoint of session cookie default names. It didn't used to be like that. PHP always points out the mod_php numbers, but there is no direct JSP Apache module, only mod_jk which is for any servlet container. I think that's interesting.
A programmer is a machine for converting coffee into code.
What if the public API does not provide the needed functionality - but a private method or a manipulation of a private variable does?
Options:
1) Request change to public API, then wait for the owner of the code to change it.
2) Add a new method to the public API yourself - then try to merge it in if you are not the owner of the code.
3) Access private method or variable (after changing some keywords).
I think a lot depends on the accessibility and responsiveness of the owner of the public API.