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

JSP & Controller in class/sequence diagram

 
Dumitru Postoronca
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

1) In Cade's book, class diagram, the JSP files <<use>> the Controller class. I find this odd, as what actually happens is that the browser will issue a GET/POST request that will be mapped to a Controller that will execute the business logic and then dispatch to a JSP to render the HTML in response. I believe that the arrows should be in the opposite direction -- the Controller using the JSP files.

A similar issue is in the sequence diagram, where
(2) there is no actor such as the user/browser and
(3) the JSP is calling the Controller. As per my observation above, the browser request is getting mapped to a Controller. It's the browser invoking the Controller, not the JSP. The only way a JSP would be calling some business logic (during it's "render" phase) would be if the JSP uses custom tags, but this looks like the Dispatcher-to-View pattern, which is not intended for heavy-business-logic pages.

Anyone care to comment on these?

Thanks a lot.

 
Pratik Bhavsar
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would also like to get some answers on the questions posted above.
 
joy b chakravarty
Ranch Hand
Posts: 62
Hibernate Java Spring
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Valid doubts, i guess its just the way we look at things
as what actually happens is that the browser will issue a GET/POST request ...
there is no actor such as the user/browser...
the JSP is calling the Controller. As per my observation above, the browser request is getting mapped to a Controller...

yes the browser will issue the request but when? ... On some user action on the jsp page (first page). so this jsp page in turn "uses" the controller to display the next jsp page so you can consider the first jsp page to be responsible for your request (instead of a browser or a user).
 
Luay Abdulraheem
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear All,

In Cade's example, the first Sequence diagram begins with an actor, but the rest begin with JSPs. Is this valid ?
 
Krzysztof Koziol
Ranch Hand
Posts: 133
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Where did find an actor in the Sequence Diagram? In the Cade and Sheil example every SD start with a jsp page.
 
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
Krzysztof Koziol wrote:Where did find an actor in the Sequence Diagram? In the Cade and Sheil example every SD start with a jsp page.

Chapter 8. And there is a new thread for the actor question so please reply there.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic