newConstants.java :  » JPA » ssvafugabe » uia » alumni » web » Java Open Source

Java Open Source » JPA » ssvafugabe 
ssvafugabe » uia » alumni » web » newConstants.java
/**
 * Replacing the Constants Interface as it is bad practice:
 * "Constant Interface Antipattern's problem is that a class's use of
 * the static members of another class is a mere implementation detail.
 * When a class implements an interface, it becomes part of the class's public API.
 * Implementation details should not leak into public APIs."
 *
 * -http://java.sun.com/j2se/1.5.0/docs/guide/language/static-import.html
 * 
 * @author Simon Zimmermann
 */

package uia.alumni.web;

public enum newConstants {
    PERSON("person"),
    SEARCH("search"),

    PERSISTENCE_UNIT("Alumni"),

    USER("user"),

    PASSWORD("password"),
    USERNAME("username");

    private String constant;

    newConstants(String constant){
        this.constant= constant;
    }

    @Override
    public String toString(){
        return constant;
    }
}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.