方括号在德尔福?

前端之家收集整理的这篇文章主要介绍了方括号在德尔福?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
有人能告诉我下面方括号的功能是什么?或者他们叫什么,我可以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.

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

原文链接:https://www.f2er.com/delphi/102578.html

猜你在找的Delphi相关文章