Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
  • 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

HFSJ attributes and listeners question doubt

 
Ranch Hand
Posts: 90
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 256
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
pie sneak
Posts: 4727
Mac VI Editor Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
What are you doing in my house? Get 'em tiny ad!
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic