Giter VIP home page Giter VIP logo

Comments (2)

daviddenton avatar daviddenton commented on September 16, 2024 1

you can use values4k with or without Kotlin value classes. You basically have 2 options, both of which will work with the ValueFactory machinery that values4k provides:

  1. Value classes implementing the Value interface
  2. Non-value classes extending the AbstractValue superclass

You are free to choose either. However - in the event that you are using any type of auto-marshalling technology (such as Jackson or anything else which reflectively constructs class instances from JSON or other ) you will have issues because the validation and other facilities which are provided by the library will be ignored (as the Kotlin complier will throw away the controlled instantiation at compile time and the type replaced with the underlying raw type instead).

Value classes are very useful, but also the JVM is incredibly good at optimising code so most applications will only benefit negligibly from their use and this may be outweighed by the losses detailed above.

Closing this off, but feel free to continue the discussion! 😄

from forkhandles.

qoomon avatar qoomon commented on September 16, 2024

Thanks for clarifying.

from forkhandles.

Related Issues (13)

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.