Comments (2)
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:
- Value classes implementing the
Value
interface - 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.
Thanks for clarifying.
from forkhandles.
Related Issues (13)
- Result4k Kotest Matchers HOT 8
- [Bunting4k] positional argument.
- Add some types of secrets handling HOT 1
- [fabrikate4k] Nullable properties are randomly set to null HOT 1
- [fabrikate4k] Provide more information when InstanceFabricator cannot create an instance
- [fabrikate4k] Add boolean Fabricator HOT 2
- time4k - infinite loop when scheduling 2 tasks with same delay HOT 1
- running into NoUsableConstructor after update HOT 2
- [values4k] BaseX values HOT 1
- [values4k] Forced message in factory
- [values4k] Proposing support for KSUID
- [parser4k] Add by delegates for .with caching HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from forkhandles.