Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • Just so we are clear your module implementation is interleaved. e.g. Z < BaseC < Y < BaseB < X < BaseA. Otherwise, I am still completely unclear on what you are trying to achieve. Commented Mar 25 at 17:17
  • 1
    It looks like you are trying to implement virtual inheritance, virtual classes, and class hierarchy inheritance in Ruby, is that correct? I don't think that will be possible. If you need those features for your design, it is probably better to use a language which supports them in the first place. They were originally introduced in Beta, then generalized in gBeta. Both Beta and gBeta haven't been maintained in a long time, unfortunately. But they also exist in Newspeak, which is still maintained, and is a pretty great language. Commented Mar 26 at 7:25
  • @engineersmnky I have updated the question by improving the diagram of the section Trying to re-use the inheritance chain to better reflect the relationships. Jorg W Mittag spotted the aim correctly. Commented Mar 26 at 9:51
  • @JörgWMittag thanks for your answer. I read you are literate in programming languages. The aim is to extend libraries in ruby in a sustainable and re-usable way. You are correct is about class hierarchy inheritance. I am unsure how come you don't name it multiple-inheritance though. Question: besides traceability/complexity on "non-explicit" relationships (due to not being native), would you say that virtually implementing this via module inclusions chain (kind of "hierarchy"; via Option B - modules) can have any drawbacks? (I might change the question, just for the sake of it). Commented Mar 26 at 9:57