Nov 12

Usually I don’t talk about new product announcements in this blog, because there are just too many of them and often they are only of interest to a small group. Yet, I think the recent release of Zend Studio for Eclipse (Beta) will be exciting news for almost every PHP developer. Last year I had evaluated the previous version of Zend Studio, which is certainly excellent. However, I’ve grown attached to the Eclipse IDE, and therefore I did not make the switch and kept using the PHP Eclipse plugin instead. It seems that Eclipse has gained popularity across the board in the PHP world. Zend has recognised the signs of the time and released an Eclipse version of its flagship product earlier this month. This puts Zend Studio into direct competition with PDT and PHP Eclipse.

The Zend IDE has all the usual niceties, such as code assist, syntax colouring, code fold, class hierarchy view, property inspectors, auto format, and powerful search/replace functions without which most PHP developers probably cannot live any more, but there is even more. In addition to PHP code editing, the IDE also provides JavaScript and CSS editors. I have always wished for the sort of code refactoring functionality for PHP that you get with the Eclipse Java editor. The new Zend Studio finally offers this, although perhaps somewhat less extensively than what Java programmers are used to. At least there’s support for renaming and moving, as well as automatic includes. This alone should be a huge time saver, especially for larger projects with dozens or even hundreds of source files.

Further high-end features include support for PHPUnit Testing, PHPDoc generation, as well as debugging and profiling. I cannot stress enough how important these features are, especially when working in a team. The PHPUnit support generates skeleton test classes for all code elements and thus finally takes the pain out of creating meaningful test suites. Well, the programmer is still responsible for making them meaningful, but there isn’t so much typing involved any more. Likewise, with full PhpDoc support there is finally no more excuse for not including the programmer documentation in the sources. Project managers will probably welcome this, just as the felicitous integration of CVS and Subversion which works right out of the project view. Given “var_dump” and logging I have rarely felt the need for a debugger, but since debugging has always been a strength of Zend Studio, one might welcome this as an additional luxury. The profiler, on the other hand, can prove to be vital when checking large chunks of unfamiliar code for weaknesses.

Other noteworthy features are support for code templates and snippets (probably great for lazy typers with a good memory), inclusion of the open-source PHP/Java bridge which allows using Java classes from PHP and vice versa, and a number of wizards that help to get projects and classes getting off the ground faster, including support for WSDL/SOAP. Perhaps even more noteworthy are the integrated SQL GUI editor and HTML WYSIWYG editor. The SQL GUI offers the typical DB server explorer tree, table data viewing and editing in grids, a query editor with syntax highlighting and BLOB views. This is certainly helpful for casual database development, although “serious” DB developers might still prefer the respective DB manufacturer’s tools in combination with an ORM library. The HTML WYSIWYG editor is another really big addition. It looks a bit like an early version of Dreamweaver and it offers code, design and split-window code/design views. I doubt that it can replace a high-end designer tool, but it is certainly more than sufficient for the typical web application, and perhaps it even allows less artistically inclined programmers to add some visual polish to their pages.

In summary, Zend Studio for Eclipse is a high-end development tool with many advanced productivity features. The product is offered at a price of $254 USD and the final release is announced for the end of 2007. Further information, including a number of demo videos, is available at the Zend website.

Share and Enjoy:
  • Digg
  • del.icio.us
  • Technorati
  • Facebook
  • Mixx
  • Google
  • YahooMyWeb
  • Slashdot
  • LinkedIn
  • blogmarks
  • Live
  • description
  • StumbleUpon
  • Ma.gnolia
  • MisterWong
  • NewsVine
  • Reddit
  • Spurl
  • Yigg
  • E-mail this story to a friend!
Sep 8

Eclipse LogoHave you been eclipsed lately? I mean software-wise, of course, using the Eclipse integrated development environment (IDE). Today I came pretty close to feeling eclipsed by the latest Eclipse download dubbed “Europa”. It began with the sheer size of the packages. 125 MB for the Eclipse JEE Europa version, 36 MB for web tools, another couple of megabytes for PHP development tools, visual editor, etc., etc. Not a problem with today’s DSL, you might think, and that is of course true if you live in America or Europe. Unfortunately it’s a different story in Thailand. The Eclipse download page insisted on assigning a local mirror to me. This may be well-intentioned, alas not very effective, because servers located in Thailand tend to be bandwidth-drained, especially if it belongs to a public institution. Regrettably, there was no way to change that. The first connection delivered a whopping 4 kb/s download speed and stalled after 15 minutes. After that I decided to switch to BitTorrent. The BitTorrent software gave me 5 kb/s. That’s still dial-up speed, but at least a small improvement. My computer spent the night downloading Eclipse files.In the morning, all the precious nuggets had arrived on my hard disk. Installation was a breeze compared to the download. Most of the standard components were already included in the Java EE download. I just had to add WTP, PDT, and a few other favourites on top of the Europa distro. In the past, this wasn’t always an easy task. I remember the time when some plugins depended on different, mutually incompatible versions of other plugins. The plugin architecture of the Eclipse framework is sort of asking for this type of problem. Fortunately the days of dependency hell are gone thanks to synchronised update cycles of the Eclipse projects (there are 21 individual modules in the Europa release). In just a few minutes I had my shiny new Eclipse up and running. After starting it with the “-clean” parameter over the old workbench directory I was in business. It even accepted my old configuration settings.

The thing I noticed first is that Europa launched considerably faster than my previous 3.2 version, but -good gracious- the title bar displayed “Program not responding” when I tried to interact with the menu. It seems that Eclipse is now initialising UI components after showing the IDE window and it keeps UI components locked during that time. Eventually after 10 seconds or longer, the program worked normally. I suspect that Eclipse is not loading faster after all; it just displays faster. The second surprise was that Eclipse opened external editor when I double-clicked on a JavaScript file in the navigator. What on earth? I thought I had WTP installed, which supposedly includes a JavaScript editor. Instead of getting to the bottom of that question, I decided to install my favourite JavaScript editor JSEdit, which now belongs to Adobe, but is still distributed freely.

Eclipse IDESince I use Eclipse for Java as well as PHP development, I gave the new PHP Development Tools (PDT) a spin. PDT is now dubbed the premier PHP editor for Eclipse. To be honest, I was mildly disappointed. First of all, the outline view did not work. While syntax colouring and code folding were okay, the PDT editor lacks some of the features that I have grown used to, such as automatic code completion, marking of uninitialised local variables (which is great for typos in variable names), occurrence highlighting, instant compilation, etc. Since all of these are real productivity gainers, I quickly reverted back to my old PHPEclipse plugin, after playing with PDT for a while. Because PDT is work in progress, I will certainly check back in a few months. The major incentive to use PDT instead of PHPEclipse is the integration of PDT with the Zend debugger plugin.

What else is new in Eclipse? The interface now uses a gradient colour scheme which gives the UI a nice new look. Java code editing and refactoring has been improved. Code completion recognises Java types even if the respective imports haven’t been typed out yet. The code assist function is now able to to determine the legal types of exceptions in a catch clause based on the contents of the try block. Unused members and types are now detected, and refactoring can be invoked from the context menu, which makes repetitive tasks, such as renaming identifiers, really easy. Though all of these are small incremental improvements, overall the JDT has become more intelligent as well as faster, which I am sure, every Java developer will appreciate. Of course, there are many more new features, in fact too many to list them here. In summary, Europa is definitely worth the download, even if you should feel a little “eclipsed” by the number and size of its of modules.

Share and Enjoy:
  • Digg
  • del.icio.us
  • Technorati
  • Facebook
  • Mixx
  • Google
  • YahooMyWeb
  • Slashdot
  • LinkedIn
  • blogmarks
  • Live
  • description
  • StumbleUpon
  • Ma.gnolia
  • MisterWong
  • NewsVine
  • Reddit
  • Spurl
  • Yigg
  • E-mail this story to a friend!
Aug 10

Almost exactly 11 years ago I made my first steps into the world of web programming by writing a web-based address book in Perl. The idea then was to teach myself how to create dynamic web pages. It took me about a week to learn Perl and to write this small app. Last week I have repeated the exercise, albeit on a different level. I wanted to teach myself the fundamentals of the Dojo toolkit, Dojo Ajax, and some of the more advanced MySQL features. It was also a welcome break from a longer period of Java work. I used a PHP5 OOP framework for the server side scripting. Mind you, not one of the super-bloated third party frameworks that can do everything from spitting out Pi to the thousandth digit to calculating your mortgage amortisation, but my own small set of classes, which don’t do much more than providing a simplified MVC scheme, DB abstraction, session encapsulation, and authentication. The focus was on Dojo, of course.

Dojo Ajax Application

The good news first. Dojo is very, very powerful. Unless you do really esoteric JavaScript programming, Dojo probably fulfils all scripting needs you will ever have. It offers a great number of widgets from Delphi-like layout containers, windows, tabs, and menus to sophisticated tree controls, sortable tables, and data stores. The out-of-the-box widgets are very easy to create and use. Almost no scripting is required. All you need to do is to add Dojo custom attributes to HTML div tags. It is worth learning Dojo for the widget set alone. Widgets provide an easy way to enhance the GUI of web applications and to create powerful interfaces. But GUI widgets is not all that Dojo has to offer. The second most important thing is probably the Ajax facility, which is likewise a felicitous implementation of a complex functionality. Dojo offers several different transport mechanisms for Ajax requests, including XMLHttpRequest and IFrames. It hides all the underlying complexity from the programmer, such as mechanism differences and browser incompatibilities, and encapsulates Ajax requests into a single function call. Furthermore Dojo offers a JSON-RPC client for use with Ajax, drag-and-drop functionality, form validation, cryptology functions, graphic functions and animation, math functions, xml parsing and more.

Unfortunately there is also bad news. Dojo’s comprehensiveness entails complexity. Granted, this complexity is well hidden from the user. Creating a widget is as easy as adding some Dojo-specific attributes to HTML div tags and including the respective Dojo libraries into a JavaScript section in the head of the HTML file. Things start getting difficult when you interact with widgets and when you customise them. For most non-trivial applications you probably need to do both. What makes this task difficult is chiefly the lack of a proper API documentation. At this time, Dojo only has a partial documentation which means that you either have to look at sample implementations (of which there are only a few), or look at the Dojo source code, or scour the Internet for tips and hints. This can be quite time consuming and frustrating, as the specific information is not always available. It has been said that the Dojo documentation was even more fragmentary before version 0.4. Another problem I came across is that when I started to combine different widgets, such as splitters, containers and layout widgets, the Internet Explorer 6 could not render the page any more. I felt reminded of the bad old days of the browser war when cross-browser compatibility was a software engineer’s pipe dream.

Productivity was likewise not very exalted. I spent 60+ hours on developing a simple address book application (see screenshot), and I am not even counting in the time I spent on learning Dojo. This application has two screens, one for contacts and one for organisations. Each screen consists of an entity list that can be searched in two modes (simple search and advanced), a form with detail data of a single entity, and two linked tables. Almost all data exchange with the server occurs via Ajax calls. Each of the two pages is driven by 475 lines of JavaScript code that handle the dynamics, on top of Dojo. Although it was an instructive experience, and although I am quite impressed with the breadth and power of the Dojo toolkit, I did not find it very practical for real-world application development. Considering that a conventional PHP application could be produced in a third of the time, it would be more economic to use IFrames for producing a similar UI. I reckon that Dojo is still far removed from being a RAD tool for web development. Conceptually it seems to be on the right track, however. If a proper documentation becomes available and if widget integration and interaction is streamlined, it might come out as a winner. IBM and Sun have recently announced their official support for Dojo, so perhaps we should keep an eye on its future development.

Share and Enjoy:
  • Digg
  • del.icio.us
  • Technorati
  • Facebook
  • Mixx
  • Google
  • YahooMyWeb
  • Slashdot
  • LinkedIn
  • blogmarks
  • Live
  • description
  • StumbleUpon
  • Ma.gnolia
  • MisterWong
  • NewsVine
  • Reddit
  • Spurl
  • Yigg
  • E-mail this story to a friend!

« Previous Entries