Gift Card and Voucher Changes in Hybris Multi-channel suite 4.8 Accelerator | Hybris 4.8 tutorial

Gift Card /Voucher Changes in Hybris Accelerator:
1.    Voucher Façade creation
•    Defining Voucher interface: Voucher interface has been defined comprising following methods
a) String redeemVoucher(String voucherCode)

b) Boolean checkVoucherCode(String voucherCode)
•    Implementing Voucher methods: Voucher methods have been implemented using CartVoucherFacadeImpl class. RedeemVoucher methods redeems voucher for given voucher code & checkvoucherCode methods check for the validity of the voucher code.
•    Spring configuration for VoucherFacade: below is the spring configuration for voucherFacade
    <!-- Added by for Voucher(Gift card) changes -->
    <bean id="cartVoucherFacade" class="se.KM.facades.voucher.impl.CartVoucherFacadeImpl" scope="tenant"/>
   
2.    Store pickup changes: Following classes have been create/updated for store pickup
a.    KMUserFacade
b.    KMAddressService
c.    KMAddressServiceImpl
d.    KMAddressDao
e.    KMAddressDaoImpl
f.    KMCustomerReviewDaoImpl
g.    MultiStepCheckoutController
h.    GiftVoucherValidator
i.    deliveryAddressDetails.tag
j.    deliveryAddressSelector.tag
k.    header.tag
l.    deliveryAddressDetails.tag
m.    deliveryAddressSelector.tag
n.    /KMstorestorefront/web/webroot/WEB-INF/tags/mobile/common/header/header.tag

•    Spring configuration for store pickup: below are the spring file changes in file KMstorecore-spring-integration.xml
    <!-- Changes done By Sachin  -->
    <!--H&M Address Service -->
    <bean id="KMAddressService" class="se.KM.core.servicelayer.user.impl.KMAddressServiceImpl" parent="abstractBusinessService" scope="tenant">
        <property name="addressDao" ref="addressDao"/>       
    </bean>
   
    <!--H&M Address DAO -->
    <alias alias="addressDao" name="KMAddressDaoImpl"/>   
    <bean id="KMAddressDaoImpl" class="se.KM.core.servicelayer.user.daos.impl.KMAddressDaoImpl" scope="tenant"/>
   
    <!--H&M Checkout Facade -->
    <!-- <alias alias="checkoutFacade" name="KMCheckoutFacade"/>
    <bean id="KMCheckoutFacade" class="se.KM.core.commercefacades.order.impl.KMCheckoutFacade" scope="tenant" parent="defaultCheckoutFacade">
        <property name="KMAddressService" ref="KMAddressService"/>
    </bean> -->
   
    <!--H&M User Facade -->
    <alias alias="userFacade" name="KMUserFacade"/>
    <bean id="KMUserFacade" class="se.KM.core.commercefacades.user.impl.KMUserFacade" scope="tenant" parent="defaultUserFacade">
        <property name="KMAddressService" ref="KMAddressService" />
    </bean>
    <!-- H&M customer review DAO- Added by SACHIN -->
    <alias alias="customerReviewDao" name="KMCustomerReviewDao"/>
    <bean id="KMCustomerReviewDao" class="se.KM.core.servicelayer.user.daos.impl.KMCustomerReviewDaoImpl" parent="defaultCustomerReviewDao" scope="tenant"/>


3.    Promotion “KM Buy X get A% discount on X” changes: Following changes have been made while defining this promotion
•    Creating Promotion:  changes have been made in /KMstorecore/resources/KMstorecore-items.xml file
            <itemtype code="KMProductBOGOFPromotion"
                extends="ProductBOGOFPromotion"
                jaloclass="se.KM.core.promotions.jalo.KMProductBOGOFPromotion"
                autocreate="true"
                generate="true" >
                <attributes>
                    <attribute
                        qualifier="percentageDiscount"
                        autocreate="true"
                        type="java.lang.Double">
                        <defaultvalue>Double.valueOf(0.0D)</defaultvalue>
                        <description>Discount on product Y</description>
                        <modifiers read="true" write="true" />
                        <persistence type="property"/>
                    </attribute>
                </attributes>
            </itemtype>
•    KMc changes: following changes have been made in KMc.xml file for front end
    <!-- Configuration for extension KMstorecore -->
    <type name="KMProductBOGOFPromotion" mode="append">
        <organizer>
            <editor mode="append">
                <tab name="tab.promotion.properties" mode="append">
                    <section name="section.promotion.products" mode="append">
                        <columnlayout leftwidth="370">
                            <row>
                                <attribute name="percentageDiscount" labelwidth="100" />
                                <text name="text.KMproductbogofpromotion.percentageDiscount" />
                            </row>
                        </columnlayout>
                    </section>
                </tab>
            </editor>
        </organizer>
    </type>
•    Changes in Jalo class: following changes have been made in jalo class in order to invoke custom evaluate method
/KMstorecore/src/se/KM/core/promotions/jalo/KMProductBOGOFPromotion.java
Following methods need to be override while defining a new promotion
    @Override
    public List<PromotionResult> evaluate(final SessionContext ctx, final PromotionEvaluationContext promoContext)
    @Override
    public String getResultDescription(final SessionContext ctx, final PromotionResult promotionResult, final Locale locale)

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.