Sunday, 31 July 2016

Difference Between String , StringBuilder And StringBuffer Classes With Example : Java
Today we are going to understand the difference between String , StringBuilder and StringBuffer . As you will find that there are minor differences between the above mentioned classes.

String

String is immutable  ( once created can not be changed )object  . The object created as a String is stored in the  Constant String Pool  . 
Every immutable object in Java is thread safe ,that implies String is also thread safe . String can not be used by two threads simultaneously.
String  once assigned can not be changed.

String  demo = " hello " ;
// The above object is stored in constant string pool and its value can not be modified.


demo="Bye" ;     //new "Bye" string is created in constant pool and referenced by the demo variable            
 // "hello" string still exists in string constant pool and its value is not overrided but we lost reference to the  "hello"string  

StringBuffer

StringBuffer is mutable means one can change the value of the object . The object created through StringBuffer is stored in the heap . StringBuffer  has the same methods as the StringBuilder , but each method in StringBuffer is synchronizedthat is StringBuffer is thread safe . 

Due to this it does not allow  two threads to simultaneously access the same method . Each method can be accessed by one thread at a time .

But being thread safe has disadvantages too as the performance of the StringBuffer hits due to thread safe property . Thus  StringBuilder is faster than the StringBuffer when calling the same methods of each class.

StringBuffer value can be changed , it means it can be assigned to the new value . Nowadays its a most common interview question ,the differences between the above classes .
String Buffer can be converted to the string by using 
toString() method.

StringBuffer demo1 = new StringBuffer("Hello") ;
// The above object stored in heap and its value can be changed .

demo1=new StringBuffer("Bye");
// Above statement is right as it modifies the value which is allowed in the StringBuffer

StringBuilder

StringBuilder  is same as the StringBuffer , that is it stores the object in heap and it can also be modified . The main difference between the StringBuffer and StringBuilder is that StringBuilder is also not thread safe. 
StringBuilder is fast as it is not thread safe .  


StringBuilder demo2= new StringBuilder("Hello");
// The above object too is stored in the heap and its value can be modified
demo2=new StringBuilder("Bye"); 
// Above statement is right as it modifies the value which is allowed in the StringBuilder


----------------------------------------------------------------------------------
                          String                    StringBuffer         StringBuilder
----------------------------------------------------------------------------------                 
Storage Area | Constant String Pool           Heap                       Heap 
Modifiable     |  No (immutable)            Yes( mutable )          Yes( mutable )
Thread Safe   |           Yes                                  Yes                              No
 Performance |         Fast                                Very slow                    Fast
-----------------------------------------------------------------------------------


Please mention in the comments in case you have any doubts related to the post: difference between string, stringbuffer  and stringbuilder.

Saturday, 23 July 2016

Hybris WCMS + Addon:


Accelerator Storefront – Based on Spring MVC framework
  • Model: represents and manages data
  • View: presents the model data
  • Controller: responds to user interaction to control mode state and presentation of the view.
The accelerator is based on view. The accelerator uses JSP for page rendering, JSP files are not used directly, but only as renderers. The JSP files are located under
${HYBRIS_BIN_DIR}/ext-template/yacceleratorstorefront/web/webroot/WEB-INF
Views:

  • The spring MVC controllers specify a view name
  • Spring is configured to look in ${HYBRIS_BIN_DIR}/ext-template/yacceleratorstorefront/web/webroot/WEB-INF/views

JSP Structure



JSP Construction




JSP Review







Friday, 15 July 2016

Jai Sri Ram
Today I started blogging on E-Commerce Domain Hybris. I'll post practical scenarios in the posts.

Welcome to My blog. Hope you will like it.

Welcome to my blog, I would like to take an opportunity to foresee a
beautiful relationship in visiting and getting the best out of this blogkeep-calm-and-write-somethign. We have a multiple and multi things to follow. Stay connect and Stay hungry for knowledge.







Hybris Commerce Development

Hybris Commerce Development is a SCRUM development practice with the Java-based services and applications using Java EE, Spring Framework, and RESTful Webservices. The new interface has changed a lot from the older versions. After the takeover by SAP so many things like licensing, learning and wiki accounts and downloadables have changed a lot.
  • Prerequisites
  • WCMS
    • HY mashups
    • CMS items hierarchy
    • Configure the data model of basestore website
    • Warehouse
    • Point of Sale and their relations
    • Create new and configure existing CMS restrictions
    • Evaluation of CMS restrictions
    • New CMS component types
  • Backoffice and Cockpit Modifications
    • HY mashups
    • Create a new Backoffice application
    • Widgets using the Cockpit NG framework
    • Introduce legacy cockpits modification into hybris accelerator
    • Dynamic forms
  • Commerce and Accelerator
    • HY mashups
    • Create a new Addon
    • OCC Webservice
    • Promotion
    • Order Splitting strategy
    • CMS Navigation bar
    • Configure accelerator based storefront and product converters
    • Extend payment commands and identify payment integration points
    • Internationalization and request handling in accelerator
    • Hot Folder transformation
  • Data Modeling
    • HY mashups
    • Model new data types and extend existing ones incl. localized attributes and enumerations
    • Configure indices and deployments
    • Identify how types are stored in database
    • Create advanced FlexibleSearch queries
    • Determine the consequences of using variants
    • Category variants
    • Classification attributes
  • Order Managment
    • HY mashups
    • Create and start a business process
    • Fulfillment process and subprocesses
    • Shopping cart handling incl. checkout scenarios
    • Identify features available in Assisted Service Module
    • Available Customer Service Operations in hYBRIS Commerce Suite
  • Search and Navigation
    • HY mashups
    • Create a new Solr index
    • Facet, Facet range
    • Solr topology
    • Configure autosuggestions
    • Keywords
    • Stopwords
    • Synonyms
    • hero products
    • boost rules
  • Platform Basics
    • HY mashups
    • Concept of System Initialization
    • Concept of System Update
    • Essential and Project data
    • Session handling
    • Extension structures
    • Configure platform start and change its build procedure
    • Identify caching behavior and model interceptor
    • How transactions work in Hybris Commerce Suite
  • Platform Features
    • HY mashups
    • How to use Events
    • Advanced features of ImpEx
    • Spring Context in Hybris Commerce Suite
    • How Cronjobs and cluster communication work
  • PCM Basics and Price Modeling
    • HY mashups
    • Price Calculation incl. PIQ_CALCULATE
    • Retrieval logic for Pricing
    • Model objects handling
    • Configure synchronization jobs
    • Create Workflow
  • User Management
    • HY mashups
    • Configure user rights and search restrictions
    • Switch user context in a given code
    • B2B hierarchy