Giter Site home page Giter Site logo

fillmore-labs / value-comparison Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 382 KB

Comparison of value objects in Java

License: Apache License 2.0

Starlark 2.20% Java 92.75% Kotlin 1.74% Scala 2.79% Shell 0.53%
java scala java17 code-generation lombok value-object domain-driven-design value-semantics immutables autovalue

value-comparison's Introduction

Value Objects in Java

13a9640ff1e11890cfcfc26bde3dcc40ffd6617f062e67a35e badge maintainability

Demo code about value objects and how to create them in Java.

Purpose

This source demonstrates how to create value objects in Java using various annotation processors.

Evaluated Libraries

Also, simple record classes, Scala case class amd Kotlin data class examples are included for demonstration purposes.

Structure

In com.fillmore_labs.talk.value.simple.* we have simple classes, one EmailAddress which demonstrates the power of being able to check value objects for consistency during construction and Person, which show how different libraries handle optional parameters and documentation propagation.

com.fillmore_labs.talk.value.inheritance.* and com.fillmore_labs.talk.value.composition.* demonstrates the composition over inheritance principle and why value objects can not meaningfully extend each other.

Running

Prerequisites

You need Bazelisk installed, see also Installing Bazel using Bazelisk.

macOS

Using HomeBrew enter

brew install bazelisk

Windows

Using Chocolatey enter

choco install bazelisk

Enable developer mode:

  1. Open Windows settings

  2. Go to “Update & security”, then “For developers”

  3. Under “Developer Mode” section enable “Install apps from any source, including loose files”.

or run with administrator privileges.

Main App

The main app simply demonstrates the toString() method with a simple structure. Run it with

bazelisk run //:value-comparison

Tests

To run all tests, use

bazelisk test //src/test/...

References

value-comparison's People

Contributors

eikemeier avatar renovate-bot avatar renovate[bot] avatar

Stargazers

 avatar  avatar

Watchers

 avatar

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.