Quiz for the course "Model based software development" 2025, Made by AI based on Quizlet flashcards.
Click the button to start the quiz
A developer is creating a new configuration language within an existing Java application. The primary goal is to provide a highly readable and intuitive API for other developers, allowing them to write expressive, chained commands like 'robot.move(10).turn('left').grab()'. Which set of concepts best describes this development approach?
This scenario-based question requires you to identify the correct combination of DSL type and implementation style.
An Internal DSL implemented with a Fluent API
When designing a DSL with a framework like Xtext, your primary goal is to perform multiple, independent analyses and transformations on the user's model before generating any code (e.g., for validation, optimization, and documentation generation). Which implementation strategy is superior for this goal and why?
This question asks you to compare two core concepts and justify your choice based on a specific engineering goal.
Deep Embedding, because it creates an explicit metamodel instance (AST) that can be repeatedly traversed and manipulated.
Consider the full compilation pipeline for an External DSL. After the input text is successfully converted into a sequence of tokens (Lexing) and a basic syntactic structure is built (Parsing), what are the crucial subsequent steps required to ensure the model is semantically correct before final code generation?
This question tests your knowledge of the sequential stages in a DSL compiler's pipeline.
Name Resolution (linking cross-references) and custom Validation (checking well-formedness rules).
You are designing a DSL in Xtext and need to enforce a rule that 'an entity cannot have circular inheritance' (e.g., A inherits from B, and B inherits from A). According to the 'Bettini Principle', what is the recommended implementation approach?
Apply a known best practice (the Bettini Principle) to solve a common modeling problem.
Keep the grammar simple to just define inheritance, and implement the circular dependency check using a custom Structural Validation rule.
A developer is using a live programming environment to debug a reactive system modeled as a State Machine. The environment visually highlights the currently active state and the last transition directly on the model as the code runs. This feature, which greatly improves the Programming Experience (PX), is a prime example of what two key concepts working together?
This question requires connecting high-level goals (PX) with the specific techniques that enable them.
State Machine Visualization and Traceability
In Xtext, what is the fundamental difference in the generated metamodel when a grammar rule uses a 'Cross-Reference' to another element versus simply parsing it as a string (ID)?
This question tests your understanding of how grammar constructs directly influence the resulting metamodel's structure and capabilities.
A Cross-Reference creates a direct link (pointer) to the other model object, enabling type-safe navigation and easy name resolution.
A team wants to create a DSL for defining mathematical formulas. It is critical that expressions like '3 + 4 * 2' are evaluated correctly (as 11, not 14). Which set of parsing concepts must be correctly handled in the DSL's grammar to ensure a Well-Defined AST?
Identify the set of related concepts required to solve a classic and critical parsing problem.
Precedence and Associativity