Tuesday, December 21, 2010

Override isGeneric method in controller command

All commands try to create a new user object in the database, which in most cases is not required. To avoid loading of a user object we should override isGeneric method in the controller command and return a Boolean true. This will ensure that command will not end up spending time to create a user object, thus improving the performance of executing command..

Is the new command satisfying the following requirement.

- Command does not need to create a new user. (Ex: To View HomePage, ProductPage, search for product we don’t have to create user)
- Command does not access any user specific resources like Guest PII information or cart information. (Ex: ProductDisplay does not access users personal information, search doesn’t require to know the items in the cart)