On 17/05/2017 15:17, Sven Van Caekenberghe wrote:
OK.
But don't go too far in writing actual code. I want to understand the use case at a high level (like how you started), then I can try to find how/if STON can do what you want. Right now, you are already too deep into a possible solution.
If I have to give a really simple use case. Imagine an invoice. The invoice has the name of the customer and the currency used as a class. During the export of the invoice you do not want to export the currency as a class but as a String. So if I have an Invoice instance like this: username: 'user' currency: Currency[Euro] I want to transform the currency to a string during the export. (and keep the username as strings). Result: Invoice { #username : 'user', #currency : 'eur' } Instead of: Invoice { #username : 'user', #currency : Currency { #unit: 'Euro' } } Then during the import I want to transform the currency into a class again. (For example `Currency fromAbbreviation: stonInput`). -- Cyril Ferlicot https://ferlicot.fr http://www.synectique.eu 2 rue Jacques Prévert 01, 59650 Villeneuve d'ascq France