加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 大数据 > 正文

方括号在德尔福?

发布时间:2020-12-15 03:34:08 所属栏目:大数据 来源:网络整理
导读:有人能告诉我下面方括号的功能是什么?或者他们叫什么,我可以google关于它.我不知道放在搜索框中的内容… type [Entity] [Automapping] TPerson = class private FId: integer; FLastName: string; FFirstName: string; FEmail: string; public property Id:
有人能告诉我下面方括号的功能是什么?或者他们叫什么,我可以google关于它.我不知道放在搜索框中的内容…
type
  [Entity]
  [Automapping]
  TPerson = class
  private
    FId: integer;
    FLastName: string;
    FFirstName: string;
    FEmail: string;
  public
    property Id: integer read FId;
    property LastName: string read FLastName write FLastName;
    property FirstName: string read FFirstName write FFirstName;
    property Email: string read FEmail write FEmail;
  end;

解决方法

那些是装饰班的 attributes.

Attributes are a language feature in Delphi that allows annotating types and type members with special objects that carry additional information. This information can be queried at run time. Attributes extend the normal Object-Oriented model with Aspect-Oriented elements.
In general,attributes are useful when building general purpose frameworks that analyze structured types such as objects or records at run time and introduce new behavior based on additional information supplied by the annotated attributes.

这是一个相当于其他语言注释的功能.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读