Make it Stick (exercise on page 13) "There isn't one perfect right answer for these..."
* Booking a ticket - stateless session * A bank account - entity * Searching a product DB - stateless session * Dating service match-ups - stateful session * Receiving submitted expense reports... - message-driven * Online expert diagnosis - stateless session * The books in a library - entity
I agree ... somewhat. I came up with entity for the product database (when they talked about each one representing a row in the db).
I also thought the online expert diagnosis would be stateful not stateless. With diagnosis you have a series of questions that seem to drill down to the eventual diagnosis. (i.e., do you have a fever - if so is there a cough with it, if so is it productive, etc...).
posted 15 years ago
disregard my statement about the product db ... i just saw my flaw in that logic.
posted 15 years ago
Leave it to me to forget something that we talked about last week ...
For those of you like me who did forget about this, there is a bug that interacts with the RI Server in the Chapter One example.
If you rename your getAdvice() method in the AdviceBean to something else (like getTheMessage()) it will work (don't forget to change the Advice interface as well.).
That's a good point about the diagnosis program, Joe.
My original thinking was that the program doesn't need to know WHO you are (ie shopping cart) so it is stateless. But the point is it still needs to remember the transaction, even if your identity is irrelevant.
Originally posted by Marc Peabody: The Head First book is our main resource and we'll create a new thread topic for each chapter as we progress. This will continue at the rate of 2 chapters per week which will take us to the end of March 2005.
We hope that future SCBCD participants will benefit from these threads. Please cooperate by keeping topics within the chapter's test objectives.
Interesting preparatory style...
I hope that it will be effective to those who are preparing for the exam during the period... I do hope other forums will have some study group like this as well....
Co-author of SCMAD Exam Guide, Author of JMADPlus SCJP1.2, CCNA, SCWCD1.4, SCBCD1.3, SCMAD1.0, SCJA1.0, SCJP6.0
I got the same answers as Marc on the Page 13 exercise.
I guess you already figured this out Joe, but to clarify the answer for "Searching a product DB".... the keyword here is Searching, i.e. an action, thus a session bean. As opposed to the DB, a noun, which would be an entity.
Interesting point about the diagnosis program, Joe. I was thinking of it like WebMD. You find a symptom or disease or whatever, click on it, and it gives you a page of information and it's done, which would be stateless. Yet if it was more in-depth like you describe, it seems it would need to be stateful. How did others interpret the BRIEF description of this online diagnosis app?
I found that I had a lot of trouble deciding between Message and Stateless Session, however. I'm not entirely sure why those two were particularly hard to distinguish.
posted 15 years ago
Page 22 Brain Power Exercise "... Brainstorm a way (there may be more than one) in which you can handle the requirements of the Advice Guy bean...."
The only thing I could think of was to make a separate interface that has the methods used by both Advice and AdviceBean (this new interface does not extend the EJBObject interface). Advice and AdviceBean can both use this new interface. Then, Advice.java can also extend the EJBObject interface.
Originally posted by gayle craig: Page 22 Brain Power Exercise The only thing I could think of was to make a separate interface that has the methods used by both Advice and AdviceBean (this new interface does not extend the EJBObject interface). Advice and AdviceBean can both use this new interface. Then, Advice.java can also extend the EJBObject interface.
It sounds like you're saying that Advice would extend both the new interface and the EJBObject interface, which is not legal in most states (except maybe Alaska and Hawaii). Unfortunately I haven't come up with anything better...