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 8718157
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T06:28:22+00:00 2026-06-13T06:28:22+00:00

I am part of a project that is consolidating code written in different languages

  • 0

I am part of a project that is consolidating code written in different languages at different times into one single application.

My piece is going from C++ to Java. After reading the comments to this question: https://stackoverflow.com/questions/587458/implement-mixin-in-java I concluded that mixins in Java are not really possible without code generation schemes, and those will not be well received within the team I’m working on.

What is the correct way to implement what used to be a Mixin in C++ using vanilla Java? In particular, there used to be an MVC-type design where some Controllers had mix-and-match logic that used controller state. Controllers would inherit Mixins to gain this functionality in various permutations such that a linear inheritance path does not make much sense.

The best thing I can think of right now is a bunch of utility-type classes that contain the logic that used to be in the Mixins, and have controllers call their functionality while passing themselves in as references so that the utility classes can access their state. IMHO this really stinks and I’m hoping there is a better way.

So, what is the right way to design this in Java?

  • 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-06-13T06:28:24+00:00Added an answer on June 13, 2026 at 6:28 am

    If you really want mixins, you can use a language like Scala which supports them (and runs on a JVM with Java code)

    Otherwise I would composition, which is not pretty either, but is simple.

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

Sidebar

Related Questions

I'm editing a piece of code, that is part of a big project, that
I have a game code (from ioquake3 project) that compiles part of gameplay binaries
I have a class, which is part of a code library project that was
If one has a project that has tests that are executed as part of
I have a project that has, amongst other things, one web application (mvc) and
As part of a college project, I'd like to deploy a system that compares
As part of my project I need to use some Unamanged code dlls in
As part of a project with a partner, we are required to provide single-sign-on
I use some libraries that I don't want built as part of every project
I am working on a project that plays audio for part of the program.

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.