Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Usage of PreRenderViewEvent of JSF2.0 in Sequence Diagram

 
viv anand
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
currently I am doing scea part-2 assignment.

I am using javax.faces.event.PreRenderViewEvent system event (of JSF 2.0) to perform custom task like loading data before a JSF page is displayed. It is fired after view parameters have finished processing, but before the view is rendered.
Consider the following example:
In an imaginary use case it has been stated that once the user successfully logs in, the system will display the list of records retrieved from a db.
I have kept all the security related processing logic in the SecurityController (a managed bean) and record related processing logic in the RecordController (another managed bean). It helps to achieve better cohesion. Now before rendering RecordList.jsp which contains all the records, I will call retrieveAllRecord() method of RecordController with the help of PreRenderViewEvent.
If I don’t use this approach then I may need to call retrieveAllRecord() method from SecurityController which will be a bad design as it defeats the purpose of loose coupling.

For the aforesaid reason I am showing PreRenderViewEventListener as an Object in my Sequence Diagrams though it is a JSF 2.0 component and JSF 2.0 is a part of JEE6 spec. So the flow in Sequence Diagram will be SecurityController -->PreRenderViewEventListener -->RecordController --> PreRenderViewEventListener(Return flow) --> RecordList.jsp.

Please provide your opinion/suggestion regarding this.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35279
384
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's not wrong to show JEE components in your sequence diagram. Mine ends with the entity manager.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic