[Kde-java] Qt and KDE java package names

Felix Rodriguez frodriguez at wesleyan.edu
Fri Aug 8 11:00:11 CEST 2003


Richard,

  Changing the packages names sounds OK. The only problem is I have a lot of 
code written with the old imports. Would it be possible to have the old 
package names available for backward compatibility?

On Friday 08 August 2003 08:03 am, Richard Dale wrote:
> Currently all Qt classes are in package 'org.kde.qt.*' and all KDE classes
> are in 'org.kde.koala.*'. I chose these names because I thought it was the
> 'correct thing' to do in Java (ie all lower case, 'DNS in reverse' style).
> I assume it was important to have names like this when applets were all the
> range, and we were going download them from all over the net.
>
> In PerlQt and QtRuby, there is a Qt:: namespace with names like Qt::Widget
> with no Q. I assume that there would be a KDE:: namespace for KDE. So why
> should java be different? What advantage do these long names have? How
> about this instead for java:
>
>  'import Qt.*;
> ...
>
> Widget myWidget = new Qt.Widget();
>
> The disadvantage of the current long package names is that you really need
> to fully qualify classnames in slots/signal connect statements. There is
> some really hacky code in QtJava to 'deduce' the package name from whether
> or not it begins with a 'Q', so you don't have to do that. Who wants to
> write:
>
> connect(myapp, "SLOT(org.kde.qt.QWidget, org.kde.koala.KPart)", ...
>
> That is fine when all the KDE classes are in one package, but an important
> enhancement will be to split them up into packages which map onto the C++
> namespace - 'kparts', 'kio' and so on. And as soon as the KDE classes are
> in more than one package, the above solution doesn't work.
>
> Here is an interesting thread which discusses the problems with the java
> packing structure (in terms of ruby, but still relevant to java):
>
> http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/27584
>
> -- Richard
> _______________________________________________
> Kde-java mailing list
> Kde-java at mail.kde.org
> http://mail.kde.org/mailman/listinfo/kde-java



More information about the Kde-java mailing list