Prefer composition over inheritance
There is a principle in object-oriented design to prefer composition over inheritance. This applies also to modeling in MPS. Example Problem Let’s say that as part of your language you need to describe an input for a certain transformation. The input has a name and can come from two sources: a named file or standard input (stdin). Inheritance-Based Solution Here is how you could model this requirement. First, let’s create a base concept for inputs:...