Skip to content
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

Feature request: Make ticker class serializable or mutable #9

Closed
aido opened this issue Dec 7, 2012 · 3 comments
Closed

Feature request: Make ticker class serializable or mutable #9

aido opened this issue Dec 7, 2012 · 3 comments

Comments

@aido
Copy link

aido commented Dec 7, 2012

This is a request to make the Ticker class serializable so that ticker data may be saved to file.

If you do not wish to make it serializable than maybe change Ticker class to not be final so that it can be extended.

Thanks.

@gary-rowe
Copy link
Collaborator

Ticker is not meant as a DTO but a VO. Consumers should wrap or translate
it. Serialization is not to taken lightly due to ongoing maintenance issues.
On 7 Dec 2012 21:42, "Aido" notifications@github.com wrote:

This is a request to make the Ticker class serializable so that ticker
data may be saved to file.

If you do not wish to make it serializable than maybe change Ticker class
to not be final so that it can be extended.

Thanks.


Reply to this email directly or view it on GitHubhttps://github.com//issues/9.

@timmolter
Copy link
Member

Thinking out loud here...

Making it serializable does indeed lock the class's structure making previous versions incompatible. Here's a link: http://docs.oracle.com/javase/6/docs/platform/serialization/spec/version.html#6678.

However, as new versions of XChange roll out, with perhaps updated (and non backwards compatible) DTO objects, it doesn't mean that we are obligated to maintain compatibility at all. I'd say making them all serializable is fine if it makes things more convenient for end users. They just cannot expect compatibility, that's all. If they want that, then they need to wrap the data in their own way. While it may be convenient for them now, they may be in for a surprise later. Actually, Gary is probably right on this. The DTOs WILL change, so it's probably better for the DTOs to be wrapped/translated.

I'm also against making the DTOs non final because there are many benefits to making them final: http://www.javapractices.com/topic/TopicAction.do?Id=29

Aido, You could pretty easily create your own serializable class and pass the Ticker DTO to it's constructor, scraping the data you want to keep.

@aido
Copy link
Author

aido commented Dec 8, 2012

Both fair comments

@aido aido closed this as completed Dec 8, 2012
timmolter pushed a commit that referenced this issue Nov 1, 2017
timmolter pushed a commit that referenced this issue Jul 20, 2018
timmolter pushed a commit that referenced this issue Aug 19, 2018
timmolter pushed a commit that referenced this issue Jan 31, 2019
amitkhandelwal referenced this issue in amitkhandelwal/XChange May 14, 2021
bitso related changes id Done
earce pushed a commit that referenced this issue Jun 9, 2021
….1.65.Final

Bump netty-all from 4.1.64.Final to 4.1.65.Final
earce pushed a commit that referenced this issue Jul 22, 2021
Huobi currency transformation from Huobi utils
mfolivas pushed a commit to mltech-dev/XChange that referenced this issue Apr 28, 2022
1. Bitmex after reconnect login is not attempted
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants