Diffirence between an Object and a Component


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

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:
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 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.
peterkiersAuthor Commented:
don't understand !!!
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.

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.

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?

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.

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

Thanks for the help.


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

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

From novice to tech pro — start learning today.