is there is any difference between component and module
Moderator: General Moderators
- raghavan20
- DevNet Resident
- Posts: 1451
- Joined: Sat Jun 11, 2005 6:57 am
- Location: London, UK
- Contact:
is there is any difference between component and module
i thought so far component and module are the same but i see sites like joomla which have separate download sections for components and modules but i cannot find the difference between the two.
can anyone help me understand these?
Thanks.
can anyone help me understand these?
Thanks.
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
I would consider a component as a single unit of code (i.e. a class) which provides functionality internally. A module would possibly be made up of such units to provide functionality to the end-user (whoever that may be).
For example, you might provide a PDF component which doesn't provide the user with anything directly, it just creates PDF documents. You could then use that component to make a PDF Reporting module which does actually provide the end-user with the tools *they* need to create a report themselves. That's probably a pretty poor example
That's just my take on it anyway; I'm sure it's quite a subjective topic.
For example, you might provide a PDF component which doesn't provide the user with anything directly, it just creates PDF documents. You could then use that component to make a PDF Reporting module which does actually provide the end-user with the tools *they* need to create a report themselves. That's probably a pretty poor example
That's just my take on it anyway; I'm sure it's quite a subjective topic.
- raghavan20
- DevNet Resident
- Posts: 1451
- Joined: Sat Jun 11, 2005 6:57 am
- Location: London, UK
- Contact:
what do you call your swiftmailer as module or component?d11wtq wrote:I would consider a component as a single unit of code (i.e. a class) which provides functionality internally. A module would possibly be made up of such units to provide functionality to the end-user (whoever that may be).
For example, you might provide a PDF component which doesn't provide the user with anything directly, it just creates PDF documents. You could then use that component to make a PDF Reporting module which does actually provide the end-user with the tools *they* need to create a report themselves. That's probably a pretty poor example
That's just my take on it anyway; I'm sure it's quite a subjective topic.
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
Neither. It's a library.raghavan20 wrote:what do you call your swiftmailer as module or component?
Swiftmailer.org wrote:Swift is a fully OOP Library for sending e-mails from PHP websites and applications. It does not rely on PHP's native mail() function which is known for using high server resources when sending multiple emails. Instead, Swift communicates directly with an SMTP server or a MTA binary to send mail quickly and efficiently.

- Maugrim_The_Reaper
- DevNet Master
- Posts: 2704
- Joined: Tue Nov 02, 2004 5:43 am
- Location: Ireland
Component is a loose term, it merely refers to any part of a system which can be separated from the whole. In that respect, the engine is a component of a car, just as a spark plug is a component of the engine. I guess the most likely interpretation is just what was said above - a component is a singular entity such as a class, or even a family of classes dedicated to a specific task.
A module on the other hand seems more a "group" term which can be viewed as more of an extra addon to a pre-existing system than a necessary part of the core.
It's more likely that component will refer to a necessary piece of a system - something it requires to function, than a module which is more likely to be used for optional extras, i.e. the car cannot function without the engine, and the engine cannot function without spark plugs... But everything can work whether you have stereo system hookable to an iPod or not - that part is purely optional, it just adds value.
Of course, since it's all interpretative, you could throw everything I said out the nearest window and still be right
.
A module on the other hand seems more a "group" term which can be viewed as more of an extra addon to a pre-existing system than a necessary part of the core.
It's more likely that component will refer to a necessary piece of a system - something it requires to function, than a module which is more likely to be used for optional extras, i.e. the car cannot function without the engine, and the engine cannot function without spark plugs... But everything can work whether you have stereo system hookable to an iPod or not - that part is purely optional, it just adds value.
Of course, since it's all interpretative, you could throw everything I said out the nearest window and still be right
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
I think a module is simply a separate bunch of code that has an interface -- whether that is a class or a library or what ever -- they are all modules. A component is a specific kind of module that meets certain rules, of which I think specific OO qualities like independence, opacity and composablity are probably the most important.
(#10850)
- raghavan20
- DevNet Resident
- Posts: 1451
- Joined: Sat Jun 11, 2005 6:57 am
- Location: London, UK
- Contact:
feyd you are confusing me more. library also helps to do achieve some objective. but most of the times, libraries can solve more than one objective but PHPMailer or Swift Mailer is concentrating on sending mails out and that is one objective which is a more a component.feyd wrote:Neither. It's a library.raghavan20 wrote:what do you call your swiftmailer as module or component?Swiftmailer.org wrote:Swift is a fully OOP Library for sending e-mails from PHP websites and applications. It does not rely on PHP's native mail() function which is known for using high server resources when sending multiple emails. Instead, Swift communicates directly with an SMTP server or a MTA binary to send mail quickly and efficiently.
component provides interfaces to get services and libraries do have interfaces may be not so good as components.
- raghavan20
- DevNet Resident
- Posts: 1451
- Joined: Sat Jun 11, 2005 6:57 am
- Location: London, UK
- Contact:
hello aborint, what exactly do you mean by interface here?arborint wrote:I think a module is simply a separate bunch of code that has an interface -- whether that is a class or a library or what ever -- they are all modules. A component is a specific kind of module that meets certain rules, of which I think specific OO qualities like independence, opacity and composablity are probably the most important.
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
To summarise what's been said so far:
A component is any "unit" of code which you can pull out of an application
A module is a complete set of components which provides an interface to performing some operation
And ermm, Swift is library (but how do we define a library)
So we'll refine a bit
Component -- pretty loose term very subjective. A bit of code.
Module -- specific to an application. It's unlikely you'll take a module from one app and use it as-is in another app. Often with a front-end.
Library -- A set of tools which provide a clean interface to performing specific, often complex tasks. Not specific to an application, and probably without any front end since it's targeted at developers. Quite a low-level tool.
EDIT | By interface, we just mean any way to "interact" with the code. Most people would think of a user-interface, but a class also has an interface which is used by the developer. i.e. The API for it.
A component is any "unit" of code which you can pull out of an application
A module is a complete set of components which provides an interface to performing some operation
And ermm, Swift is library (but how do we define a library)
So we'll refine a bit
Component -- pretty loose term very subjective. A bit of code.
Module -- specific to an application. It's unlikely you'll take a module from one app and use it as-is in another app. Often with a front-end.
Library -- A set of tools which provide a clean interface to performing specific, often complex tasks. Not specific to an application, and probably without any front end since it's targeted at developers. Quite a low-level tool.
EDIT | By interface, we just mean any way to "interact" with the code. Most people would think of a user-interface, but a class also has an interface which is used by the developer. i.e. The API for it.
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
I use it in the most essential sense -- that the functions, classes, vars and constants that need to be accessed to use the code within the module are a defined thing. Whenever you separate out some code and say, "I'm only going to access it this way" then you have a module. A module also hopefully has clear dependencies.raghavan20 wrote:hello aborint, what exactly do you mean by interface here?
I think the term component implies the next step past library. A library is a module but its interface is usually unique to itself. The idea of a component is that you build many libraries that share some common interface concepts. That theoretically enhances their usefulness because you can create things like adapters more easily for them.
(#10850)
- Buddha443556
- Forum Regular
- Posts: 873
- Joined: Fri Mar 19, 2004 1:51 pm
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
- raghavan20
- DevNet Resident
- Posts: 1451
- Joined: Sat Jun 11, 2005 6:57 am
- Location: London, UK
- Contact:
have you guys seen this article from o'reilly.
This is a requirement for a Java component.
This is a requirement for a Java component.
a component must satisfy the following requirements:
* A component must have a service interface (API) so that other components can interact with it.
* A component should have a proper life cycle mechanism (start, stop, initialize, etc.).
* A component should be configurable.
* Only one instance of the component should run in the enterprise.
* Changes in the configuration should be dynamic (on the fly).
* A component should have a proper third-party integration mechanism.
* A component should have a proper error-handling mechanism.
- Maugrim_The_Reaper
- DevNet Master
- Posts: 2704
- Joined: Tue Nov 02, 2004 5:43 am
- Location: Ireland
Is this a brain teaser topic? 
Outside that you're into murky water where anyone can ascribe it any "parts of" idea.component noun any of the parts or elements that make up a machine, engine, instrument, etc. adj functioning as one of the parts of something; constituent. componential adj.
ETYMOLOGY: 17c: from Latin componere to assemble into a whole.