Skip to content

Nominal: Getting Started

Simon Butler edited this page May 13, 2019 · 3 revisions

Getting Started

An underlying assumption of these instructions are that the reader is familiar with Java, Java IDEs and Java build tools, or is prepared to acquire that knowledge quickly.

Nominal will be used as a component of a larger software project and may require further development to fit your use case, or to improve it. The library is built using maven, and using maven, ant with ivy, or gradle is simplest. If you choose to use another tool, look at the <dependencies> section of pom.xml to see what the dependencies are and add them to the appropriate path for the build process and at runtime.

From v0.1.1 nominal is available from maven central

Using Nominal

The simplest approach to integrate nominal in your own software project is to add it as a dependency in your project’s pom.xml, or other project build file.

A Nominal instance is created by invoking one of the static methods in the class Nominal, which can use default sets of rules or user specified rules.

The Nominal class instance has a single method test that takes an instance of IdentifierName as an argument, and returns the instance annotated it according to the rule sets supplied. The extent to which the name conforms to the chosen naming conventions can be established by processing the annotations in the returned IdentifierName object.

The information required to populate the IdentifierName instance to be tested might come from a variety of sources. Nominal was originally a component in a tool chain that extracted identifier names and metadata from Java source code, split the names into component tokens or words, before adding part of speech tags. The purpose of that set of tools was to evaluate name quality in large scale empirical investigations. The process, however, mimics that of checking identifier name quality in an IDE, or at code checkin. The difference is that in a practical tool there may be an existing mechanism to acquire data. For example, the AST provided by an IDE contains data that can be processed further.

Developing Nominal

work in progress

Clone this wiki locally