Let us understand the differences between Extension and Addon

Many a times, we get confused or find it difficult to explain the difference between Extension and Addon in Hybris.

Although we use them frequently, its bit difficult to explain their difference.

Let me try to explain the same in this article

Let’s try to understand Extension

We all know that, Extension is the basic concept in hybris.

Most of the hybris code base is packaged in the form of extension including platform where all other extensions are dependent on it.

Extension generally contains business logic,item type definitions,jsp pages(if its web extension) etc.

Extension generally represents larger functionality and each extension is provided to address specific functionality.

Storefront extension to handle storefront related functionality

Core extension to handle business logic

Cockpit extension to handle cockpit related functionality.

Likewise, Hybris has provided lot of extensions to address specific functionality.

To understand extension technically in detail, please go through Extensions Basic Details article.


Let’s try to understand addon

Addon is also kind of extension but it is generally used to enhance the existing functionality.

As the name indicates, it is just an additional functionality to enhance the existing one.

Addon will never alter any existing code rather it just adds additional code to the existing code without impacting anything.

This way we can add some additional functionality to existing functionality without altering the actual code.

In addition to this, we can also achieve reusability of code using addon.

We can develop our enhanced functionality using addon and we can install this addon anywhere.

Best part in Hybris is, we can also remove this functionality whenever we don’t want just by uninstalling addon.

So Addon is basically used to garnish the existing functionality

Technically addon is a regular extension but whenever we build its codebase is copied inside target extension

There are various addons provided by hybris like captcha addon,asm addon, secureportal addon etc.

Each of these addons provides some additional enhancement to the existing extensions.

For example, when we install Captcha addon, we get captcha functionality in the storefront.


What to choose between addon and extension?

This is very interesting question and needs clear understanding of these 2 before deciding what to choose.

Answer to this is entirely depends on the requirement.

Choose extension

Whenever we are developing completely new functionality
Whenever we are developing complex functionality like code for integration with third party system, etc

Choose addon

Whenever we are required to enhance storefront by adding some functionalities like Captcha,asm,etc
Whenever we are not allowed to alter the existing codebase but need to enhance its functionality
Whenever we need to add plugin functionality which can be added and removed as and when required (using addon install and uninstall)

What if I choose addon instead of extension in some cases?

The problem in this case is an extra overhead as explained below

1.You need to run addon install command to get this functionality

2.Time consumed during build will be more here as it needs to copy the files from addon to target extension.

What if I choose extension instead of addon in some cases?

The problem in this case is as listed below

1.We are actually modifying the existing code to call the functionality of the new extension

2.If we want to remove this functionality, its not as simple as addon, here we need to manually remove the code but in case of addon we just need to run uninstall addon command.


Addon is very easy to plugin and remove the functionality whereas extension requires manual removal of code
Addon takes more time than extension during build as addon code needs to be copied to target extension.

Share this article on

Comment (9)

    1. Karibasappa G C (KB)
      Karibasappa G C (KB)

      First thing, static variables will never be a part of method, it will be a part of class always.

      So only we cant declare any static variables inside a method but we can access them inside a method.

      All static variables will be stored in separate segment inside Heap area only.

      1. The blog is very helpful. Thanks a lot for sharing! Also the “Inheritance in interface” page is not opening. Can you please fix that?

Leave a Comment

  • You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code lang=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre lang="" extra="">

    • Please answer this simple challenge to post your valuable comment *