Behavior-аспект в MPS: методы и диспетчеризация

★ 7.9 · engineering

mps-aspect-behavior is a Claude Code skill that guides authoring and editing the MPS behavior aspect — defining per-concept methods (non-virtual, virtual, abstract, static, virtual-static), constructors, and virtual dispatch (MRO). It covers overriding interface methods such as `ScopeProvider.getScope`, `INamedConcept.getName`, and `BaseConcept.getPresentation`, calling `super<Interface>.method`, and invoking behavior methods from any other aspect via `node.method(...)`. The skill documents critical rules: one `ConceptBehavior` root per concept, a mandatory constructor (empty body is valid), constructor context constraints (parent and children are null at construction time), and the correct use of MPS MCP tools (`mps_mcp_insert_root_node_from_json`, `mps_mcp_check_root_node_problems`). A five-step common-path workflow walks through model creation, adding roots, writing bodies with `mps_mcp_parse_java_and_insert`, and rebuilding. Aimed at MPS language engineers who need to encapsulate node-handling logic and share it across editor, typesystem, generator, and other aspects without duplication.