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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T05:28:58+00:00 2026-06-08T05:28:58+00:00

This problem comes up quite a bit actually. Take this instance model view. I

  • 0

This problem comes up quite a bit actually. Take this instance model view. I have 2 objects. Simulation object and render object.

The class ObjectRSim (Object, designated as Render Sim) is something like:

class ObjectRSsim {
   var simObject:ObjectSim;
}

ObjectRSim, uses properties/invalidation of ObjectSim.

There are objects that inherit ObjectRSim and ObjectSim:

PosObjectRSim and PosObjectSim (positional objects..)

class PosObjectRSim extends ObjectRSim {
   var posSimObject:PosObjectSim;
}

or…

class ObjectRSim {
   var simObject:Dynamic; //Dynamic is untyped Type from haxe, the compiler does not check calls to a Dynamic object. 
}

Should I have a reference to each type in the inheritance hierarchy of ObjectSim in the ObjectRSim hierarchy classes, or should I just use simObject:Dynamic?

  • 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-08T05:29:02+00:00Added an answer on June 8, 2026 at 5:29 am

    It will be totally wrong to use Dynamic for that case. It’s frequently slow(for every haxe target except javascript I guess), not inlined, and is normally used only for interacting with underlying platform or working with serialization(YAML, JSON etc.).

    Talking about solving the problem…

    If there aren’t thousands of this objects planned, I’d probably just another field for lower-level class object. It’s not the clearest way from OOP perspective, but it frequently results in simpler and clearer code for me.

    Casting is another option(I personally don’t like).

    Parameterization would probably be the best way to handle that, but I’m not sure if we already have type restricted parameterization in haxe.

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

Sidebar

Related Questions

This is my first post ever :). I have quite a bit of experience
I am using $SUB for the first time and have come across this problem.
I have a bit of a problem i am trying to sort out. I
For instance, I have a model class which handles receiving bluetooth messages from other
I have come into a bit of a problem. I am dynamically updating dropdown
So here is my problem. I am trying to take the value that comes
By some coincidence this problem has come up twice in the last week. A
This is a problem I come across every so often; I always end up
Hard to come up with a proper title for this problem. Anyway... I'm currently
I'm fairly new to LWJGL/OpenGL and I've come across this problem which I can't

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.