|
From: Martin D. <mar...@te...> - 2003-01-28 13:28:11
|
Cameron Shorter wrote:
> I'm thinking about using the following names:
>
> * interface MapPane (extends Widget)
> * class JMapPane (which extends JPanel implements MapPane) I'm using "J" in
> keeping with swing naming conventions.
>
> * interface Tool
> * interface PanTool (extends Tool)
>
> * class ToolImpl (implements Tool)
> * class PanToolImpl (extends ToolImpl, implements PanTool)
>
> Any comments before I set things in stone?
>
Do we have alternative proposal for ToolImpl and PanToolImpl? I usually
prefer to avoid "Impl" suffix...
An other though: Do we plan to harmonize interfaces with the OpenGIS's
naming convention? All OpenGIS's implementation specification I'm aware
of (namely CTS and GCS) use the following naming convention:
org.opengis.[two letter package name].[package again]_Interface
For example:
org.opengis.cs.CS_CoordinateSystem
org.opengis.gc.GC_GridCoverage
etc. Of course, we can't use the "org.opengis" domain name. But if we
plan to use more OpenGIS interfaces in the future, or if we may turn
some of our interfaces into an OpenGIS proposal later, then more OpenGIS
compliant interfaces names for Geotools may be:
org.geotools.ui.UI_MapPane (org.opengis.... in the future?)
org.geotools.ui.UI_Tool (org.opengis.... in the future?)
org.geotools.ui.UI_PanTool (org.opengis.... in the future?)
I agree that the "UI_" suffix is uggly, but this is the way OpenGIS do.
They want the same interface names in Java than structure names in C (or
any other language) and not all language separate package as clearly
than Java.
If interface are going to be (in the future) org.opengis.ui.UI_MapPane,
then we are free to use the plain MapPane name for Java implementation
(this is what I do in CTS and GCS module). Since Swing, AWT and SWT
implementations will not be mixed in normal use, then I see no problem
in using the same name for different implementations, e.g.
org.geotools.gui.swing.MapPane
org.geotools.gui.awt.MapPane
org.geotools.gui.swt.MapPane
We should have no conflict, since normal users will probably never use
Swing and SWT implementations together (Swing and SWT are not designed
to work together). Furhermore, it make is easy to switch implementation.
A user may replace:
import org.geotools.gui.swing.*;
by
import org.geotools.gui.swt.*;
And a fair amount of the code should compile with no more change. In the
very exceptional cases where a user really want to mix both packages, he
can always use fully qualified name.
Regards,
Martin.
|