• 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
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

SingleThreadModel:JWebPlus

 
Ranch Hand
Posts: 782
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Question ID :1000056221780
A servlet implements MultiThreadModel interface. The servlet container may run multiple threads on its methods.
ANS: true
EXPLANATION By JWebPlus:
MultiThreadModel is not a standard interface. It may be a user defined interface and in that case, the given statement is correct.
Well, i think its totally non-sense question!.And hope that these types of question will not be asked by SUN.

What do U think?
Bye.
Viki.
 
Ranch Hand
Posts: 136
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think it is a perfectly valid question. If one doesn't know the basics, it is indeed very tempting to think that MultiThreadModel is a standard interface (just like SingleThreadModel).
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I think it is a perfectly valid question. If one doesn't know the basics, it is indeed very tempting to think that MultiThreadModel is a standard interface (just like SingleThreadModel).


Exactly, now if the question said it implements MultiThreadModel and SingeThreadModel, then it would be false
Mark
 
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I ve seen the same question about SingleThreadedModel, that one is easy to miss!
[ February 28, 2002: Message edited by: Gennady Shapiro ]
 
Ranch Hand
Posts: 1873
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i'm with Viki. if they dont say that its a user defined interface and is expected 've methods doing appropriate things we cant be sure of things.
i agree that one must know that this is not a standard interface and so it must be a user defined but what about the interface definition??? if the question doesnt say anything about that we cant make any decision. just giving a name "MultiThreadModel" doesnt mean that it tries to do something the name suggest. it might just have a method call print() which does nothing substantial.
again, someone would argue that it is given that "it MAY do so and so..." in the question and its not "MUST" that was used so the question is valid but still i dont agree 'coz in that case there is no damn meaning in asking such question in SCWD exam as it is all about servlet/jsp api and their fundamentals. if this question is there on programmers exam then it is fine where its not ALL about api stuff only and includes fundamentals as well.
i strongly agree with viki.
regards
maulin.
 
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
question about SingleThreadedModel
You would see these on the javaranch mock also.
I posted them as typos in this forum earlier.
They are on our list of to do's. We will take care of them, please bear with us.
- satya.......we are not alone in this you know...atleast our mock exam is free.
 
Gennady Shapiro
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am totally missing Maulin's point on this. But this is totally unambigious question...the servlet container will not not dispatch mulpitle threads only on SingleThreadModel no matter what your MultiThreadModel may do. Perfectly clear to me.

P.S. UNless MultiThreadModel extends SingleThreadModel but this is really stupid
[ February 28, 2002: Message edited by: Gennady Shapiro ]
 
Maulin Vasavada
Ranch Hand
Posts: 1873
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi Gennady,
so u also agree that there is no relation to the metioning of MultiThreadModel interface in this question as server container only look at the SingleThreadModel interface if that is implemented.
then Viki's point is right- "its a non-sense question" as per quoted by him. isnt it?
regards,
maulin
 
Gennady Shapiro
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
if (myservlet instanceof SingleThreadModel) {
// single threaded access
} else {
// multi threaded access
}
MultiThreadedModel falls into 'else' category. Thats it. There is nothing difficult about it. Crystall clear.
 
Vikrama Sanjeeva
Ranch Hand
Posts: 782
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Jim Bertorelli:
I think it is a perfectly valid question. If one doesn't know the basics, it is indeed very tempting to think that MultiThreadModel is a standard interface (just like SingleThreadModel).


First decide that whether question want to ask basic's or IQ?.If they want to ask IQ, then totally valid question.And if they want to check basic's of threading then they must say that what is the nature of given MultiThreadModel, so that one can easily test his/her basic's about threading.Rather thinking that is there any MultiThreadModel in Servlets
Bye.
Viki.
[ March 01, 2002: Message edited by: Vikrama Sanjeeva ]
 
Enthuware Software Support
Posts: 4892
60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Even if full code (if any) of MultiThreadModel interface is given, your answer would still be the same.
The point is not in knowing MultiThreadModel. The point isin not confusing SingleThreadModel with any other similar sounding but fake interface.
If there were a question like: Which of the following interfaces must be implemented by a servlet to make sure that multiple threads are not run over its methods:
1. SingleThreadModel
2. SingleThreadedModel
3. NoThreadModel
4. MultiThreadModel
5. MultipleThreadModel
I don't think you would ask for the details of all the interfaces. There is no need to. All you need to know is one right name, which is SingleThreadModel.
 
Vikrama Sanjeeva
Ranch Hand
Posts: 782
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If there were 6th option given like this,
6:non of the above
Then i select this one.(which SUN want from its candidate).The reason is:B/C the servlet which i am going to develop must follow Servlet specificatio and API.And there is not MultiThreadModel in servlet specification & API as well.
And if the 6th option is not given then i will select 4th one.
I think Paul if u want to make the question right then I suggest you to give a scenario to the candidate.....Again I say decide what do u want to check.!
Bye.
Viki.
[ March 01, 2002: Message edited by: Vikrama Sanjeeva ]
 
Paul Anilprem
Enthuware Software Support
Posts: 4892
60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Vikrama Sanjeeva:
And if the 6th option is not given then i will select 4th one.


Beats me!
 
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Update on that question: I just took the JWebPlus mock exam and the answer to that question has been changed.
It's now false, and the given reason is that it will not compile because there is no such interface MultiThreadModel
Personally, I think the question is bogus as written since you're left wondering whether they're asking you to spot the invalid interface (which they *now* apparently are) or expecting you to assume that MultiThreadModel is some custom interface you got elsewhere and that it will compile -- too vague.
IMHO, of course.
 
Ranch Hand
Posts: 672
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think only if one of the answers was
it will not compile because there is no such interface MultiThreadModel.
Then it would be a good question. Otherwise I agree with other people: it is an ambiguous question.
 
Ranch Hand
Posts: 445
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hmmmmmmmmmm.......................
Do the objectives mention the MultiThreadModel?I guess to crack the SCWCD all that is needed r the specs & sticking to the objectives.
anyway it's a real silly Question....
 
Paul Anilprem
Enthuware Software Support
Posts: 4892
60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This question has been removed from the question bank
 
Politics n. Poly "many" + ticks "blood sucking insects". Tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic