Explain Multi-Tenant System in Hybris e-commerce suite ? How Multi-Tenant is differ from Hybris cluster.

Multi-Tenants means individual set of data across one database .Hybris  e-commerce suite provide to run one single codebase over multiple set of data . following below point need to remember related to hybris interview point of view

1.       It provide isolation between set of data (tenant)

2.       Provide individual time zone and locale setting.

Hybris multi-Tenant is completely differ from Hybris clustering as below

A hybris Cluster is a concept different from multi-tenant hybris Commerce Suites. A hybris Cluster is a number of individual, separate hybris Commerce Suites sharing one single set of data, whereas a multi-tenant hybris Commerce Suite is one single hybris Commerce Suite using individual sets of data.

Explain extension concept in Hybris e-commerce suite. Why need extension concept in Hybris ?

Hybris e-commerce suite is based on flexible modular concept that means  hybris saying if you want to putting any new functionality then by using extension you can integrate it with hybris.. By using extgen tool you can create own extension in Hybris . Below step follow to create own extension in Hybris.

B-    Open a command prompt.

C-    Navigate to the ${HYBRIS_BIN_DIR}/platform directory.

D-    Run the ${HYBRIS_BIN_DIR}/platform/setantenv.bat file. Do not close the command prompt after this run as the settings are transient and would get lost if the command prompt is closed.

E-    Run ant extgen<ENTER> in ${HYBRIS_BIN_DIR}/platform directory. This internally runs ant in the extgen directory.

 Extgen prompts you to specify:
  •  The extension's name
  •  The extension's Java package.
  •  The extension template to use.  
  • For a list of available extension templates compatible with extgen

Need to configure below code in localextensions.xml of config folder

<path autoload="true" dir="${HYBRIS_BIN_DIR}/ext-platform"/>
<path autoload="true" dir="${HYBRIS_BIN_DIR}/ext-cockpit"/>
<path dir="${HYBRIS_BIN_DIR}"/>

List of Hybris interview Question in igate patni ,Accenture, TCS , NTT Data

Hi Friend I have attended two telephonic round on Hybris e-commerce suite for i-gate patni. Which I listed below

1.  Tell me what you have done on Hybris in your project.

2.  Have work on integration of hybris to any other ERP.

3.  What is workflow in Hybris.

4.  Suppose you need to create a own store then what will your steps.

5.  Suppose you have create a store by extending a hybris default base store then what common functionality will be in both.

6.  They have asked question on Hybris Solr.

7.  Suppose you are creating a product and you have to need a media file associated with product then how you can do it.

8.  Asked question on Hybris data Model.

BUY Latest Hybris Interview Question
mail to- erkumod@gmail.com   or skypeid- bipins25 

For More Question Click Below


More Hybris Topic | Hybris Latest Interview Question


http://everyreply.com//tag/hybris

Step by Step Paypal integration with Hybris e-commerce Suite | Payment getway integration with Hybris

I have integrated Paypal payment getway integration with Hybris e-commerce suite as below

First create a paypal extension in hybris using ANT extgen after then follow belwo steps

1.  Create a seller account and a buyer account in PayPal sandbox environment. https://www.sandbox.paypal.com.
2.  Download the certificate for the seller account for accessing the API.
3   Use Express checkout API for the transaction.
4   Express checkout API consists of three parts: SetExpressCheckout, GetExpressCheckout, and DoExpressCheckout.
5   Request DTO’s have been created for SetExpressCheckout, GetExpressCheckout, and   DoExpressCheckout.
6   Response DTO’s have been created for SetExpressCheckout, GetExpressCheckout, and DoExpressCheckout.
7   Individual service classes have been created for SetExpressCheckout, GetExpressCheckout, and DoExpressCheckout.
8  During the first call or request to Express Checkout we pass the following parameters:  total amount, currency code, return URL, cancel URL and payment action.
9  As an Acknowledgment, it returns a Token in the form of response.

10  During the second call or request to the Express checkout , the token is appended with sandbox URL and the customer is redirected to the sandbox site.
11   As response PayPal returns Token, Payer ID, and Email ID.
12   During the third call or request to Express Checkout we pass the following parameters: total amount, currency code, payment action, Token, Payer ID.
13   As response PayPal returns Transaction ID, Transaction Status and Pending Reason.
14   Mention the API username, API password, Certificate path and Proxy settings in local.properties.
15   In order to confirm the completion of transaction, log into the PayPal  buyer account and check the payment details.(Name of the store, total amount of the transaction and other details could be seen.)

Hybris4.8 e-commerce suite interview question | list of interview question on Hybris4.8 e-commerce suite

I have attended more than one interview on Hybris 4.8 e-commerce suite in multiple MNC software company some of
interview question listed below

1. What you done Hybris4.8 means they asked about your work on hybris in your project
2. How you will create own component in Hybris
3. How will configure Multi stores in Hybris.
4. How you can create cronJob and will schedule in hybris.
5. About ImpeX in Hybris.
6. How and steps of integrate any Payment gateway.
7. what is Item in Hybris
8. How you have created web Services in Hybris.

Favor Composition over inheritance in java design | Java core design concept

Object-oriented design (OOD) principles make up the core of object-oriented programs and systems (OOPS). It is the process of planning a system of interacting objects for the purpose of solving a software problem. An object contains encapsulated data and procedures grouped together to represent an entity. The object interface, or how the object can be interacted with, is also defined. An object-oriented program is described by the interaction of these objects. Object-oriented design is the discipline of defining the objects and their interactions to solve a problem that was identified and documented during object-oriented analysis.
http://spencerwade.files.wordpress.com/2013/02/a2.gif

There are innumerable ways that programmers use object-oriented design in software development. Many of these programmers tend to have a very one-sided view of OOD; especially when working with Java. Programmers often chase design patterns like Singleton, Decorator, or Observer without giving enough attention to object-oriented analysis, or following the core principles of using OOD with Java. There are developers and programmers of all skill levels who have never learned the correct design principles, do not fully understand the benefits a particular design principle offers, or are unsure of how to properly apply these principles when coding.

The most important thing when working with OOD in Java is to strive for cohesion in any solution, code, or design. Taking the time to look over successful applications of OOD in Java coding can be very helpful, and examples of open source Java OOD can be found all over the Internet. Apache and Sun offer excellent views of how Java coding should be tackled using OOD.

These examples are helpful, as was stated before, but they can never replace the importance of real world experience.  This type of learning teaches not only the basics of successful design, but also gives users an idea of what happens when these design principles are violated. Mistakes teach valuable lessons in life and programming, so novice designers and those with little experience will benefit greatly from seeing firsthand what works and what does not.

Principles of OOD in Java

The list that follows defines and describes some core principles that developers must keep in mind when working with OOD in Java coding. These principles represent some information that all programmers need to know to be successful when working in this medium. These principles are:

     DRY: DRY, or don’t repeat yourself, means just what it says; never write duplicate code. Use abstraction to group common things together in one place. For example, if a hardcoded value is used more than one time consider making it a public final constant, or if a block of code is located in more than one place try making it a separate method. This is a general rule of thumb, but, as with all things, there will be exceptions. The benefits from doing things in this way can be clearly seen when it is time for code maintenance.
    Encapsulate What Varies: Change is the only constant in software development. This is a truism and leads to the next design principle; encapsulate what varies. The code expected, or suspected, of being changed in the future should be encapsulated. Encapsulation of code allows for easier testing and maintenance. In Java coding, it is best to make variables and methods private by default and increase access step-by-step from private to protected. The Factory design pattern in Java uses encapsulation on object creation code to provide flexibility when releasing new products. The code, due to its encapsulation, is not impacted by this change, so the programmer does not need to rewrite anything.
    Open Closed: Classes, functions, or methods should be open for extension, or new functionality, and closed for modification. This is an excellent principle for preventing changes being made to functional, tested code by anyone other than the developer.
    Single Responsibility: This principle is based on the assumption that a class should never have more than one reason to change, and should always handle single functionality. In Java coding, it is unwise to put more than one function into a class. By doing so, coupling between the two functions is impossible to prevent, so if one function needs to be changed there is a good chance that the coupling will be broken. This will require another round of testing to safeguard against any unforeseen problems cropping up in a production environment.
    Dependency Injection or Inversion: The framework will provide the dependency, so that is not an issue for programmers. Spring framework achieves this beautifully.  Any class that is injected by DI framework is easy to test with mock objects, and easier to maintain due to the fact that the object creation code is centralized in the framework, and the client code is entirely free of this clutter. There are multiple ways to implement dependency injection.
    Composition over Inheritance: Whenever possible, it always best to favor composition over inheritance. This point is highly debatable, but composition seems to allow more flexibility than inheritance. Composition gives the option of changing the behavior of a class at runtime by setting the property, and using interfaces to compose a class using polymorphism. This provides the flexibility to upgrade implementation at any time.
    Liskov Substitution: This principle states that subtypes must be substitutable for super type. It is closely related to both the single responsibility principle and the interface segregation principle that will be discussed later. In order to follow the Liskov substitution principle, all derived classes and subclasses must enhance functionality; not reduce it.
    Interface Segregation: The interface segregation principle states that a client should not implement an interface if it is not necessary. The most common problem that arises from ignoring this principle happens when an interface contains more than one function, but the client only needs one of them. This is one of the reasons that interface design is so difficult. Once the interface is released from development, it cannot be changed without breaking all implementation. In Java, interfaces with only one function mean fewer methods to implement, and an overall easier task to complete.
    Program for Interface not Implementation: Always program for interface instead of for implementation. This will lead to more flexible code that can coexist with any new implementation or interface. It is best to use interface type on variables, return types of method, and argument types of method when working with Java.
    Delegation: This principle basically means that it is never a good idea to try to accomplish all the necessary steps alone. Delegate everything possible to respective class. Equals and hashcode methods in Java allow users to ask class itself to do a comparison of two objects for equality. The greatest benefits of this principle are ease of behavior modification and minimizing code duplication.

Final Thoughts

The listed principles of working with OOD in Java will help users write flexible, higher-quality code by maximizing cohesion and minimizing coupling. As in all things, theory is only the first step. Developing the knowledge necessary to properly apply these principles takes real-world experience and trial-and-error. This will give the programmer the tools to know when they are violating a key principle, and compromising the flexibility of the code. These principles are not fool-proof, and like all things in life they are to be used as guides and not blindly followed. It is beyond question that when working with OOD in Java these core principles will allow developers to make fewer mistakes, and get the upmost out of their coding work.

First Hello World example in Spring framework by using DI.

Hi Friend when you going start learn Spring Framework you will start to write first Hello World Program
Below is step by step to write first program

1. Write the applicationContext.xml (bean container)

<?xml version="1.0" encoding="UTF-8"?>
<beans
    xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:aop="http://www.springframework.org/schema/aop"
    xsi:schemaLocation="http://www.springframework.org/schema/beans
     http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
     http://www.springframework.org/schema/aop
     http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
      http://www.springframework.org/schema/context
     http://www.springframework.org/schema/context/spring-context-2.5.xsd
     http://www.springframework.org/schema/util
     http://www.springframework.org/schema/util/spring-util-2.5.xsd"
     xmlns:context="http://www.springframework.org/schema/context">
<context:annotation-config/>
<context:component-scan base-package="com.dao"></context:component-scan>
<aop:aspectj-autoproxy></aop:aspectj-autoproxy>
<bean id="cal" class="com.test.calculation" init-method="init">
<property name="name" value="kumud"></property>
</bean>
</beans>

2. Write bean class for calculation

package com.test;
import org.springframework.beans.factory.BeanNameAware;
public class calculation  implements BeanNameAware{
    public String name = null;
    public String getName() {
        return this.name;
    }
    public void init() {
        System.out.println("Inside the init methos");
    }
    public void setName(String name) {
        this.name = name;
    }
    public void setBeanName(String arg0) {
        System.out.println("setting the bean name ********************");
    }
}

3. write TestClass

package com.test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
public class TestClass {
    public static void main(String [] args)
    {
        ApplicationContext ctx = new ClassPathXmlApplicationContext("applicationContext.xml");
        calculation calc=(calculation)ctx.getBean("cal");
        System.out.println("The name of is"+calc.getName());
        }

}

Core concept of Comparable and Comparator interface in Java | interview question on Java collection

package com.rajeev;


1. By Using comparable interface sorting logic(compareTo(Object obj)) implements within the class
so every time when you want to change sorting logic then there must be change inside the class. suppose
in below code right now sorting logic is based on employee's name when you want to changed it to based on employee Id then you
need to change logic as below

 @Override
       public int compareTo(Object obj) {
              emplyee emp=(emplyee)obj;
             return Integer.toString(this.employeeId).compareTo(Integer.toString(emp.getEmployeeId()));
       }

import java.util.*;
import java.util.Iterator;
import java.util.TreeSet;
class emplyee implements Comparable

{
       String name;
       int employeeId;
       public emplyee(String name, int employeeId )
       {
              this.name=name;
              this.employeeId=employeeId;
       }
       public String getName() {
              return name;
       }
       public void setName(String name) {
              this.name = name;
       }
       public int getEmployeeId() {
              return employeeId;
       }
       public void setEmployeeId(int employeeId) {
              this.employeeId = employeeId;
       }
        public int compareTo(Object obj) {
              emplyee emp=(emplyee)obj;
             return this.name.compareTo(emp.getName());
       }
       /*@Override
       public int compareTo(Object obj) {
              emplyee emp=(emplyee)obj;
             return Integer.toString(this.employeeId).compareTo(Integer.toString(emp.getEmployeeId()));
       }*/
}
public class comparableTest {
       public static void main(String [] args)
       {
              TreeSet ts= new TreeSet();
              ts.add(new emplyee("Humud",800));
              ts.add(new emplyee("rajeev",600));
              ts.add(new emplyee("aalu",100));
              //ts.add("rajeev");
              //ts.add("Aalu");
              Iterator it =ts.iterator();
              while(it.hasNext())
              {
                     emplyee em=(emplyee)it.next();
                     System.out.println("SOrted -------"+em.getName());
              }
       }
}


2. By Using Comparator interface you have to write to your sorting logic outside the
   class . so when you want change the sorting logic not need to change logic inside the emplyee class

import java.util.Comparator;
import java.util.Iterator;
import java.util.TreeSet;

class nameComparator implements Comparator
{
       @Override
       public int compare(Object obj1, Object obj2) {
              emplyee emp=(emplyee)obj1;
              emplyee emp2=(emplyee)obj2;
              return Integer.toString(emp.employeeId).compareTo(Integer.toString(emp2.getEmployeeId()));
       }
}
class emplyeeIdComparator implements Comparator
{
       @Override
       public int compare(Object obj1, Object obj2) {
              emplyee emp=(emplyee)obj1;
              emplyee emp2=(emplyee)obj2;
              return emp.getName().compareTo(emp2.getName());
       }
}
class emplyee
{
       String name;
       int employeeId;
       public emplyee(String name, int employeeId )
       {
              this.name=name;
              this.employeeId=employeeId;

       }
       public String getName() {
              return name;
       }
       public void setName(String name) {
              this.name = name;
       }
       public int getEmployeeId() {
              return employeeId;
       }
       public void setEmployeeId(int employeeId) {
              this.employeeId = employeeId;
       }
       /*@Override
       public int compareTo(Object obj) {
              emplyee emp=(emplyee)obj;
              return Integer.toString(this.employeeId).compareTo(Integer.toString(emp.getEmployeeId()));
       }*/
}
public class comparableTest {
       public static void main(String [] args)
       {
              TreeSet ts= new TreeSet(new emplyeeIdComparator());
              ts.add(new emplyee("Rumud",800));
              ts.add(new emplyee("rajeev",600));
              ts.add(new emplyee("aalu",100));
              //ts.add("rajeev");
              //ts.add("Aalu");
              Iterator it =ts.iterator();
              while(it.hasNext())
              {
                     emplyee em=(emplyee)it.next();
                     System.out.println("SOrted -------"+em.getName());
              }

       }
}



How To create Cron Job in Hybris e-commerce suite | Interview Question on Hybris 4.8 e-commerce suite

Below given step by step to create hybris cron job

1. create a class MyFirstCronJob as below

/**
*
 */
package se.hm.core.cronjob;

import de.hybris.platform.cronjob.enums.CronJobResult;
import de.hybris.platform.cronjob.enums.CronJobStatus;
import de.hybris.platform.cronjob.model.CronJobModel;
import de.hybris.platform.servicelayer.cronjob.AbstractJobPerformable;
import de.hybris.platform.servicelayer.cronjob.PerformResult;


/**
* @author
 *
 */
public class TestCronJob extends AbstractJobPerformable
{

                /*
                * (non-Javadoc)
                *
                 * @see
                * de.hybris.platform.servicelayer.cronjob.AbstractJobPerformable#perform(de.hybris.platform.cronjob.model.CronJobModel
                * )
                */
                private String exportDir;

                /**
                * @return the exportDir
                */
                public String getExportDir()
                {
                                return exportDir;
                }

                /**
                * @param exportDir
                *           the exportDir to set
                */
                public void setExportDir(final String exportDir)
                {
                                this.exportDir = exportDir;
                }



                @Override
                public PerformResult perform(final CronJobModel arg0)
                {
                                System.out.printlnTestCronJob Job Started");


                                System.out.printlnTestCronJob Job Finished");
                                return new PerformResult(CronJobResult.SUCCESS, CronJobStatus.FINISHED);
                }

}


2. After create  KumudJob.java register this cron job in xml as below

<bean id="myFirstCrobJob" class="se.hm.core.cronjob.TestCronJob" scope="tenant"
                                  parent="abstractJobPerformable">
                                  <property name="exportDir" ref="exportDataBaseDirectory"/>
                </bean>

3. Now Run UPDATE Hybris

4. After UPDATE your created Cron job  KumudJob  will show in list of cronjob in Hmc where you can schedule .