Code Monkey home page Code Monkey logo

Comments (3)

gary-rowe avatar gary-rowe commented on September 13, 2024

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" [email protected] 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.

from xchange.

timmolter avatar timmolter commented on September 13, 2024

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.

from xchange.

aido avatar aido commented on September 13, 2024

Both fair comments

from xchange.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.