Diffirence between an Object and a Component

Hi,

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

P.
LVL 1
peterkiersAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Dagan HooverDeveloperCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.