published是干什么的?什么时候应该用?什么时候不应该用?

安琪有纪 2006-09-10 06:03:24
rt.
published
...全文
580 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
li_zhifu 2006-09-10
  • 打赏
  • 举报
回复
惊动王牌高手了:)
伴水正解
cciioo 2006-09-10
  • 打赏
  • 举报
回复
我接着楼上的老大说:RTTI(运行期类型信息)有点像Java和.NET的反射机制,用它可以实现ORM等等;借宝地一用,招个人:http://community.csdn.net/Expert/topic/5010/5010359.xml
王集鹄 2006-09-10
  • 打赏
  • 举报
回复
published部分声明的属性、字段和方法具有RTTI(运行期类型信息)
就是在编译后的程序里保留了他们的字符名称等信息
可以通过TypInfo单元里的函数访问
对于普通类来说没有必要
安琪有纪 2006-09-10
  • 打赏
  • 举报
回复
Object Inspector?
这个published是不是只设计组件才用到?
正常的普通类要用到published么?
sdzeng 2006-09-10
  • 打赏
  • 举报
回复
Published members have the same visibility as public members. The difference is that runtime type information (RTTI) is generated for published members. RTTI allows an application to query the fields and properties of an object dynamically and to locate its methods. RTTI is used to access the values of properties when saving and loading form files, to display properties in the Object Inspector, and to associate specific methods (called event handlers) with specific properties (called events).

简单点说,就是为了让Object Inspector能够在设计时显示出来
cciioo 2006-09-10
  • 打赏
  • 举报
回复
公布组件在设计期可以编辑的属性,借宝地一用,招个人:http://community.csdn.net/Expert/topic/5010/5010359.xml

5,388

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧