Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: minor typo

...

  • constants - we hold here classes like AwesomePluginConstants.java and maybe some model enums that are plugin specific.
  • hooks - model and view hooks like: ViewNameViewHooks.java, ModelNameHooks.java
  • validators - model validators like: ModelNameValidators.java, SomeOtherModelNameValidators.java
  • listeners - view listeners like: ViewNameListeners.java
  • states - if there is some logic regarding model states (I consider enum state model field as something that common to write it here), for ex. ModelNameStatesService.java
  • workPlansColumnExtensionhttp://wiki.qcadoo.org/display/QCDMESDOC/WorkPlans+column+extension

We add PluginName suffix prefix only to classes that are meant to be used outside this plugin - things like: AwesomePluginConstants.java, AwesomePluginService.java.

...

Code Block
titleBatchNumberUniquness.java
public enum BatchNumberUniqueness {
 
  GLOBALLY("01globally"), MANUFACTURER("02manufacturer");

  private String stringValue;
 
  private BatchNumberUniqueness(final String stringValue) {
    this.stringValue = stringValue;
  }
  
  public String getStringValue() {
    return stringValue;
  }

  public static final BatchNumberUniqueness parseString(final String string) {
    if ("01globally".equals(string)) {
      return GLOBALLY;
    } else if ("02manufacturer".equals(string)) {
      return MANUFACTURER;
    } else {
      return null;
    }
  }
}

 

...