[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [equinox-dev] Coding standards: using import abc.* - or not?


One thing to note here is that this coding standard applies to all of Equinox and that scope is quite a bit wider now that it has transitioned.

Another thing to consider is that the conventions we use may well be emulated by others.  Our conventions should be consistent and relevant to promote good component programming practices.

Jeff



Pascal Rapicault/Ottawa/IBM@IBMCA
Sent by: equinox-dev-bounces@xxxxxxxxxxx

11/11/2005 01:23 PM

Please respond to
Equinox development mailing list

To
Equinox development mailing list <equinox-dev@xxxxxxxxxxx>
cc
Subject
Re: [equinox-dev] Coding standards: using import abc.* - or not?






Clearly the only solution is to fully qualify ALL the classes in the import statement.

I think this is a reasonable thing to do in a component that has a lot of dependencies, however I believe the equinox space is small enough that we can keep things the way they are (note that I have never seen this problem since I started working in this team).


-1




Oleg Besedin/Ottawa/IBM@IBMCA
Sent by: equinox-dev-bounces@xxxxxxxxxxx

11/11/2005 11:20 AM

Please respond to
Equinox development mailing list

To
equinox-dev@xxxxxxxxxxx
cc
Subject
[equinox-dev] Coding standards: using import abc.* - or not?








Hi Everybody,

The Equinox coding standard says that imports should be coalesced ("import abc.*") if 3 or more classes are imported from the same package (http://www.eclipse.org/equinox/documents/coding.php).

However, this brings a rather real problem that we just had a chance to observe.

In this case a plugin was using:

      import abc.*;

      import myPackage.Assert;

Which was fine - until the Assert class was added into the other plugin's package abc.

Clearly, "import abc.*" introduces ambiguity. On the other hand, Eclipse's "Organize Imports" command lets developers easily manage individual imports. And, last but not least, in my opinion, seeing all individual imports helps understand where imported classes actually come from and adds to that nice warm feeling of being in control.

With all this in mind, should we change the Equinox coding standard to don't coalesce the imports?


Sincerely,

Oleg Besedin
_______________________________________________
equinox-dev mailing list
equinox-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/equinox-dev

_______________________________________________
equinox-dev mailing list
equinox-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/equinox-dev