• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 152
  • Last Modified:

Diffirence between an Object and a Component

Hi,

What's the diffirence between an object and a component?

P.
0
peterkiers
Asked:
peterkiers
  • 3
  • 3
  • 2
  • +1
3 Solutions
 
ThievingSixCommented:
Objects
An object consists of methods, and in many cases, properties, and events. Properties represent the data contained in the object. Methods are the actions the object can perform. Events are conditions the object can react to. All objects descend from the ancestor object TObject.

Components
Components are visual objects that you can manipulate at design time. All components descend from TComponent.


Directly from the Delphi help. If you want more information just ask.
0
 
peterkiersAuthor Commented:
don't understand !!!
0
 
RickJCommented:
TComponent is a class derived from the TObject the base class.
An instance of the TComponent would actually be an object of type TComponent.
Does that make sense?

Heirachy from help file.
TObject
TPersistent
TComponent
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
JohnjcesCommented:
Maybe this might help...

A component is a Delphi Pascal unit or many lines of Pascal code that do some task or many tasks. A component is "dropped" onto your application's form and you then have access to the components objects and properties through the object inspector.

These objects and properties of the component are variables you can set, such as a caption, or boolean, ture false, values like Visible. You can adjust the properties of a font, like making the font bold. Other objects of the component are events or some result or action when something occurs, like a mouse click on a label (TLabel) component.

An example component would be the TLabel. Its properties, which are objects of the component are caption, name and etc. Events are as an example OnMouseClick.

Did this help a bit?

John
0
 
peterkiersAuthor Commented:
This is what I think:

* The base class TObject is a abstract definition.
* The TComponent class is a class for non-visual components
* and the TControl class is a class for visual componens
 
So wheter I use the TComponent class or the TControl class
When I call TClass.Create you then create an instance of that class which is referred to as an object.

I hope this is correct.

P.
0
 
RickJCommented:
That sounds pretty good to me.
0
 
peterkiersAuthor Commented:
aahh what a relief.

Thanks for the help.

Greetings,

Peter Kier
0
 
RickJCommented:
Thanks, glad I could help.
0
 
JohnjcesCommented:
I was glad I could help but I was writing as if you were newb. Thanks too!

John
0

Featured Post

[Webinar] Improve your customer journey

A positive customer journey is important in attracting and retaining business. To improve this experience, you can use Google Maps APIs to increase checkout conversions, boost user engagement, and optimize order fulfillment. Learn how in this webinar presented by Dito.

  • 3
  • 3
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now