Hudzilla.org - the homepage of Paul Hudson
Contents > Wish List | Report Bug | About Me ]

14     Java and COM

This is NOT the latest copy of this book; click here for the latest version.

While there are a large number of extensions available for PHP, a particular few stand out because they are technology extensions as opposed to just library extensions. That is, they allow you to make use of a particular technology from inside PHP, as if you were using it directly.

The most interesting of these extensions are the Java and COM extensions, because they give you a very simple interface into these powerful technologies, allowing you to make use of their functionality without straying too far away from PHP. Java, particularly, is seen as being an interesting match for PHP because they are both cross-platform, and both Internet-based.

Microsoft's Component Object Model (COM) system is available for Windows only, so Unix users will need to get by with just Java. If you are using Windows, and do not mind restricting your scripts to Windows only, then you can have lots of fun exploring how COM and PHP can fit together.

This chapter is devoted to exploring how you can mix in these two popular buzzwords with PHP - not just on a theoretical, "look what I can do" level, but also for practical benefit in your scripts. PHP is a great language, but you should never let that stop you from taking bits and pieces from other technologies wherever it will improve your scripts. Having said that, I like trying things out - even crazy things - for kicks now and then, and I hope that's been reflected here too.

Topics covered in this chapter are:

  • How to use COM

  • Finding out what components you have installed

  • Advanced COM - controlling Internet Explorer, and even writing VBScript

  • Distributed COM: COM over a network

  • Running Java in your scripts

  • Creating interfaces with Swing


Chapter contents

14.1. Getting started with COM
14.1.1. Instantiating an object
14.1.2. Basic COM
14.1.3. Advanced COM
14.1.4. The possibilities of COM
14.1.5. DCOM
14.1.6. Microsoft .NET
14.2. Bringing Java into the mix
14.2.1. Basic Java use
14.2.2. The drawbacks of basic Java use
14.2.3. Your own classes
14.2.4. Using Swing
14.2.5. The future of PHP and Java
14.3. Summary
14.4. Exercises
14.5. Further reading
14.6. Next chapter



<< 13.15 Next chapter   14.1 Getting started with COM >>
Table of Contents
Want to see this stuff in print? PHP in a Nutshell takes the core topics covered here, adds in thousands of edits from the editorial team and myself, and combines them to make an unbeatable reference for PHP programmers at all levels.



My latest book has hundreds more tips on how to use PHP, Apache, and MySQL, plus Perl, Python, shell scripts, performance tuning, and more!



Top-right shadow
 
Bottom-left shadow Bottom shadow

Comments from other readers
A PHP User - 24 Jul 2008

It is a very good book those who are studying PHP newly. And, one more pleasure is that PHP most resembles UNIX and C. That's a cool feature.

Could you please tell is there any PDF version available for this book.

Thanks & Regards,

Ahamed Musthafa A
Programmer - Networking,
Wipro Technologies,
Bangalore,
India.
E-mail: ahamed.musthafa@wipro.com



Add comment
Please note that by posting a comment here you are committing it to the public domain. This is important so that others can make use of your code themselves, and also so that I can incorporate helpful notes directly into the main text. Comments are limited to 2000 characters in length.

If you are reporting an error in the content, please tell me directly.

Your name/email address:
Your comment:
 
Now, in order to verify that you're a real person, please answer this simple question: what is seven plus ten?
The answer is:
(please write in
numbers, eg 19)


Top-right shadow
 
Bottom-left shadow Bottom shadow