473,765 Members | 2,097 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

What's the difference between component & a class?

Could someone tell me what's the difference between the two?
Is it that a class is used within an OO language while a component can
be exported between OO languages?
Are there other differences?
Thank you for your help.

Jul 22 '05 #1
4 8052
orangepic333 wrote:
Could someone tell me what's the difference between the two?
A component is generally bigger and more abstract than a class. While a
class is a relatively low-level blueprint for an object instance, a
component might be a set of classes which together forms an encapsulated
module you then interface with. A component might even contain no
classes at all!

Components are usually proven domain solvers, also known as packages,
toolset etc. depending on language. If a component has proven itself it
can significantly simplyfy the architecture (reduce complexity) as it is
viewed as a black-box, focusing only on the interfaces.
Is it that a class is used within an OO language while a component can
be exported between OO languages?


Yes that's not far off, since you might have your component in a .dll
file which you link to externally. Strictly speaking a class can also be
exported, .NET adds a lot of functionality for cross language mixing.

A component might be compiled into the source tree (static component) or
linked at runtime (dynamic component). COM/COM+/ActiveX, EJB, CORBA are
all frameworks for Component Based Software Engineering (CBSE). In
general a component is much more tolerent than a class when it comes to
language independance, platform independance and configurability - and
usually you do not touch the code of a component at all, if you do, the
component has a bad design.

/Casper
Jul 22 '05 #2
orangepic333 wrote:
Could someone tell me what's the difference between the two?
Is it that a class is used within an OO language while a component can
be exported between OO languages?
Yes. A class has a public interface, and a component has a published
interface.
Are there other differences?


Only in context.

--
Phlip
http://industrialxp.org/community/bi...UserInterfaces
Jul 22 '05 #3

"orangepic3 33" <or**********@o rangepic333.com > wrote in message
news:kt******** *************** *********@4ax.c om...
Could someone tell me what's the difference between the two?
Is it that a class is used within an OO language while a component can
be exported between OO languages?
Are there other differences?
Thank you for your help.


C++ does not define "component" , as far as I know.

In the MAC world, a component is actually a folder (directory) containing
sub-folders and specific types of files that represent an application the
user can run. The actual application is stored somewhere in the folder
tree. The operating system's Component Manager handles locating and loading
such applications (as requested through Finder actions by the user or via
other processes).

In the Windows COM world, a component is a loadable object, with a specific
interface derived from the standard IUnknown interface specification, which
is constructed such that external processes can query the object (via the
Windows registry), and make use of its published properties and functions
through an instance of a class that implements the derived interface.

Or, the term component may simply mean a part of a larger system, such as
the user-interface component or the audio processing component or the user
log component.

A class, on the other hand, is very specifically defined in C++ terms,
(although I don't have the formal specificaion for the term handy). Read
your C++ book for more info on classes.

-Howard


Jul 22 '05 #4

"orangepic3 33" <or**********@o rangepic333.com > wrote
Could someone tell me what's the difference between the two?

Is it that a class is used within an OO language while a component can
be exported between OO languages?

Are there other differences?

You are sort of right.

"class" is a keyword in both C++ and Java. In both languages, a class
consists of data members grouped together, and functions or methods that act
on them. Usually the data members are made "private", so only the class
methods have direct access to them.
Where C++ and Java differ is the way in which classes can enter into
relationships with each other. Both allow inheritance, though Java calls it
extension. C++ allows multiple inheritance, whilst Java allows classes to
implement interfaces.

Now "component" doesn't have a defined meaning in either language. So you
need to know what context the person is using the term in. He may mean
simply a library, or a visual window on a GUI. In Java, he probaly means a
Java "bean", which is a special sort of Java class that can serialise
itself, and can be instantiated without source code. In a Microsoft context,
he probably means COM, the Microsoft component interface. This is basically
a C++ interface but is formally language-independent. Essentially
applications use a third party library by querying for supported
"interfaces ". Direct X is built round COM, so that different graphics
hardware devices can be accessed by the same game without the need to
compile for all platforms.

Jul 22 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2968
by: vishal | last post by:
hi vishal here. could anyone tell me what is difference between get-post and head-put method of passing data between diffrent different web pages thxs for help in advance..............
1
1779
by: Newbee Adam | last post by:
1. what is difference between buil and delpoy? 2. If I am finished with a web app lets say. how do I compile it and what type of a file will it be? .dll, aspx,... 3. how do I bundle an application that is web based. Do I put an aspx file in the bin directory or the IIS server the conection login in the aspx file modify the sql server in same domain but on different server. Or is the asp.net code imbedded in the html file? need help...
83
15609
by: rahul8143 | last post by:
hello, what is difference between sizeof("abcd") and strlen("abcd")? why both functions gives different output when applied to same string "abcd". I tried following example for that. #include <stdio.h> #include <string.h> void main() { char *str1="abcd";
3
4468
by: Junyin.Wu | last post by:
what is difference between SqlTransaction and T-Sql(begin tran, commit tran, rollback tran) thanks.
2
6498
kiss07
by: kiss07 | last post by:
Hi, Any body Send reply.. What is difference between datatype Time and TimeStamp? Regards, Kiss07
0
1239
by: Alexander Vasilevsky | last post by:
Hi! What a difference PowerShell Cmdlet and PSCmelet? -- http://www.alvas.net - Audio tools for C# and VB.Net developers
2
7192
by: rameshcse2005 | last post by:
hai this is Ramesh , What the difference is between CREATE PROC and CREATE PROCEDURE? i have a basic question, i googled this question, but i could't get exact answer. so i hope somebody clear my basic doubt.
9
3316
by: jinendrashankar | last post by:
Hi All, Can any one have any idea about this issue what is Difference between structure and class in C++ Other then by default structure have public scope and class have private scope For data member and member function .If there is no other difference between Class & structure then why we use 2 key world in C++ we can use either class or structure in C++ ?
1
2263
by: madha128 | last post by:
Anyone can please guide me, what is difference between Terminal & Consoles in Linux????
0
9398
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10007
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9832
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8831
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5275
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5419
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3924
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3531
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2805
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.