HOME

TheInfoList



OR:

Cross Platform Component Object Model (XPCOM) is a
cross-platform In computing, cross-platform software (also called multi-platform software, platform-agnostic software, or platform-independent software) is computer software that is designed to work in several computing platforms. Some cross-platform software r ...
component model Component-based software engineering (CBSE), also called component-based development (CBD), is a branch of software engineering that emphasizes the separation of concerns with respect to the wide-ranging functionality available throughout a give ...
from
Mozilla Mozilla (stylized as moz://a) is a free software community founded in 1998 by members of Netscape. The Mozilla community uses, develops, spreads and supports Mozilla products, thereby promoting exclusively free software and open standards, wi ...
. It is similar to Microsoft Component Object Model (COM) and
Common Object Request Broker Architecture The Common Object Request Broker Architecture (CORBA) is a standard defined by the Object Management Group (OMG) designed to facilitate the communication of systems that are deployed on diverse platforms. CORBA enables collaboration between sys ...
(CORBA). It features multiple
language binding In programming and software design, binding is an application programming interface (API) that provides glue code specifically made to allow a programming language to use a foreign library or operating system service (one that is not native to th ...
s and
interface description language interface description language or interface definition language (IDL), is a generic term for a language that lets a program or object written in one language communicate with another program written in an unknown language. IDLs describe an inter ...
(IDL) descriptions; thus programmers can plug their custom functions into the framework and connect it with other components. The most prominent usage of XPCOM is within the
Firefox Mozilla Firefox, or simply Firefox, is a free and open-source web browser developed by the Mozilla Foundation and its subsidiary, the Mozilla Corporation. It uses the Gecko rendering engine to display web pages, which implements current and ...
web browser. Many of its internal components interact via XPCOM interfaces. Furthermore, Firefox used to allow add-ons extensive XPCOM access, but this was removed in 2017 and replaced with the less-permissive
WebExtensions API Mozilla Firefox has features that allow it to be distinguished from other web browsers, such as Chrome and Internet Explorer. Major differences To avoid interface bloat, ship a relatively smaller core customizable to meet individual users' ne ...
. (Three
forks In cutlery or kitchenware, a fork (from la, furca 'pitchfork') is a utensil, now usually made of metal, whose long handle terminates in a head that branches into several narrow and often slightly curved tines with which one can spear foods ei ...
of Firefox still support the legacy add-on capability:
Pale Moon Pale Moon is an open-source web browser with an emphasis on customization; its motto is "Your browser, Your way". There are official releases for Microsoft Windows and Linux, as well as contributed builds for various platforms. Pale Moon origi ...
,
Basilisk In European bestiaries and legends, a basilisk ( or ) is a legendary reptile reputed to be a serpent king, who causes death to those who look into its eyes. According to the ''Naturalis Historia'' of Pliny the Elder, the basilisk of Cyrene is ...
,
Waterfox Waterfox is an open-source web browser that is forked from Firefox and developed by System1. There are official Waterfox releases for Windows, macOS, and Linux. Divisions Waterfox Waterfox shares core features and technologies like the Gecko b ...
.)


Model

XPCOM is one of the main things making the
Mozilla Mozilla (stylized as moz://a) is a free software community founded in 1998 by members of Netscape. The Mozilla community uses, develops, spreads and supports Mozilla products, thereby promoting exclusively free software and open standards, wi ...
application environment an actual framework. It is a development environment that provides the following features for the cross-platform software developer: * Component management * File abstraction * Object message passing *
Memory management Memory management is a form of resource management applied to computer memory. The essential requirement of memory management is to provide ways to dynamically allocate portions of memory to programs at their request, and free it for reuse when ...
This component object model makes virtually all of the functionality of
Gecko Geckos are small, mostly carnivorous lizards that have a wide distribution, found on every continent except Antarctica. Belonging to the infraorder Gekkota, geckos are found in warm climates throughout the world. They range from . Geckos ar ...
available as a series of components, or reusable cross-platform
libraries A library is a collection of materials, books or media that are accessible for use and not just for display purposes. A library provides physical (hard copies) or digital access (soft copies) materials, and may be a physical location or a vir ...
, that can be accessed from the
web browser A web browser is application software for accessing websites. When a user requests a web page from a particular website, the browser retrieves its files from a web server and then displays the page on the user's screen. Browsers are used on ...
or scripted from any Mozilla application. Applications that must access the various Mozilla XPCOM libraries ( networking,
security Security is protection from, or resilience against, potential harm (or other unwanted coercive change) caused by others, by restraining the freedom of others to act. Beneficiaries (technically referents) of security may be of persons and social ...
,
DOM Dom or DOM may refer to: People and fictional characters * Dom (given name), including fictional characters * Dom (surname) * Dom La Nena (born 1989), stage name of Brazilian-born cellist, singer and songwriter Dominique Pinto * Dom people, an et ...
, etc.) use a special layer of XPCOM called
XPConnect Netscape Plugin Application Programming Interface (NPAPI) was an application programming interface (API) of the web browsers that allows plugins to be integrated. Initially developed for Netscape browsers, starting in 1995 with Netscape Navigat ...
, which reflects the library interfaces into
JavaScript JavaScript (), often abbreviated as JS, is a programming language that is one of the core technologies of the World Wide Web, alongside HTML and CSS. As of 2022, 98% of Website, websites use JavaScript on the Client (computing), client side ...
, or other languages. XPConnect glues the front end to the
C++ C++ (pronounced "C plus plus") is a high-level general-purpose programming language created by Danish computer scientist Bjarne Stroustrup as an extension of the C programming language, or "C with Classes". The language has expanded significan ...
, C, or
Rust Rust is an iron oxide, a usually reddish-brown oxide formed by the reaction of iron and oxygen in the catalytic presence of water or air moisture. Rust consists of hydrous iron(III) oxides (Fe2O3·nH2O) and iron(III) oxide-hydroxide (FeO(OH ...
programming language based components in XPCOM, and it can be extended to include scripting support for other languages: PyXPCOM already offers support for
Python Python may refer to: Snakes * Pythonidae, a family of nonvenomous snakes found in Africa, Asia, and Australia ** ''Python'' (genus), a genus of Pythonidae found in Africa and Asia * Python (mythology), a mythical serpent Computing * Python (pro ...
. PerlConnect and plXPCOM provide support for
Perl Perl is a family of two high-level, general-purpose, interpreted, dynamic programming languages. "Perl" refers to Perl 5, but from 2000 to 2019 it also referred to its redesigned "sister language", Perl 6, before the latter's name was offici ...
, and there are efforts underway to add
Common Language Infrastructure The Common Language Infrastructure (CLI) is an open specification and technical standard originally developed by Microsoft and standardized by ISO/IEC (ISO/IEC 23271) and Ecma International (ECMA 335) that describes executable code and a runt ...
(CLI) and
Ruby A ruby is a pinkish red to blood-red colored gemstone, a variety of the mineral corundum ( aluminium oxide). Ruby is one of the most popular traditional jewelry gems and is very durable. Other varieties of gem-quality corundum are called sa ...
language support for XPConnect. For developers, XPCOM allows writing components in
C++ C++ (pronounced "C plus plus") is a high-level general-purpose programming language created by Danish computer scientist Bjarne Stroustrup as an extension of the C programming language, or "C with Classes". The language has expanded significan ...
, C,
JavaScript JavaScript (), often abbreviated as JS, is a programming language that is one of the core technologies of the World Wide Web, alongside HTML and CSS. As of 2022, 98% of Website, websites use JavaScript on the Client (computing), client side ...
,
Python Python may refer to: Snakes * Pythonidae, a family of nonvenomous snakes found in Africa, Asia, and Australia ** ''Python'' (genus), a genus of Pythonidae found in Africa and Asia * Python (mythology), a mythical serpent Computing * Python (pro ...
, or other languages for which special bindings have been created, and compile and run those components on dozens of different platforms, including these and others where Mozilla is supported. The flexibility to reuse the XPCOM components from the Gecko library and develop new components that run on different platforms facilitates
rapid application development Rapid application development (RAD), also called rapid application building (RAB), is both a general term for adaptive software development approaches, and the name for James Martin's method of rapid development. In general, RAD approaches to ...
and results in an application that is more productive and easier to maintain. The networking library, for example, is a set of XPCOM components that can be accessed and used by any Mozilla application. File I/O, security, password management, and profiles are also separate XPCOM components that programmers can use in their own application development.


Past overuse

XPCOM adds a lot of code for marshalling objects, and in the
Netscape Netscape Communications Corporation (originally Mosaic Communications Corporation) was an American independent computer services company with headquarters in Mountain View, California and then Dulles, Virginia. Its Netscape web browser was onc ...
era XPCOM was overused for internal interfaces where it wasn't truly necessary, resulting in
software bloat Software bloat is a process whereby successive versions of a computer program become perceptibly slower, use more memory, disk space or processing power, or have higher hardware requirements than the previous version, while making only dubious use ...
. This was a key reason why in 2001
Apple An apple is an edible fruit produced by an apple tree (''Malus domestica''). Apple fruit tree, trees are agriculture, cultivated worldwide and are the most widely grown species in the genus ''Malus''. The tree originated in Central Asia, wh ...
forked
KHTML KHTML is a browser engine developed by the KDE project. It is the default engine of the Konqueror browser, but it has not been actively worked on since 2016. Moreover, KHTML will be discontinued for KDE Frameworks 6. Built on the KParts framewor ...
, not Gecko, to create the
WebKit WebKit is a browser engine developed by Apple and primarily used in its Safari web browser, as well as on the iOS and iPadOS version of any web browser. WebKit is also used by the BlackBerry Browser, PlayStation consoles beginning from the PS ...
engine An engine or motor is a machine designed to convert one or more forms of energy into mechanical energy. Available energy sources include potential energy (e.g. energy of the Earth's gravitational field as exploited in hydroelectric power gen ...
for its
Safari A safari (; ) is an overland journey to observe wild animals, especially in eastern or southern Africa. The so-called "Big Five" game animals of Africa – lion, leopard, rhinoceros, elephant, and Cape buffalo – particularly form an importa ...
browser. Mozilla has since cleaned up some of the XPCOM bloat. By 2008, this combined with other efforts resulted in big performance improvements for
Gecko Geckos are small, mostly carnivorous lizards that have a wide distribution, found on every continent except Antarctica. Belonging to the infraorder Gekkota, geckos are found in warm climates throughout the world. They range from . Geckos ar ...
.


References


External links


XPCOM API ReferenceXPCOM Project Homepage
* ttp://www.codeproject.com/Articles/87465/A-Simple-XPCOM-Tutorial A Simple XPCOM Tutorial {{DEFAULTSORT:Xpcom Application programming interfaces Mozilla