天天看點

SAP Hybris代碼裡随處可見的@Scope("tenant")是什麼意思

Created by Wang, Jerry on Jul 27, 2016 Go to start of metadata

http://stackoverflow.com/questions/20128166/what-is-tenant-scope-in-hybris

The core-spring.xml file of the core extension adds a special scope named tenant to the global ApplicationContext. The tenant scope makes sure that the bean is instantiated individually for each individual tenant of the hybris, whereas singleton would create only one instance for all tenants to use.

If you reference tenant-specific classes like services or DAOs inside your implementation, you have to use the tenant scope instead of the default Spring singleton scope. In case of doubt, use tenant instead of singleton.

It is useful when you want to host your online shops for several individual customers on one hybris Multichannel Suite. In Multi-tenancy, each customer is called a tenant. According to their requirement they can customize your shops.