I thought of one other thing that is now starting to lean me more towards the constants approach: continuing to use namespaces as the example, pre-registered namespaces consist of both prefixes and URIs, so there may be a need for either/or, meaning the method approach might start getting pretty unwieldy and start "littering" the enclosing class.

John P. A. Verhaeg wrote:
While working on the XML sequencer, I determined that I will need access (via the SPI project) to some "well-known" namespace URI's in order to build node names, types, and path segments correctly.  There are a few options here:
  1. Define the URI's in a separate class or interface, or
  2. Define them in an existing class, such as the org.jboss.dna.spi.graph.NamespaceRegistry interface.
where by "define", we could either:
  1. Provide constants for the URI's (e.g., public static final String JCR_URI = "http://www.jcp.org/jcr/1.0"), or
  2. Provide methods to return the URI's (e.g., similar to NamespaceRegistry.getDefaultNamespaceUri()).
I don't really have a religion regarding this one way or the other.  I just want to establish a pattern up front that everyone is comfortable with, and so I can put as little thought as possible towards this in the future.

_______________________________________________ dna-dev mailing list dna-dev@lists.jboss.org https://lists.jboss.org/mailman/listinfo/dna-dev