Why hybris deprecated tenant scope?

To understand, the meaning of tenant scope, see my previous post on scopes in hybris. With version 5.0 , hybris decided to deprecate tenant scope.

In verion 5, Hybris has tenant specific application contexts. So the bean you will get will be singleton by default, which is already limited to a tenant. So there is no need to have a different scope called tenant.




As you can see fro above picture, each tenant creates its own set of application context, so now tenant scope is redundant.

Source : Hybris Wiki

What are different scopes in Hybris?

The scope can be defined as a virtual space, situation or time line, under which a particular activity is valid or possible. In terms of Hybris, the scope is the time for which a bean is available for performing business logic.

In addition to Spring scopes, Hybris has defined below scopes.

1) Tenant : This is equivalent  to singleton scope of spring. The only difference is that here Hybris limit the instance of bean in question to a particular tenant.

Hybris has deprecated this scope in version 5.0.

2) yrequest : This scope is equivalent to request scope. But this is used out side the web application context. It means that you can access these beans even in absence of a web application. These are basically used in back end processes, where we don’t want to expose our services on web, but still want to use them from outside of our project.

Once a session is invalidated, the scope ceases to exist, and instances are destroyed.