至今还没能理解类这个定义的具体含义!
tobject,tpersistent,tcomponent.所代表的是什么意思?有没有什么区别
他们各自派生的对象分别是什么?平时我们往form上拖放的控间分别属于哪一个类??
本人水平很低,正处于学习阶段,希望大家指点!谢谢!

解决方案 »

  1.   

    1.TObject is the ultimate ancestor of all VCL objects and components.UnitSystemDescriptionTObject encapsulates fundamental behavior common to VCL objects by introducing methods thatcreate, maintain and destroy instances of the object by allocating, initializing, and freeing required memory.
    return class-type and instance information on an object and runtime type information (RTTI) about its published properties. 
    support message handling.
    support interfaces that the object implements.Use TObject as an immediate base class when declaring simple objects that do not need to persist (are not saved and reloaded) and that do not need to be assigned to other objects. If no ancestor type is specified when declaring a new object class, Delphi automatically uses TObject as the ancestor.Much of the capability of VCL objects is established by methods that TObject introduces. Many of these methods are used internally by the development environment and are not intended for users to call directly. Others are overridden in descendant objects that have more complex behavior.Note: While TObject is not technically an abstract class, objects of this type are not normally instantiated.
    2.TPersistent is the ancestor for all objects that have assignment and streaming capabilities(dfm format).UnitClassesDescriptionTPersistent encapsulates the behavior common to all objects that can be assigned to other objects, and that can read and write their properties to and from a stream. For this purpose TPersisent introduces methods that can be overridden to:Define the procedure for loading and storing unpublished data to a stream.
    Provide the means to assign values to properties.
    Provide the means to assign the contents of one object to another.Do not create instances of TPersistent. Use TPersistent as a base class when declaring objects that are not components, but that need to be saved to a stream or have their properties assigned to other objects.3.TComponent is the common ancestor of all components that can appear in the form designerUnitClassesDescriptionComponents are persistent objects that have the following capabilities:The ability to appear on Component palette and be manipulated in the form designer.
    The ability to own and manage other components.
    Enhanced streaming and filing capabilities.
    The ability to be converted into an ActiveX control or other COM object by wizards on the ActiveX page of the New Objects dialog.Do not create instances of TComponent. Use TComponent as a base class when declaring non-visual components that can appear on the component palette and be used in the form designer. Properties and methods of TComponent provide basic behavior that descendant classes inherit as well as behavior that components can override to customize their behavior.To create components which are visible to users at runtime, use TControl or its descendants as a base. To create visual windowed controls use TWinControl or its descendants as a base.
      

  2.   

    你上delphi的各个大的网站都有书籍的下载的 看看吧
      

  3.   

    delphi5、6开发指南上就有。这样的书最好买一本。我买了5、6的,内容有些重复,但是觉得很值得。好久没去书店,不知道delphi7开发指南出了没?应该出了的。
      

  4.   

    简单的说:
    TObject是所有delphi类的基类。
    TPersistent在TObject基础上增加了流的操作。
    TComponent是所有元件的基类,非可视化元件直接派生于它,平时拖放的控件直接或间接派生于TWinControl或者TGraphControl
      

  5.   

    tobject: Delphi所有类的基类;
    tpersistent:持久性对象的基类;什么是持久性对象?可以在存储媒体中保存和装载。
    tcomponent:所有vcl的核心,所有组件的基类。设计阶段,往form上拖放的控间都是tcomponent的子类。
      

  6.   

    TObject:是所有类的基类,负责类的创建和释放。
    tpersistent:流类。类支持流的操作,继承于TOBJECT类
    tcomponent:组件的基类,继承于TPERSISTENT类
    在TFORM类上放的都是TCOMPONENT的子类,有输入焦点的是TWINCONTROL控件类,
    没有输入焦点的大部分是TRAPHCONTROL的子类啊。