Showing posts with label PHP. Show all posts
Showing posts with label PHP. Show all posts

Monday, October 24, 2005

PHP will beat Java? Not sure about it...

I would like react to last week marc andreessen's words (netscape founder during the php/zend conference andreessen basically says that PHP will beat Java and succeeds where Java is not. Most of the reasons that Andreesen used to justify this saying are because of PHP simplicity. Do you think he is talking about the language or the application server -yeah, let's call it this way... (J2EE...)..

Let's talk about J2EE first, it is true that when you take a look to the learning curve of J2EE and PHP it is a no brainer.. PHP is effectively more simple. But we can start with the acronyms themselves: J2EE==Enterprise, where PHP==Personal Home Page ( since then renamed Hypertext Processor). So from the origins the 2 technologies were not here to achieve the same goals. But PHP has proven that it could be used for complex application/Web sites, and still keep it simplicity.

So PHP is simple this is true, but Java on the server could be also. I think that the complexity comes from the fact that J2EE its expert always see an application as a enterprise application, and what that means in term of life cycle, development process, packaging and so on....    Why am I saying that it is coming from the expert? Just take a look to a PHP tutorial and a J2EE one? This is clear that you must be a very good and experienced developer to start with J2EE... But this is is not coming from the technologies, but mainly the way we talk about it. I think we should talk a little more about simple development with Java. For example focusing o JSP and JSTL for simple stuff. I agree that putting too much logic in JSP and reduce the number of layer is 'bad' for complex applications, but it could be used for some. Why do we need to always package a WAR or EAR file? Yes you can technically deploy exploded archive and modify the information after the fact. This is not necessary the best practices but it could be useful for some applications (not necessary only in development environment.

About the language itself, sure that Java is more complex, it is considerate as a System Level Language, where PHP is a scripting language. Do we still compare Shell and C? No we need both of them isn't?

In the same time, Java as a language must be simplified, or let be more precise... I think Java developers need the simplicity of scripting languages such as PHP but with the power of Java under the cover. And this is happening right now. JavaScript is now integrated to Java 6, Groovy provided a well integrated JVM with a very powerful and simple syntax. Grails -Groovy On Rails- provided a simple framework for CRUD applications.

Still skeptical about the simplicity of PHP, try it...
Still skeptical about Java being simple, try a scripting language... for example Groovy

In conclusion the platform of my dream should:

Keep the simple case simple
Made the impossible possible

And I am sure that Java is the good language and platform for that; but Groovy and other scripting languages will help. And I will also continue to develop using PHP too. And both worlds will coexists and be integrated using Web Services and or JSR-223.

Friday, September 2, 2005

Beta Version of Zend Core for Oracle available

Zend Core for Oracle, developed in partnership with Zend Technologies, supports businesses using PHP with Oracle Database for mission-critical Web applications. It provides a seamless out-of-the-box experience delivering a stable, high performance, easy-to-install and supported PHP development and production environment fully integrated with the Oracle Database. Zend Core for Oracle will be available as a free download from Zend in late 2005; it is currently available in Beta. Support and updates for Zend Core for Oracle will be made available directly from Zend. Find more and download link from OTN.

Friday, June 3, 2005

"Scripting: Higher Level Programming for the 21st Century" paper from John K. Ousterhout

With all the Java Scripting language aroun (Groovy, Rhino, Ruby, Jython... and so on) it is always interesting to understand where this come from... but also be able to talk with people about it, especially when they do not understand why scripting is interesting... Googling around looking for some information on scripting benefits for a presentation I found this very intersting article from John Ousterhout, (he wrote the article in 1998) but I am sure you will still appreciate it... Scripting: Higher Level Programming for the 21st Century. One of the most interesting part in this context is the paragraph 4:

A scripting language is not a replacement for a system programming language or vice versa. Each is suited to a different set of tasks. For gluing and system integration, applications can be developed 5-10x faster with a scripting language; system programming languages will require large amounts of boilerplate and conversion code to connect the pieces, whereas this can be done directly with a scripting language. For complex algorithms and data structures, the strong typing of a system programming language makes programs easier to manage. Where execution speed is key, a system programming language can often run 10-20x faster than a scripting language because it makes fewer run-time checks.

Saturday, March 26, 2005

PHP on OC4J??? Yes with JSR 223 RI

In this entry I am explaining how to use the JSR-223 Reference Implementation into Oracle Containers for J2EE (OC4J).

Note: I have done this only on Windows XP Platform, I did not test on Unix/Linux yet.

1-The first thing to do is to download the JSR-223 Reference Implementation from the JCP Web site.

2- Unzip the sjp-1_0-ea-windows-i586.zip in a directory let say d:\java\jsr223-ri.

3- You can choose here to do a proper installation (requires perl) or not. The *proper* installation preconfigure Apache Tomcat and the JSR-223 command line demonstration. Since what we are trying to achieve is to install the RI inside OC4J you do not need to do the installation.

4- Download this zip file that contains a Ant task and various files to configure and deploy the JSR223 sample into OC4J.

   4.1 To execute the Ant script you must start to set the following environman variables:

  • JAVA_HOME that points to the JDK home
  • ORACLE_HOME that points to the OC4J home (eg: d:\oracle\oc4j)
  • JSR223_HOME that points to directory where you have unzipped the JSR223 RI (eg d:\java\jsr223)

   4.2 Create a startup script for OC4J using the command

ant
The default target create a script names start-jsr223.bat in the %ORACLE_HOME%\bin directory. This script set various environment variable and start OC4J with the correct system parameters to load correctly the PHP scrip engine from Java.

   4.3 Start OC4J using the created script

%ORACLE_HOME%\bin\start-jsr223.bat

   4.4 Package and Deploy the Sample Application

ant deploy
This target packacge the Web samples from the reference implementation in a ear/war file, modifying the web.xml to define the different servlet mapping needed by JSR223.

5 Use the sample application

http://localhost:8888/jsr-223

You can start to use PHP in OC4J ;-) Take some time to read the sample code and specifications. JSR-223 is not only for Web container but also for JS2E, it is so interesting that the JSR-223 will probably be part of Mustang...

Thursday, February 24, 2005

Oracle and PHP

A friend of mine was asking me:
can I use PHP with Oracle?
Sure you can!
And a very good source of information about PHP and Oracle is the OTN Web site itself, and especially the OpenSource page. Here a list of my favorites:

Can I run my PHP Applications inside Oracle Application Server?
Sure! Not only you can access the Oracle database from a PHP Application, but also if you are running Oracle Application 10g the usage of mod_php is supported with Oracle HTTP Server see: And what about development?
Development could be done inside Oracle JDeveloper 10g using the The Oracle JDeveloper 10g PHP Extension