-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make IBAN class Serializable #23
Comments
Hi @ludekz , Thank you for your suggestion! The IBAN class does not implement serializable and this is intentional. I will not add the interface. However, I realise that that's not in the README, so I'll take this issue as a suggestion to add a note about that. Here's why I don't want to implement serializable: IBAN's have a canonical, serialized form: the string value. This is the value that's guaranteerd to be portable across system boundaries and guaranteed to remain stable through days/months/years of change. In other words, the preferred serialized form for Reasons:
I hope this is clear. If you have any follow up questions, please post below. Cheers, |
Can you tell me what particular technology/library/platform you use that requires native serialization? |
Thank you for reply. I will think about possible solutions. Maybe we dont need to stora data in IBAN class, we can use it just for basic input validation and store just plain String. |
Hmm, I hadn't considered distributed cache as a use case. I'll prototype a bit what serialization would look like, and whether it comes out in a way that I'm willing to support. I'll keep you posted. |
This trims some overhead from the serialised form. The sample IBAN used in the unit test drops from 101 bytes to 82 bytes. The drop gets smaller the longer the IBAN, but this is a tidy percentage in all cases. Relates to #23.
It looks good. Nice job. |
@ludekz I just published the new release to Maven Central; it still needs some time to get through the CDN. New version number is 1.8.0. |
Hello,
I suggest to make IBAN class implement interface Serializable.
The text was updated successfully, but these errors were encountered: