• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Doubts about sequence diagram in book by Cade and Roberts

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am having some doubts about the way sequence diagrams are drawn in the book by Cade and Roberts. I have searched this forum for previous posts with similar questions but I haven't found any which surprises me a lot. I am wondering whether I am overlooking something. I am interested in your views on this subject.

For example figure 8-10 (Browse Catalog) suggests that CatalogDAO sends a message catalogVO (i.e. invokes a method catalogVO) to SearchProcessor. I would think that catalogVO is merely returned to SearchProcessor together with the flow of control from the message getCategories. Callbacks are unlikely.

Basically I think that the diagram is WRONG on this point, but I wonder why I haven't seen any posts on this. Any ideas?

Regards, Wen
 
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Wen,

I think the sequence diagram is correct if you see it like this:
getcategories creates a Collection with references to the catalogVo's

I think the collection is returned implicitely, but you
have to return the VO explicitely .
========
I have seen an example of a sequence diagram of a cash withdrawal system.
Where the money/cash was also returned explicitely.
================
Further more, I do think there are a lot of parallels between the example in Cade's guide and the sun assignment. what do you think?

Josep
 
Wen Hu
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I think that if the collection is returned the catalogVO's are returned with it. It's kind of a round-about way to use a callback function.

It is even worse for CatalogController. To me it seems there is a very tight coupling between ProductPageJSP and CatalogController because they are sending messages to each other back and forth. I think it is wrong for the ProductPageJSP to be acquainted with the controller and to be even sending messages to it!

The CatalogController only needs to put the catalogVO's in request scope for the ProductPageJSP to directly access them by way of tags.

Regards, Wen
 
Josep Andreas
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Wen,

I agree with you, but displaying a collection this way seems to
be common practise:

maybe this page will explain something more:
http://www.informit.com/articles/article.asp?p=29582&seqNum=2
and look for the image:
http://www.informit.com/content/images/art_palmer4_gettingdynamic/elementLinks/palmer4_fig2.gif

With respect to the binding between the JSP and the controller:
You are right, but this is a consequence of the solution that was
chosen in Cade's guide. (the jsp communicates with the servlet controller)
You might avoid this by using the WAF framework and have the http requests
directed to the Controller directly:
http://java.sun.com/blueprints/guidelines/designing_enterprise_applications_2e/web-tier/web-tier5.html

have you finished your class diagram yet? Have you based this also on Cade's guide?

regards,
J
 
Josep Andreas
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
From the other threads I read, it is not necessary to use WAF, in order have a high score..... So my advise would be: Keep it simple, go with cade's guide
 
Wen Hu
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Joseph,

Thanks for you input. The figure you mentioned makes perfect sense to me. I might have modelled it differently, but I understand what the author of the sequence diagram is communicating.

I don't have any problem with the "syntax" of figure 8-10, it's the semantics. The responsibilities of the controller don't make sense to me, i.e. I even think they are depicted wrong in the diagram.

I had already made up my mind about the wrongness of the diagram. I was just wondering why nobody else has posted anything of the kind. Even now I seem to be the only one having doubts about the validity of the (semantics of the) diagram.

For example: the diagram suggests that there is a method 'setCatalogVO' and 'getProducts' for CatalogController, and that there is a method 'setCatalogVO' (!) for ProductPageJSP. Also, you start to wonder where ProductPageJSP gets it reference to CatalogController from. I would think the same way that the catalogVO's could have been passed. With regard to my remark about tight coupling, in terms of MVC it seems that the View needs to go through the Controller in order to access the Model.

I already intended to keep it simple. Cade's book is very useful to give a sense of the scope of the exam. The diagrams show at most a very high level of design. Therefore, I do not intend to use any framework, only some (obligatory) high-level J2EE design patterns such as Front Controller. IMO the examiners are mostly (only?) interested in meeting the requirements AS GIVEN and the quality of service. I don't think it is necessary to elaborate on the use cases unless really necessary in order to meet the original intentions (whatever those may be --> assumptions seem to be unavoidable).

Regards, Wen
 
Josep Andreas
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Another observation about the 'Browse catalog' diagram in cade's Guide (8-10).
IMO the complete dataset (categories, products, manufactures) is
selected from the Content Management system and then stored on the session...
Does anybody have some other ideas about this?
If this is true, the httpsession should be visible in the sequence diagram.
thanks.
J
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic