The main purpose of the use of managed bean in daily rdahmm portlet is to move the state change and color calculation process to a managed bean, so that the loading and response time of the portlet could be shorter.
The managed bean needs to do two things: (1) read information from the result xml file and create data structures to store the state change and data missing information for all stations; (2) given a specific date, calculate the proper color for every station based on these informations.
A normal way to do this is to keep one managed bean for each browser request, or each session, and this bean contains both the xml file loading and calculating function. On the other hand, since the loading and calculating process are all the same for every bean, we can just move these processes to a stand alone service, and leave the beans with an interface to the portlet; then the beans can call the service to do the calculation, and return the results to portlet. This way the xml file will be read just once, and there is only one copy of the state change and data missing information kept in the service entity.
We'll first try the normal way, and then switch to the latter. The beans have been completed, and we still need some adjustments to the portlet codes to start testing with managed beans.
Friday, March 7, 2008
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment