Seva's notes

Wisdom, Awareness, Responsibility :)

Archive for December 2007

Dependency Injections in Java 5

leave a comment »

Recently I’ve discovered a new “framework” which simplifies dependency injections in Java 5. It’s called Guice.

Well, what can I say. It indeed has sence. But what I’m wandering of is you need a framework for this thing. In PHP you can solve the problem in exactly x lines. And certainly don’t perform at lectures to explain the concept. 🙂

Written by Seva

2007-12-22 (December 22) at 09:04:33

PDT Resource Containers Include Paths

with one comment

Last week I have been working on extending of Include Path Libraries management in PDT and Zend Studio for Eclipse (Neon). The change won’t be released either in PDT 1.0.2 or in Zend Studio for Eclipse GA, but in the next ones (since it changed almost every aspect of products’ functionality).

The change’s idea is very trivial – until now you had the project’s root as a unchangeable default include path and ability to attach another project roots as additional include paths (variable and library functionality is not changed, except several minor bug fixes). And the point is to make the default visible and removable and to allow addition of specific folders both under same project and other PHP projects. Seems simple, huh? Well, it’s not so much.

The main change is very quick indeed – just replace IProject references with IContainer ones, handle properties serialization etc. and you are there. However when you think a bit about the model (classes, functions, constants) it comes that element beyond the specified folders should be invisible from within the project. Thus it was a need to implement a project’s model filtered wrapper, which efficiently cuts the unneeded elements from the model. Also include path order is relevant from now, which affects debugger execution. That’s about all the changes which affect PDT.

However, when Zend Studio for Eclipse comes to a picture, it becomes even more complicated. First of all, you have File Network in it, which is a graph of all PHP files connected by include/require statements. Second you have Organize Includes, Refactoring Move/Rename of file/folder and at last – include content assist (code completion). All of these should respect the change in configuration and also reflect the configuration change in reasonable time.

This time I won’t go deep into implementation, because it’s less interesting by itself and limit myself with just a brief demo:

Demo Thumbnail

Written by Seva

2007-12-16 (December 16) at 06:37:52