Joomla! Dev – Module vs Component
So you’re working on a Joomla! powered website and someone asks for something outside the realm of Joomla! and its existing library of extensions. You know immediately that it’s going to be a custom something but what kind of something should it be? There are several options but the two choices that the decision normally falls to are module and component.
Choosing between the two isn’t so very difficult, it’s just a matter of picking out the strengths of each and deciding which of them you will take advantage of.
Module Strengths
Multiple instances on page. Sometimes there is a need to show things multiple times on a page and for modules this is as easy as copying a module, changing the position of the new one, and enabling it. Good examples of modules that can take advantage of this are Joomla!’s mod_banners and mod_mainmenu as you may often want to display ads in various positions on the page or use secondary navigation such as a footer menu in addition to your main menu.
Coexists with components. Modules do not overwrite the component so you can easily display module contents such as banners and menus alongside components such as com_content which provides your articles.
Smaller than components. Modules are, quite simply, easier to build than components. There are fewer files to work with and their use and implementation are fairly straightforward. In my experience, you write a module to gather some kind of data from a database and display it.
Component Strengths
Administrative functionality. Modules have limited configuration ability granted by their parameters however components may have very rich backends with robust feature sets that usually center around full CRUD operations on Joomla!’s database.
Diverse views. While the module can parse the request URL and produce different views based on the input provided, the structure for this functionality is better presented in the form of a component as the framework is already there.
Direct menu linking ability. As components form the content of the page with the template and usually with modules surrounding it, they also provide you the ability to directly link to it. Something worth noting here is that you do have the option of embedding a module position in an article thus getting a unique page with this module.
This is indeed a great discussion on joomla modules, been researching a lot about joomla and this one proves to be very useful. Thanks a lot!