5
votes

I suppose Default Extension can Encapsulate Business Logic, Type Definitions, Configurations & Add Ons.

I Know that Add On is Also a Type Of Extensions that Extend Normal Extensions.

I further know that Add Ons Extend Functionality without Touching CODE Base.

Any Inputs from Hybris Experts Highly Appreciated.

4

4 Answers

7
votes

An extension is an encapsulated piece of the Hybris Commerce Suite that can contain business logic, type definitions, a web application, or Hybris Management Console(hMC) configuration.

Hybris shipped with number of extension templates eg yempty, yaddon, ycockpit, ybackoffice and ycommercewebservices.

Addon is also a kind of extension which is generally used to extend Accelerator StoreFront functionality. For example, suppose you want to create a new CMS component and want to use it in your storefront but you don't want to touch the code base then the best way is to create an addon.

A normal extension doesn't need to install but addon needs to. It means if you are creating an addon, you need to install it in your existing storefront template.

ant addoninstall -Daddonnames="customaddon"  -DaddonStorefront.yacceleratorstorefront="customstorefront"

This will insert the dependency between customstorefront and customaddon in the storefront extensioninfo.xml file as well as provide the additional web-spring.xml configs defined in the customaddon's project.properties. A build callback will now copy the web application content to the storefront.

After ant all, you should find the view JSP duplicated to customstorefront /web/webroot/WEB-INF/views/addons/customaddon/desktop/cms.

This way you can customize accelerator storefront without touching the actual one.

2
votes

Extensions are self-contained independent packages, add-ons are not. In general terms, an extension is the larger unit. You can use add-ons to enhance functionality in an extension but not vice versa.

The Hybris Diary has a glossary with detailed descriptions:

http://hybrisdiary.com/?s=add+on

http://hybrisdiary.com/tag/extension/

1
votes

I will tell u my understanding of bot extensions and addons. We get default extensions ( through ant modulegen) in hybris. If you look closely every extension has a single purpose. Whether it is storefront(view and controller), facade( Business logic), commercewebservice(rest services),etc...

Now imagine someone approach you with already settled hybris store. But you can't have access to any of their extensions. Then all they want is some plugin code i.e. not complete codebase.

But now you can't create another facade extension, storefront extension,...

So Addon will be the best choice, because it comes handy and can play any role required. (e.g. It has *-items.xml to add or modify the Hybris Types, you can write controllers for storefront, you can write your own services or facades, or cms component). I hope you find it helpful.

1
votes

Addon Basically, you should create an addon if you want to create or extend some storefront functionality. - Create storefront functionality. For example, you'd like to create a new CMS Component which is a Vimeo video. - Extend current storefront functionality. For example, If you'd like to extend a controller or something from standard accelerator.

Extension This is your option if you want to create new something that it is not related with storefront. Sometimes your functionality will be only related with backoffice or services, so creates an addon is not necessary.