• 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
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Best Answer

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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???
 
Ranch Hand
Posts: 1855
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
An elephant? An actual elephant. Into the apartment. How is the floor still here. Hold this 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