Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6080759
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T11:05:53+00:00 2026-05-23T11:05:53+00:00

I wonder how much different these funcionality would look like (and how different the

  • 0

I wonder how much different these funcionality would look like (and how different the implementation would be), if Scala wouldn’t (have to) follow Java’s java.io.Serializable/java.lang.Cloneable (mostly to stay compatible with Java and the tools/ecosystem around it).

Because Scala is more simpler in language design, but enables more powerful implementation and abstraction possibilities, it is thinkable that Scala might take a different path compared to Java, if it wouldn’t have to shoulder the Java-compatibility-burden.

I could imagine that a idiomatic implementation would use type classes or traits with (possibly) private fields/methods (not possible in Java interfaces?), maybe carrying some standard implementation?

Or are marker interfaces still the right choice in Scala?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T11:05:54+00:00Added an answer on May 23, 2026 at 11:05 am

    Serialization and cloning are both kind of special because of mutability:

    • Serialization, because it has to deal with cycles in the object graph, and;
    • Cloning because… Well, the only reason to clone an object is to prevent the accidental spread of mutable state.

    So, if you’re willing to commit to a completely immutable domain model, you don’t have object graphs as such anymore, you have object trees instead.

    For a functionally-oriented approach to serialization, SBinary is what I’d probably try first. For cloning, Just Don’t Do It. 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Just wonder how much cost to raise a java exception (or to call native
As much as we would all like to say it is a benefit to
wonder whether someone can help me with the following one... I have a struct
wonder if someone could help me with a little problem. I have session values
I wonder how is the best way to integrate Java modules developed as separate
I have trouble when designing classes like this class C1 { public: void foo();
I wonder how to find/link a library without any FIND_PACKAGE. Assume that we have
I would appreciate some guidance on modelling services and operations in WCF. I have
We have two websites which only difference is in the design (different images, styles,
wonder why when I export my project to *.air and I install it on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.