> i'm thinking that i can create a general interface (ie =
> JackDebugInterface) which all classes i create can "implement":
>
> public interface JackDebugInterface {
>     public static final boolean JACK_DEBUG =3D true;  // or false

    Recommend you skip the "public static final" - any variable in an
interface is automatically "public static final".

>     // Other debug functionalities
>    public void jackDebugPrint(String);
>     // .. etc
> }
>
> public class JackClass implements JackDebugInterface {
>     // ...
>     if ( JACK_DEBUG ) {
>         // debug stuff
>         jackDebugPrint("Debugging");
>     }
>     // ...
> }
>
> is this kosher or is there a better way of designing debug modules?

    Oh, pretty much. I'd shorten the name of the JackDebug interface
(I use Dbg) and then write something like

   import whatever.Dbg;

   ...

   if (Dbg.ON) {
   }

   ... then you don't need to worry about implementing the
interface (or for that matter, having Dbg be an interface).

   /Mats

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to