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

SCEA Part1 EPractize Labs - some answer seems incorrect

 
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Q: you have an application that requires high performance and high scalability without transactional requirements.
which JEE technology would you choose?

My Answer: Web centric Design

EPractize Ans: Stateless session bean with dao.

I cant understand that if transaction or any container service not required then why my answer is shown as incorrect?
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The question doesn't say it is a web application. You assumed that.
 
MyExamCloud Support
Posts: 264
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The application requires high performance and scalability, hence it makes sense to use stateless session bean.

Scalability - Because stateless session beans are able to service multiple clients, they tend to be more scalable when applications have a large number of clients. When compared to stateful session beans, stateless session beans usually require less instantiation.

Performance - An EJB container will never move a stateless session bean from RAM out to a secondary storage, which it may do with a stateful session bean; therefore, stateless session beans may offer greater performance than stateful session beans.

Good luck for your preparation !!!
 
Nimit Shah
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ganesh,

Thanks for your reply.

As an architect you have to make the best choice out of few available correct choices.

In this case, agreed that web application requirement is not mentioned, but neither EJB nor business ties mentioned.
As an architect the cost effective, scalable, and performat design web centric design also qualify.

Can you please explain How come web application is incorrect answer or inferior choice for the given case.

NOTE: it is clearly mentioned that transaction service is not required.
 
Ganesan Ponnusamy
MyExamCloud Support
Posts: 264
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Nimit Shah,

Web-centric design may not scale as compared to EJB based applications.

Experiment the following test cases in both designs (Web centric and EJB) and see the difference:

>> 100 concurrent access of a simple data access
>> 100 concurrent access of a simple data update.

You may use Grinder to load test a web application.

You will definitely get high performance and scalability in EJB design.

The following contents are taken from http://java.sun.com/blueprints/guidelines/designing_enterprise_applications_2e/app-arch/app-arch4.html

As a result, unless special efforts are taken, Web-centric design does not scale well with increasing software complexity.

There is a trade-off between the two approaches. The Web-centric approach can enable a quick start for small applications with few transactional needs, while the EJB-centric approach is better for building a large-scale enterprise application where code and performance scalability are prime factors. The Web-centric approach, while more prevalent, has limitations for building large-scale, complex applications. Applications built with a Web-centric approach can rapidly become too complex and difficult to maintain.

Thanks
 
Nimit Shah
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ganesan,

Thanks for your reply and extended research.

You referred to the below para in sun's documentation

"In a Web-centric design, Web tier components using container services such as the JDBC API can communicate directly with the enterprise information system resources that hold application data. In this approach, Web tier components are responsible for almost all of the application functionality. They handle dynamic content generation, content presentation, and user requests. They must implement core application functionality, such as order processing and enforcing the application's business rules. Finally, the Web tier components must also manage transactions, such as by using JTA, and connection pooling for data access. Because it must handle so many functions, Web-centric application software can easily become monolithic. As a result, unless special efforts are taken, it does not scale well with increasing software complexity."

When we consider web centric approach do we mean that services such as
- connection pool not available ? (With tomcat we can have connection pooling within container)

It mentions that the the web centric approach does not scale well when complexity grows. But, for the given question where transaction is not required what approach is better?
 
Ganesan Ponnusamy
MyExamCloud Support
Posts: 264
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear Nimit Shah ,

Please find my answers:

When we consider web centric approach do we mean that services such as
- connection pool not available ? (With tomcat we can have connection pooling within container)


No, it is available. Note that with continuous improvements and changes in Java EE APIs, latest web container also supports running minimal EJB services.

Java EE 6 web container supports running EJB directly in WAR file without creating EJB jars.


It mentions that the the web centric approach does not scale well when complexity grows. But, for the given question where transaction is not required what approach is better?


Though the requirement does not require transaction the application need to scale, hence stateless session bean is the right choice.

I developed many Java EE application for our organization and the decision to use EJB or NOT is fully depends on scalability needs, of-course we also need to consider transaction.

Most of my intranet applications (low scalability) are web-centric and customer based applications (high scalability) are EJB based.

Take a look on the following applications:

http://www.123testlab.com - EJB Centric design
(Online exam application. We tested to support 2000 concurrent users and it can scale to any number of concurrent users.)

http://www.123testlab.com/gift - EJB Centric design
(Gift center application. We tested to support 500 concurrent users and it can scale to any number of concurrent users)

http://www.123testlab.com:8080/epl - Web Centric design
(Our project management tool. Since our employees count is very minimal (limited number of concurrent access) we decided to use web centric design.)

http://www.123testlab.com/epllic - EJB Centric design
(Our license management tool.)

Good luck for your preparation !!!
reply
    Bookmark Topic Watch Topic
  • New Topic