[SNMP4J] SMIConstants: interface or class?

Guy Katz gkatz at allot.com
Tue May 11 08:34:42 CEST 2004


i tend to agree with frank. 
whats the deal with new java guys that read josh's books and implement
everything as a typesafe enum. its been around for years now - nothing new
there....
leaving the specifics of SNMP4J aside (i would reather deal with this issue
generally).
typesafe enums tend to be overrated and used without thinking first.
in my last project i was architecting a management system based on J2EE. the
guy that was implementing the system was reading josh's book and as a
consequence implemented every little constant as a typesafe enum which was
terrible to the point of non readable component interfaces.

also, i must say that i am not sure this mailing list is for critisizing
architectures. this list os for questions relating to SNMP4J. its one thing
to say "hi, i would appreciate it if this feature might be considered" and
another thing to say that "this class should be like what i am saying" which
is the vibe i got from the email regarding this issue. however i am not the
moderator of this list.... 

-----Original Message-----
From: Frank Fock [mailto:fock at agentpp.com]
Sent: Monday, May 10, 2004 8:25 PM
To: Beton, Richard
Cc: snmp4j at agentpp.org
Subject: Re: [SNMP4J] SMIConstants: interface or class?


Hi Richard,

Yes, it's better to make them a final class. That was just a reflex
from my early Java programming days where using interfaces for
constants was popular.

However, using the typesafe enumeration pattern seems to be
more overhead than advantage to me. Applying the pattern to
all constants in SNMP4J will create a couple of new classes and
a lot of more indirections which will also slow down the code a
bit. How do other's think about applying the tyesafe enumeration
pattern?

Best regards,
Frank

Beton, Richard wrote:

> Doh!
>
> I meant to say 'SnmpConstants', which should be a public final class.
>
> :-)
>


_______________________________________________
SNMP4J mailing list
SNMP4J at agentpp.org
http://p15141779.pureserver.info/mailman/listinfo/snmp4j



More information about the SNMP4J mailing list