mercredi 11 août 2021

Hybris-Common code approach with multiple basestores and basesite in same hybris instance

We have a situation where in hybris we are planning to have multiple business units by having basesite / basestore for each business unit.

So basically, we will build all the core and sample data for each business unit such a product and content catalogs.

UseCase:

Sinc we are using common instace of sap hybris cloud, the same API's will be used for all business unit. For example if we have an OCC API like this "xoccwebservices/v2/basesite1/users/createuser" and "xoccwebservices/v2/basesite2/users/createuser"

Here based on the basesite in the URL ,hybris OOTB will predict what is the basestore and set that store in session accordingly.

Challange / Issue:

Since we are using a common instance for different business unit,we want to make the code base a common one ,in other words if BU1 have facade as Bu1Customerfacade ,the method inside the Bu1Customerfacade should be a common one for Bu2.

So the idea is to minimize the customization on the same time,make use of the existing methods which are in facade / service.But my concern is how can I implement my own business unit business logic ?

What I am looking for is the design pattern with some examples where we have common interface to all BU's and i simple extend that interface and implement my own logic and i do understand the way we do is also similar on OOTB,but the idea here is that the method that i have should be called in real time for that business unit.

Please see if this question make any sense as I am out words in explaining the problem.And kindly reach out to me in case of further details

I gone through this article here more or less explains my expectation. https://stackify.com/service-locator-pattern/ but i am not sure how to integrate this into hybris.

Appreciate your help on this.

Aucun commentaire:

Enregistrer un commentaire