Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HFSJ attributes and listeners question doubt

 
Adam Czysciak
Ranch Hand
Posts: 90
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Page 215, question 2:

Which statements about ServletContext initialization parameters are true?
A. They should be used for data that changes rarely.

This is one of the correct answers. It's a bit unclear for me (or, I'd rather say, it can be understood in two different ways).

As we know, init parameters are read-only Strings, so these can't change during application lifecycle *at all*. Therefore this option is incorrect, right? It would be correct for ServletContext attributes. But, now comes the second way of understanding the question... these init parameters may be changed in deployment descriptor, therefore I agree - these are changed very rarely (like the sample admin's email), but *only* between deployments.

I think there should be some more information added to this question, maybe a good item to add to errata.
 
Gaurav Gambhir
Ranch Hand
Posts: 256
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First way
init parameters are read-only Strings, so these can't change during application lifecycle


Closely match to option A,so that we can put them direcly as context-param


Second way of understanding the question... these init parameters may be changed in deployment descriptor, therefore I agree - these are changed very rarely


Also refers to option A is right.
[ June 21, 2006: Message edited by: Gaurav Gambhir ]
 
Adam Czysciak
Ranch Hand
Posts: 90
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First way
"init parameters are read-only Strings, so these can't change during application lifecycle"
Closely match to option A,so that we can put them direcly as context-param

Why does it match? Does 'rare' changing include 'no changing'? For me, writing about data that changes rarely means that data changes at least once. But context-param's can't be changed in other way then modifying DD, so for first case option A is incorrect.

I agree about second way.
[ June 22, 2006: Message edited by: Adam Czysciak ]
 
Marc Peabody
pie sneak
Sheriff
Posts: 4727
Mac Ruby VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Adam Czysciak:
Why does it match? Does 'rare' changing include 'no changing'? For me, writing about data that changes rarely means that data changes at least once.

Any time you're dealing with deployment descriptors (and answering exam questions) you need to step outside of the programmer's paradigm and assume that the question is being asked at a higher level.

I do agree that the question can be misleading to a programmer, but the wording in HFSJ doesn't bother me so much because the actual SCWCD exam likely would word it the same way. What's more is that the SCBCD, being so DD-oriented, is loaded with questions worded much like this.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic