Java Mailing List Archive

http://www.junlu.com/

Google
Google
Mailing List
Home
Forum Home
JBoss - Java Application Server
Struts - A MVC web framework
Tomcat - JSP/Servlet container
iText - An open source PDF Java Library
JDOM - JDOM XML Parser
J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition
J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog
Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology
JSP - A mailing list about Java Server Pages specification and reference
Struts & Hibernate
Subjects
JSP editor plugin for eclipse ?
org apache jasper JasperException: Unable to compile class for JSP
Tomcat: Connection reset by peer: socket write error
Cannot retrieve definition for form bean null
Struts Tiles Tutorial (free Struts training)
Where do I download Tomcat 4 0 6?
Data Access Object (DAO) pattern, example DAO 's
Where to download Tomcat v 4 1 24 from?
Tomcat 5 0 16 Requested resource not available
Oracle Connection Pooling in 3 2 2
Servlet : Session invalidate
Servlet action is currently unavailable
Tomcat/Struts Unicode Encoding/Decoding problems
Tomcat and webapplication specific java library path
Running a Simple JMS Example
Mapping in workers2 properties
org apache jasper JasperException
Cannot find message resources under key org apache struts action
   MESSAGE
problem with html:text bean throwing exception
Cannot find message resources under key org apache struts action MESSAGE
invalid direct reference problem with solution
Tool for jsp debug Try Sysdeo Eclipse Plugin
Tomcat 5 Cannot load JDBC driver class 'null ' SQL state: null
weblogic ejbc
java properties file
Jboss 3 2 3 Coyote Can 't re
Tomcat 5, Apache2 and mod jk2 integration problem
JBoss example problem new to J2EE
url string for connecting jboss to oracle
Value attribute of <html:checkbox
javax servlet ServletException: BeanUtils populate
HTTP Status 404 The requested resource is not available
5 0 18: Windows XP Pro vs Windows 2000
 
2 simple eval/test questions

2 simple eval/test questions

2003-07-31       - By Sam Fancourt

 Back
Reply:     1     2     3     4     5  

Q1: The answer is B
- See the extracted text from the Java Tutorial pasted below (or read State
Management Modes in the book).
Q2: The answer is D
- A factory pattern is used to create objects, ie: (from the J2EE Tutorial
again): "the purpose of the home interface is to define the create methods
that a remote client may invoke."
You can also refer to the GoF definition of a Factory "Provide an interface
for creating families of related or dependant objects without specifying
their concrete classes"


Sam :-)


Stateful Session Beans
The state of an object consists of the values of its instance variables. In
a stateful
session bean, the instance variables represent the state of a unique
client-bean
session. Because the client interacts ("talks") with its bean, this state is
often
called the conversational state.
The state is retained for the duration of the client-bean session. If the
client
removes the bean or terminates, the session ends and the state disappears.
This
transient nature of the state is not a problem, however, because when the
conversation
between the client and the bean ends there is no need to retain the state.
Stateless Session Beans
A stateless session bean does not maintain a conversational state for a
particular
client. When a client invokes the method of a stateless bean, the bean's
instance
variables may contain a state, but only for the duration of the invocation.
When
the method is finished, the state is no longer retained. Except during
method
invocation, all instances of a stateless bean are equivalent, allowing the
EJB container
to assign an instance to any client.
Because stateless session beans can support multiple clients, they can offer
better
scalability for applications that require large numbers of clients.
Typically, an
application requires fewer stateless session beans than stateful session
beans to
support the same number of clients.
At times, the EJB container may write a stateful session bean to secondary
storage.
However, stateless session beans are never written to secondary storage.
Therefore, stateless beans may offer better performance than stateful beans.




-- --Original Message-- --
From: Ivy Se [mailto:ivy12see@(protected)]
Sent: Thursday, July 31, 2003 4:10
To: J2EEPATTERNS-INTEREST@(protected)
Subject: 2 simple eval/test questions


Hi guys,

I've got 2 simple self eval quesion which I'm not sure
of the answers. Can you guys help, please

Q1. Which statement is true about statefull session
beans, but is NOT true about stateless session beans

A. State can be cached but is not representative of
the client state

B. State can be cached but is representative of client
state

C. State is persistent

D. State is cached first, then persisted.


Q2. Which pattern is used by the Home interface of an
EJB

A. Proxy

B. Decorator

C. Mediator

D. Factory

=====
Thank you.

Ivy Se

====================================================================
Community Web Site (Core J2EE Patterns Catalog - Online Version):
http://java.sun.com/blueprints/corej2eepatterns
Getting Started (Beta Version):
http://developer.java.sun.com/developer/technicalArticles/J2EE/patterns/
Get the book:
http://www.amazon.com/exec/obidos/ASIN/0130648841/corej2eepatte-20 (See http://tte-20.ora-code.com)
List Archive:
http://archives.java.sun.com/archives/j2eepatterns-interest.html
Unsubscribing:
email "signoff J2EEPATTERNS-INTEREST" to listserv@(protected)

====================================================================
Community Web Site (Core J2EE Patterns Catalog - Online Version):
http://java.sun.com/blueprints/corej2eepatterns
Getting Started (Beta Version):
http://developer.java.sun.com/developer/technicalArticles/J2EE/patterns/
Get the book:
http://www.amazon.com/exec/obidos/ASIN/0130648841/corej2eepatte-20 (See http://tte-20.ora-code.com)
List Archive:
http://archives.java.sun.com/archives/j2eepatterns-interest.html
Unsubscribing:
email "signoff J2EEPATTERNS-INTEREST" to listserv@(protected)



©2008 junlu.com - Jax Systems, LLC, U.S.A.