![Domain specific languages martin fowler](https://loka.nahovitsyn.com/101.jpg)
Traditional discussions of languages and parsing don't use a Semantic Model. There are occasions when an AST is an effective Semantic Model for a DSL, but these are the exception rather than the rule. It often will be a substantially different structure, and usually not a tree structure. The Semantic Model, however, is based on what will be done with the information from a DSL script. Although an abstract syntax tree may simplify and somewhat reorganize the input data, it still takes fundamentally the same form. A syntax tree corresponds to the structure of the DSL scripts.
![domain specific languages martin fowler domain specific languages martin fowler](https://1c-dn.com/upload/medialibrary/5e4/5e4ed8b474d253ae4b0d421e89145aaa.jpg)
You could use a DSL to describe object-relational mappings, and the resulting Semantic Model would consist of the Data Mappers, not the Domain Model that is the subject of the mapping.Ī Semantic Model is usually different from a syntax tree because they serve separate purposes. A good example of this is an object-relational mapper that coordinates data between an object model and a relational database.
![domain specific languages martin fowler domain specific languages martin fowler](https://files.speakerdeck.com/presentations/8bea2a3d4e814f19afe0f2369df2d36b/slide_58.jpg)
![domain specific languages martin fowler domain specific languages martin fowler](https://1c-dn.com/upload/medialibrary/ab6/ab6199c20c36aaf0deeac72abe4ba164.jpeg)
A Domain Model captures the core behavior of an application, while a Semantic Model may play a supporting role. I use Domain Model to refer to a behaviorally rich object model, while a Semantic Model may be data alone. I use a separate term because although Semantic Models are often subsets of Domain Models, they don't have to be. 53.3生成带有嵌套条件的安全控制面板状态机(Velocity和Java生成的C)432Ī Semantic Model is a notion very similar to that of a Domain Model.
![Domain specific languages martin fowler](https://loka.nahovitsyn.com/101.jpg)