- ProductModel product1 = new ProductModel();
- ProductModel product2 = modelService.create(ProductModel.class);
- The advantages of using model service method are below:
- The model service create method will generate and assign the pk for product object.
- The create method will initialize the default values, defined in items.xml for mandatory attributes.
- While calling save all method, the object is already attached to context, and will be saved. While product1 needs to attach explicitly.
So we should always go for model service way in hybris.
Why models are generated in platform extensions?
Hybris is build over the concepts of extensions. Each extension has it’s own data model. Any extension can use an item type from other extension and extend it as per requirement.
For example, the itemtype product defined in core extension. The catalog extension has extended the product itemtype, and added vendor to it.
While building the hybris, the frameworks builds according to dependencies. Since core is build before catalog extension, it is not aware of the vendor attribute defined in catalog extension. If we keep model class in extensions, then there will e chance of build failures. Like in our case, vendor attribute will not find a place in Product Model class.
Hybris build framework, creates model classes, even before, building any extension. The platform is the best place to keep them, as every extension is built upon it only. So it is not logical to create model classes in particular extensions, when we can define same data model in various extensions.
How to split an order into multiple consignments?
While fulfilling an order, some time it is necessary for a business to split the order into multiple orders.
For instance, a customer orders two items A and B, now A has a delivery window of 2 days, while B can be delivered in minimum 5 days. Now business has the option to either ship both items in 5 days. But what if item A is fresh, and will get destroyed in 5 days. There may be a case, where customers want a mandatory delivery of item A within 2 days. In such situations, if a business house doesn’t want to lose a customer, it has no choice but to split the order and ship it multiple times. This is the case of split consignment.
Now there may be various conditions, which may call for splitting the order into multiple consignments. Above example is just one of them. For example, we may want to split consignment, based on warehouse from where the item will be picked up. We may want to split consignment, based on product type (fresh or ambient) etc. These situations which decide the business logic to be a case for splitting the consignments are known as splitting strategies. We can have as many as a strategy to split, as we want.
By default, hybris creates only one consignment for an order. This is done by the following service.
As you can see, that the order Splitting Service accepts a list of strategies, we can create many strategies, and split our order. The actual business logic for splitting will go into strategy class.
How to setup a svn environment for hybris projects?
Maintaining a version system for any project is one of the most crucial aspect. Hybris projects are not special in this regard. They also do have the same life cycle in terms of development. We need to maintain different environments like SIT, UAT etc. To provide a local development environment is also equally important.
Since the size of OOB Hybris is huge, it is difficult to put everything in SVN (or GIT). Also it is not advisable. The hybris is improvising every day. A new release should not give us pain in terms of development.
The best practice for versioning a hybris project could be:
- Put only custom folder, containing customized extensions to versioning software.
- Pass latest local.properties, local extensions locally to each developers.
- Maintain copy of latest local.properties, local extensions in each of servers like development and SIT, UAT etc.
- Hybris software is wrapped around custom folder on each environment.
- Media folder could possibly in SVN or can be passed locally like property files.
production environment normally is not connected to SVN. Rather we take the most stable copy from UAT and deploy it using some deployment tool like, bamboo.
What are Catalog aware item types?
While creating a data model for your project, you might come across situations, where you might want some of your item types to be part of a catalog. This means, you want them to synchronize, you want them to be associated with a catalog, content or product. Such item types are known as catalog aware. It’s not just CMS item types or products, that needs synchronization. All OOB CMS items and products are catalog aware.
-To explicitly make an item type to be catalog aware, follow below steps:
-Mark your item as catalog item type, using custom property catalog ItemType.
-Choose attribute from item, which will qualify the catalog associated using custom property catalog Version Attribute Qualifier.
-Since each item in a catalog must be unique, we need to choose an attribute from item which is unique. This can be done using custom property unique Key Attribute Qualifier.
<itemtype code=”MyItemType” autocreate=”false” generate=”false”>
<attribute qualifier=”catalogVersion” type=”CatalogVersion”>
<modifiers read=”true” write=”true” search=”true” optional=”false” unique=”true”/>
Once updating your item type, you should update your platform, using system update.
And you should see something like below in HMC > System > item types > My ItemType > Extended
Now, instances of this itemtype will be catalog aware, and would be part of synchronization.
Will it perform if we have over 1 million SKUs?
Yes, if you have used APIs, flexi search in a right way. If you have used pagination in your flexi search and converter caches than it will not matter how much SKUs you have.
Is it Scalable?
-Hybris is spring JEE based platform and it is as scalable as any other java based platform.
-Adding new cluster node is just a matter of starting a new Hybris instance with 3 property changes.
-Hybris will automatically add that node in cluster. It has distributed cache per server and it’s out of the box cache invalidation over UDP is very much efficient.
Is it configurable or require deployment for all sort of changes?
Mostly configuration until you has not done your own customizations. Even you can expose your custom elements to hmc and from there you can also change your configuration on the fly.
How easy it is to migrate from existing Magento or custom ecommerce solution to Hybris platform?
It will depend but highly feasible. Their data import process is very much flexible. Once data mapping is done it is easy to migrate.
SAP Hybris Interview Questions And Answers
How secure it is?
Spring security is integrated OOB.
How frequent the do their releases?
They have pre-defined roadmap. Please refer wiki.hybris.com
What is the difference between PIM and PCM?
Consider them synonyms.
How easy to learn this?
Actually if you know spring and has concept of basic ecommerce than not much effort required to learn Hybris platform. You need to be familiar with impex and flexi search syntax but plenty of examples are available to learn this.
Do they have on Demand flavor also?
Yes, recently introduced as an offering.
Can we use Hybris for product enrichment also?
Yes, their PIM module is meant for this.
How you will compare this with ATG or WCS?
Very soon Hybris will be on top of these because of its simplicity.
Can we use this as a fully fledged content management solution?
-No, if your site is very much specific to content management and you want to manage specific version of -individual content than wcms is not the right solution for you.
-Otherwise it has all features that are required for an ecommerce application.
How flexible promotion module is?
Lot many promotions are available out of the box and you can extend their framework very easily to introduce your custom promotion.
Please talk about search capabilities?
Google commerce search over cloud. What else I need to say. If GCS doesn’t suits to you then use SOLR as a free solution. It is available OOB.
What integration topologies it provides?
Whatever you want….pre-integrated ActiveMQ on tomcat is available for messaging. Restful web services frameworks are available OOB.
Does it have business processing capabilities also?
Yes, limited but you can define your workflows. Moreover you can modify your workflow decisions on the fly through hmc.