geoffreywiseman/Moo

Translate Superclass Properties before Subclass Properties

Closed this issue · 1 comments

Subclasses might expect their superclass' fields to be populated before they are; that's the normal order of construction, and it might solve some problems by following that order by default.

We've recently run into an issue, where the order of translation caused a bug. This is one possible solution to the problem, as would something more explicit like offering developers some level of control over ordering (see #87).

What I like about this is that it could solve a bunch of potential problems and isn't nearly as thorny and hard to design well as explicit ordering (when you're dealing with annotations, inheritance, and who knows what else).