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

Best Answer

 
arusha khan
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Following are the Q's:


How can storing session information in a Session Bean be more scalable over storing session information in HttpSession?
Choice 1

Session Beans can survive a server crash.
Choice 2

Session Beans can be activated/passivated.
Choice 3

Session Beans can use container managed persistence.
Choice 4

Session Beans can be used by multiple client threads.
Choice 5

HttpSession requires use of cookies or URL rewriting.



I think 5 and 3 are correct. which is a better ans?

===================================
What is the importance of using design patterns in J2EE applications?

1 Design patterns increase code duplication.
2 Design patterns make applications architectually robust in the long-term.
3 Usage of design patterns is mandated by J2EE 1.4 specification for web and business logic tiers.
4 Design patterns reduce the amount of code developers would have to write.
5 Design patterns provide better compatibility with other application servers.

I think 4 but 2 is also good choice???
 
Darya Akbari
Ranch Hand
Posts: 1855
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by arusha khan:
Following are the Q's:


How can storing session information in a Session Bean be more scalable over storing session information in HttpSession?
Choice 1

Session Beans can survive a server crash.
Choice 2

Session Beans can be activated/passivated.
Choice 3

Session Beans can use container managed persistence.
Choice 4

Session Beans can be used by multiple client threads.
Choice 5

HttpSession requires use of cookies or URL rewriting.



I think 5 and 3 are correct. which is a better ans?


Why 3? CMP is for Entity Beans.
 
Darya Akbari
Ranch Hand
Posts: 1855
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by arusha khan:
What is the importance of using design patterns in J2EE applications?

1 Design patterns increase code duplication.
2 Design patterns make applications architectually robust in the long-term.
3 Usage of design patterns is mandated by J2EE 1.4 specification for web and business logic tiers.
4 Design patterns reduce the amount of code developers would have to write.
5 Design patterns provide better compatibility with other application servers.

I think 4 but 2 is also good choice???


I have my doubts with 4. Isn't it possible that with design patterns you even write more at the begin.
 
Gabriel Buheler
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Definitely the answer is 4 and 2.

Choice 1: is not talking about scalability, that is fail over, and that depends on the implementation of the application server. Something not defined in specification.

Choice 3: does not exist with Session beans.
Choice 5: NA

Then the benefits of activate/passivate is that the EJB container would know when it performs these operations to be more efficient, when holding several instances.

And remember one of the benefits of EJB's are that they are thread-safe.

Gabriel
 
Manish S Malhotra
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ques 1:
Ans: Option 2.

Because using DP wont assure to reduce the amount of code which a developers write.

Ques2:
Ans: 2 & 4 as the Gabriel said is pretty correct.

As support of client from multi threads means scalable, and passivation and activation process is also to save the resources of the container to serve to more users / clients which is also related to scalability.

Regards,
Manish
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic