Git Product home page Git Product logo

org.openwms.core.units's Introduction

Purpose

This library defines some basic UOM (Unit Of Measure) types for OpenWMS.org. Beside the POJO types there are corresponding types for the persistence layer and an API that uses Jackson.

Motivation

The motivation to create an own library for Units Of Measures is because a UOM is not just a simple string, nor a numeric value it always consists of two parts: The absolute amount and the actual unit. To encapsulate these two values into one single new value for the use in OpenWMS.org this library exists.

Justification

Other Java libraries like the JSR-385 Unit Of Measurement target the same goal to implement units in Java and are very comprehensive. The JSR-385 Unit Of Measurement provides additional API and tools for different measurement systems. After analysis of the JSR-385 Unit Of Measurement we saw it as too complicated for our use case and started with an own and simple implementation.

Implementation

There is a general Measurable interface that represents an UOM and offers functionality to add and substract other Measurables. Arbitrary classes may implement this interface where those classes must take care of the generic type nature of this interface in order to not compare apples with pears.

Extendability

If someone wants to add additional units of measures, the Measurable interface needs to be implemented and registered in several converter classes, see the Piece class for an example.

Shortcomings

Even the Measurable is strictly typed in the type of the amount and the unit, the usage of this generic typed classes is cumbersome in Java. At least for the persistence layer with JPA this is awkward and annoying. So instead of using typed interfaces in JPA entity classes we often use the raw type and check the correct type instance afterward in code. This is a limitation down to the source code level that needs to be addressed.

Resources

Build status License Quality Join the chat at https://gitter.im/openwms/org.openwms

How to release

A release is built from the master branch. At first all required feature branches need to be merged into the master branch. Only if the master branch builds successfully the release can be done. We follow the simple Feature branch principle

Checkout the master branch and build it locally with Javadocs and sources. Then use the release plugin to setup versions, git tags and upload to artifact repository.

$ mvn clean package -Drelease
$ mvn release:prepare
$ mvn release:perform

org.openwms.core.units's People

Contributors

openwms avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

org.openwms.core.units's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.