- A model is an instance of a domain model.
A model is also referred to as an instance of a domain-specific language.
After you deploy your domain model, your users can develop their own models from it.
The following illustration shows classes and relationships from the Library domain model. For more information about this domain model, see Overview of Library.dsl.
Overview of a Domain Model and a Model
The diagram illustrates the following terms:
-
An instance of the Library domain class.
-
Link (an instance of the LibraryHasMembers domain relationship).
The source domain role for this link (and links 3, 4, and 5) is Seattle library.
The target domain role for this link is Kim Akers.
-
Link (an instance of the LibraryHasMembers domain relationship).
-
Link (an instance of the LibraryHasMembers domain relationship).
-
Link (an instance of the LibraryHasMembers domain relationship).
-
The relationship (all links between the Library domain class instance and the Person domain class instance).
-
An instance of the Person domain class that is attached to an instance of the Library domain class.
-
An instance of the Person domain class that is attached to an instance of the Library domain class.
-
An instance of the Person domain class that is attached to an instance of the Library domain class.
-
An instance of the Person domain class that is attached to an instance of the Library domain class.
Items 7-10 represent the people (instances of the Person domain class) who are attached to the Seattle library (instance of the Library domain class).
To help illustrate the generated API, the Library sample includes a real-world domain model, in which people can come to a library to read or to check out books. The library offers circulating books (which people can check out) and reference books (which people can read only in the library). If a person checks out a circulating book, the person must return it by a specific date. If the person does not return the book by that date, the person owes the library a fine.
In the following illustration, the library, person, and book objects represent domain classes in the domain model. The reference book domain class and the circulating book domain class are derived from the book domain class. Each domain class has one or more domain relationships with other domain classes. In this case, the library and person domain classes share a relationship, and the library and books domain classes share another relationship.
The Library domain model contains the following domain classes:
-
Library
-
Book
-
CirculationBook (derived from Book)
-
ReferenceBook (derived from Book)
-
Person
The Library domain model contains the following domain relationships:
-
LibraryHasMembers
-
LibraryHasBooks
-
LibraryHasCirculationBooks (derived from LibraryHasBooks)
-
LibraryHasReferenceBooks (derived from LibraryHasBooks)
-
PersonChecksOutBooks
本文介绍Visual Studio中域特定语言工具的功能与用途,包括如何创建和使用这些工具来定义特定领域的模型,并通过实例说明了这些模型如何帮助开发者更好地理解和解决实际问题。
1106

被折叠的 条评论
为什么被折叠?



