Overview of Models

 
 
MSDN路径

 
Domain-Specific Language Tools 
Overview of Models 

 

  • 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

The diagram illustrates the following terms:

  1. An instance of the Library domain class.

  2. 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.

  3. Link (an instance of the LibraryHasMembers domain relationship).

  4. Link (an instance of the LibraryHasMembers domain relationship).

  5. Link (an instance of the LibraryHasMembers domain relationship).

  6. The relationship (all links between the Library domain class instance and the Person domain class instance).

  7. An instance of the Person domain class that is attached to an instance of the Library domain class.

  8. An instance of the Person domain class that is attached to an instance of the Library domain class.

  9. An instance of the Person domain class that is attached to an instance of the Library domain class.

  10. 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).

 


Domain-Specific Language Tools 
Overview of Library.dsl 

 

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.

Diagram of the Library Domain Model
Library Overview

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

See Also

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值