Tuesday 28 August 2012

Details about Beans Present in WCS..

A data bean is a java bean that is used within a jsp page to provide dynamic contect to the jsp page. A data bean normally provides a simple representaion of a WebSphere Commerce Entity bean.
There are 3 types of data beans:
1.Smart databean.
2.Command databean
3. Input data bean

  • Smart data bean: When a smart data bean is activated, the data bean manager invokes the data bean's populate method. Using the populate method, the data bean can retrieve all attributes, except attributes from associated objects.
  • Command data bean: A data bean implementing the CommandDataBean interface retrieves data from a data bean command. A data bean of this type is a lightweight object; it relies on a data bean command to populate its data. The data bean must implement the getCommandInterfaceName() method which returns the interface name of the data bean command.
  • Input data bean: A data bean implementing the InputDataBean interface retrieves data from the URL parameters or attributes set by the view.
Attributes defined in this interface can be used as primary key fields to fetch additional data. When a JSP page is invoked, the generated JSP servlet code populates all the attributes that match the URL parameters, and then activates the data bean by passing the data bean to the data bean manager. The data bean manager then invokes the data bean's setRequestProperties() method (as defined by the com.ibm.commerce.InputDataBean interface) to pass all the attributes set by the view.
Access Bean
WCS commands interact with access beans rather than directly with the entity beans. Access beans behave like Java beans, & hide all enterprize bean-specific programming interfaces from the client.
Types of Access beans are:
1. Copy Helper methods.
2. Finder methods.
3. EJB methods.
There are 2 types of Copy Helper methods:
1. refreshCopyHelper()
2. commitCopyHelper()
refreshCopyHelper(): refresh copy helper is treated as "find for update” and it locks that particular row unless or until you are done with entire transaction. So you read something with refreshcopyHelper and you keep doing n no of things and when you are finally done then only these locks are released.
refreshCopyHelper reads the database to update the access bean.
commitCopyHelper(): commitCopyHelper() takes the current state of the access bean and updates the database with it.
Updates the database with the contents of the access bean.

Entity Bean: The persistence layer within the WebSphere Commerce architecture is implemented according to the EJB component architecture.
A small number of stateless session beans are used to handle intensive database operations, such as performing a sum of all the rows in a particular column. One advantage of using entity beans is that developers can utilize the EJB tools provided in WebSphere Commerce Developer. These tools allow developers to define Java objects and their database table mappings. The tools automatically generate the required persisters for the entity beans. Persisters are Java objects that persist Java fields to the database and populate Java fields with data from the database.

1 comment:

Solr settings and full indexing (Attribute task update)

SOLR is mainly used for : Indexing Querying    SOLR is a product of apache and having the inbuilt server named jeety. Mainly the ...