Mega Menu

Tuesday, January 15, 2013

WCS Users | Overriding isGeneric() Method | Controller Command

Default value returned by the method isGeneric () is false.

If a controller command can be executed by a generic user, this method needs to be overriden to return true.
When the value returned by isGeneric () is false, a generic user will not be able to execute it, instead a new Guest user id would be created and the command execution would complete successfully.

Importance of overriding this method :
To have the application perform better, it is always recommended to override this method to return false for all the commands that are not user specific/dependant.
Else (if not overriden), a new user is always created during the command execution, which may result in the larger DB size, in addition to an extra overhead of populating user bean objects for the command context.


Additional Info:

In the standard WebSphere Commerce implementation there are multiple types of users. These include generic, guest, and registered users. Within the grouping of registered users there are customers and administrators.
The generic user has a common user ID (-1002) that is used across the entire system. This common user ID supports general browsing on the site in a manner that minimizes system resource usage. It is more efficient to use this common user ID for general browsing, since the Web controller does not need to retrieve a user object for commands that can be invoked by the generic user.



No comments:

Post a Comment