Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

J2EE Applicability

 
jagadish babu
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A mock test question on J2EE Applicability:
"On XXXX site,people check the weather forecast. If the company can expect between 50-100 concurrent hits in to their site, which of the following Java based technologies may be best suited for their needs?
(a)Servlets and JSP for presentation with Java classes encapsulating all database access.
(b)Servlets and JSP for presentation and CMP Beans for retrieval.
(c)Servlets and JSP for presentation and Session Beans with DAO for retrieval.
(d) Applets for presentation and either Entity or Session Beans for retrieval.
(e)servlets and JSP for presentation and BMP Beans for retrieval.
I answered (b), but the answer said it was (a).
I dont understand why Java Classes has to be used for encapsulating all d/b access ?
I think (b) is right since EJB entity beans are used for concurrent d/b access, am I right ?
 
Paul Lester
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Greetings:
I have taken and passed the J2EE architect exam. It was a pretty difficult test, but fun nonetheless. Anyway, enough about me:
The reason that A) is the correct is answer is because typically you want to surround your database access logic with a DAO, or Data Access Object. Further, you don't want to introduce EJB into the architecture unless it is warranted (Transactions, Security, Concurrancy, etc.).
In this case, you want as much speed as possible and have no need to use Entity Beans. Entity beans are not required because you are not changing the underlying data and therefore have no need to implement any business logic. All of your accesses are going to be read-only and thus having the overhead of the EJB should be avoided. In this case, an EJB would be a bottleneck.
I hope that I've made things more clear. :-)
Paul
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic