- 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
![domain language model](https://i-blog.csdnimg.cn/blog_migrate/59eded926d643b774e5e1c5fa7d7c810.png)
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.
![Library Overview](https://i-blog.csdnimg.cn/blog_migrate/11ec130e0107ca4f148c41e1508c6536.png)
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