Why Hybris deprecated Jalo layer?

Or Explain difference between Jalo layer and Service layer?

Hybris 4.3.0, deprecated the Jalo layer for item types. This means, that hybris discouraged the usage of Jalo classes to serve as utility methods for performing business logics.

Prior to service layer, Jalo classes used to have both data model logics, methods and also business logic methods.

<itemtype code=”PickingCenter”
autocreate=”true” generate=”true”>
<deployment table=”PICKING_CENTER” typecode=”22113″/>
<attributes>
           <attribute qualifier=”warehouseForFresh” type=”Warehouse”>
           <persistence type=”property” />
           <modifiers read=”true” write=”true” optional=”true” />
           <description>Warehouse for fresh items</description>
</attribute>
</attributes>
</itemtype>

A sample item type in items.xml

The build framework will generate below classed for this item type:

1) An abstract class : GeneratedPickingCenter –  This class is basically a data model class, which has getter/setter for accessing data model, like attributes of data model. 

3

 

2) PickingCenter.java

Non Abstract class : This class extends the Generated class, and can have other methods for accommodating business logic.

So what is the big deal?

1) Service layer comes with the idea of segregating business logic from data model. Service layer sits inside other extensions (not necessarily) and access data layer via DAOs.  This layer is much more flexible and loosely coupled with database.

2) Think of a scenario, where you are using a legacy code, you don’t have access to source code. Had it been all Jalo, How would you override a business logic? In service layer it is easy to override, since ever service is configured as a bean, which is more adaptable to spring MVC design pattern.

3) If there is a change in database design, you need not to change your service layer necessarily. This flexibility is not available in Jalo layers.

4) In Jalo, we use like below:                                                                                                VoucheManager vm = VoucherManager().getInstance();

In Service layer,                                                                                                          private VoucherService voucherService;

So we can inject any implementation of VoucherService in our custom code, but how do we do so in Jalo. We need to break into Jalo layers.

Source : Hybris Wiki