Open pablisco opened 2 years ago
Wouldn't this work by simply having a Date
function which takes a String
as argument? In a sense, our functions with the same name as the type we want to build are "adapter" between those types already. WDYT?
Hmm, yeah that could be an interesting idea. My only worry is the look up time. And naming clashes, as there could be the same Date on multiple places. Although, I guess we can determine it by the return type too. And then we don't even need to name it the same. But that would add even more potential clashes.
Need to have a play around with this.
Does KopyKat already know how to use value class
underlying values for copying? On the data layer we need value class
es but, when sending the response, Jackson doesn't seem to know what to do with them... so we'd like to use KopyKat to map between them.
In principle it should work out of the box, since value classes are just as any other class. If you find a specific case which is not covered, we're happy to look at it and add support for it :)
When creating copy constructors it would be useful to have mappings between types that are no exactly the same.
For instance, the representation of a date on the network layer may be a string, but it may be a date on the domain.
We could define strategies to work with such conventions: