I've got an ADT with a whole lot of members, some ...
# functional
r
I've got an ADT with a whole lot of members, some recursive, some not. Now that the code is evolving, I've got some members which are possible at some stages of the program, and some others at other stages. What's the best way to model this? Use multiple inheritance to tag them for the specific stages?
y
Using `sealed interface`s would definitely be the way to go! Define an interface for every phase of the program, then your phases themselves will be very clearly typed as well (they will be like
(Phase1Members, OtherArgs) -> Phase2Members
.