|
26 'A' has a
dependency with 'B' is best expressed by:
A Option a
B Option b
C Option c
D Option d
E Option e
F Options b and d
G Options d and e
Choice D is correct.
Option D shows a diagram with two packages A and B. Package A has a dependency
with Package B. Hence choice D is correct.
In option A, class A extends class B. Hence choice A is incorrect.
In option B, class A implements interface B. Hence choice B is incorrect.
In option C, class A has an association relationship with interface B. Hence
choice C is incorrect.
In option E, Package B has a dependency with Package A. Hence choice E is
incorrect.
Since options B and E are incorrect, choices F and G are incorrect.
27 Refer to
the following exhibit
From the following diagram it can be deduced that:
A Changes to classes in the
Customer package may only impact the Order package
B Changes to classes in the
Customer package will impact Order and OrderLine packages.
C Changes to the OrderLine
package will impact the Customer package
D Changes to the Customer
package will have no impact on the other two packages
Choice A is correct.
The package Order has a dependency with the package Customer. Hence any
changes in the Customer Package could impact the Order Package. Hence choice A
is correct.
(Fowler 109)"A dependency between two packages exists if any dependency exists
between any two classes in the packages." Since Customer and OrderLine have no
dependencies, choices B and C are incorrect.
Changes to the Customer package may impact the Order package. Hence choice D
is incorrect.
28
Refer to the following
exhibit
From the exhibit, it can be inferred that
A 1 A can have 2 Bs associated
with it
B 1 A can have 4 Bs associated
with it
C 1 A can have 2 to 4 Bs
associated with it
D 1 A can have exactly 2 or 4 Bs
associated with it
E The multiplicity indicated is
only legal in the Booch method, not in UML
Choices A, B and D are correct.
The multiplicity between A and B shown by (2,4) indicates that an A may have
exactly 2 or 4 Bs associated with it. Hence choices A, B and D are correct.
Choice C is incorrect because a 2 to 4 multiplicity would be indicated as
(2..4)
The multiplicity shown is perfectly legal in UML. Choice E is therefore
incorrect.
29 Fragile
Oars, a manufacturer of boating supplies has a mainframe based legacy
application for customer and order management. Recently, Fragile Oars embarked
on a project to add Internet presence to its products and services and hence
created a company website. Since then, its management has realized the
importance of having an eFront and wants to start conducting business over the
Internet. Fragile Oars wants to use Applets as the front-end. What is the best
method to connect to this legacy system?
A Using the same applets
B Using different applets
C Using Java Server Pages
D Using Java Servlets
Choice D is correct.
The best approach in this case is to have the applets talk to Servlets that
can act as mediators between the applets and the Legacy system. Hence choice D
is correct.
Applets and JSP are used to construct the view of an MVC application. They
should not be used as controllers for dispatching requests. Hence choices B
and C are incorrect.
30 Baby
Bell is a new
local Telephony provider in
Chicago,
IL. It has a
legacy application for the B2B transactions with Verizon, the Incumbent Local
Exchange Carrier (ILEC.) Baby
Bell
frequently purchases blocks of Telephone numbers from the ILEC using a CORBA
RPC call. There numbers are then assigned to the customers in sequence.
Sometimes customers request vanity numbers, in which case, a custom
synchronous query is made on the ILEC's operational support system, to check
for number's availability.
If Baby Bell were to rewrite its existing legacy code
using newer J2EE technology, what technology would you choose so that both the
block purchase and the individual query might be accommodated?
A Java Applet technology for the
CORBA call and custom socket programming for vanity number requests.
B Java Servlet API for the CORBA
call and JSP for the custom socket programming
C Entity EJBs for both
D Session EJBs for both
E JNDI for both
F MQ Series with a JMS based
solution for both
Choice D is correct.
Session beans can be used for making both the CORBA call for block purchase of
telephone numbers and the custom synchronous call to request a special vanity
number. Hence choice D is correct.
Both operations represent business processes involving partner OSS.
integration. Applets are not used for modeling the business workflow of a
system. Hence choice A is incorrect.
JSP represent the view construction process in an MVC application. They should
not be used for processing business logic. Hence choice B is incorrect.
Entity beans represent the business model of an application and provide a
representation of enterprise data. They are not to be used for workflow
processing which is better accomplished by using Session Beans. Hence choice C
is incorrect.
JNDI provides Naming and Directory interfaces not workflow processing. Hence
choice E is incorrect.
The question specifically says that a synchronous mechanism is to be used for
the vanity number request. The CORBA RPC call for TN reservation is also
synchronous. MQ Series is a MOM used for messaging. Messaging is an inherently
asynchronous communication mechanism. Hence choice F is incorrect.
31 Julia
Fractals Inc. is building a J2EE based application for Order Entry and
management of their fractal software. Once the order is taken, it is submitted
to a relational database. A provisioning system then queries data and makes
appropriate calls to various subsystems using JMS on MQ Series. What design
pattern is JMS an example of here?
A Observer
B Mediator
C Adapter
D Bridge
E Visitor
Choice D is correct.
Bridge (GOF 151)"Decouple an abstraction from its implementation so that the
two can vary independently." In this case JMS is the abstraction. The
implementation could be MQ Series, TIBCO Rendezvous and Vitria Businessware.
Hence choice D is correct.
Observer (GOF 293)"Define a one-to-many dependency between objects so that
when one object changes state, all its dependents are notified and updated
automatically." Hence choice A is incorrect.
Mediator (GOF 273)"Define an object that encapsulates how a set of objects
interact. Mediator promotes loose coupling by keeping objects from referring
to each other explicitly, and lets you vary their interaction independently."
Hence choice B is incorrect.
Adapter (GOF 139)"Convert the interface of a class into another interface
clients expect. Adapter lets classes work together that couldn't otherwise
because of incompatible interfaces." Hence choice C is incorrect.
Visitor (GOF 331)"Represent an operation to be performed on the elements of an
object structure. Visitor lets you define a new operation without changing the
classes of the elements on which it operates." Hence choice E is incorrect.
32 What
design pattern best explains the use of the stub and the skeleton in CORBA
based RPC applications?
A Factory Method
B Singleton
C Strategy
D Proxy
E Decorator
Choice D is correct.
Proxy (GOF 207)"Provide a surrogate or placeholder for another object to
control access to it." Hence choice E is incorrect. The applicability section
(GOF 208) defines 'remote proxy' as"A remote proxy provides a local
representative for an object in a different address space." Using the stub and
the skeleton, CORBA based applications provide local representatives for
distributed objects. Hence choice D is correct.
Factory Method (GOF 107)"Define an interface for creating an object, but let
subclasses decide which class to instantiate. Factory method lets a class
defer instantiation to subclasses." Hence choice A is incorrect.
Singleton (GOF 127)"Ensure a class only has one instance, and provide a global
point of access to it." Hence choice B is incorrect.
Strategy (GOF 315)"Define a family of algorithms, encapsulate each one and
make them interchangeable. Strategy lets the algorithm vary independently from
clients that use it." Hence choice C is incorrect.
Decorator (GOF 175)"Attach additional responsibilities to an object
dynamically. Decorators provide a flexible alternative to subclassing for
extending functionality." Hence choice E is incorrect.
33 An
application has three Stateless Session Beans - SB1, SB2 and SB3. The stubs
that implement the respective Home Interfaces are SH1, SH2 and SH3. A client
application performs a JNDI lookup to obtain a reference to one of these Home
Objects. This is then narrowed and used to create the remote reference to the
corresponding remote object. What design pattern best explains the creation of
the Remote Object, in this case?
A Prototype
B Builder
C Factory Method
D Business delegate
E Service Locator
Choice C is correct.
Factory Method (GOF 107)"Define an interface for creating an object,
but let subclasses decide which class to instantiate. Factory method lets a
class defer instantiation to subclasses."
Hence the closest pattern this concept is similar to is the Factory Method
pattern. Therefore choice C is correct.
Prototype (GOF 117)" Specify the kinds of objects to create using a
prototypical instance, and create new objects by copying this prototype."
Hence choice A is incorrect.
Builder (GOF 97)"Separate the construction of a complex object from its
representation so that the same construction process can create different
representations." Hence choice B is incorrect.
The following is taken from:
http://java.sun.com/blueprints/patterns/BusinessDelegate.html
"In distributed applications, lookup and exception handling for remote
business components can be complex. When applications use business components
directly, application code must change to reflect changes in business
component APIs.
These problems can be solved by introducing an intermediate class
called a business delegate, which decouples business components from the code
that uses them. The Business Delegate pattern manages the complexity of
distributed component lookup and exception handling, and may adapt the
business component interface to a simpler interface for use by views." Hence
choice D is incorrect.
The following is taken from:
http://java.sun.com/blueprints/patterns/ServiceLocator.html
"Enterprise applications require a way to look up the service objects
that provide access to distributed components. Java™ 2 Platform, Enterprise
Edition (J2EE) applications use Java Naming and Directory Interface (JNDI) to
look up enterprise bean home interfaces, Java Message Service (JMS)
components, data sources, connections, and connection factories. Repetitious
lookup code makes code difficult to read and maintain. Furthermore,
unnecessary JNDI initial context creation and service object lookups can cause
performance problems.
The Service Locator pattern centralizes distributed service object
lookups, provides a centralized point of control, and may act as a cache that
eliminates redundant lookups. It also encapsulates any vendor-specific
features of the lookup process." Hence choice E is incorrect.
34 When
remote calls are made on the container provided implementations of the EJBHome
and EJBObject, various transactional and security checks are applied before
the call is actually passed on to the bean instance.
The Container provided implementations of EJBHome and
EJBObject are performing what Design Pattern's task?
A Command
B Adapter
C Bridge
D Decorator
E Facade
Choice D is correct.
The intent of the Decorator pattern as described by GOF (175) -"Attach
additional responsibilities to an object dynamically. Decorators provide a
flexible alternative to subclassing for extending functionality." A request
intended for a component is routed to the decorator instead. The decorator
forwards the request to the component. It may perform pre or post processing
tasks before or after forwarding the request. J2EE is filled with examples of
the use of design patterns. The container provided implementations of EJBHome
and EJBObject decorate bean classes by providing transactional and security
functionalities.
Choice A is incorrect because Command is used to encapsulate a request as an
object (GOF 233.) Choice B is incorrect because Adapter (GOF 139) converts the
interface of a class into another interface clients expect. Choice C is
incorrect because Bridge (GOF 151) decouples an abstraction from its
implementation so that the two can vary independently and choice E is
incorrect because Façade (GOF 185) provides a unified interface to a set of
interfaces in a subsystem.
35 Compact
Computers is a small computer assembly company. Their online application
allows customers to pick and choose accessories to build their own PCs. The
accessories are:
i. Processor - 800Mhz, 1Ghz, 1.2Ghz
ii. HDD - 40 GB, 60 GB, 80 GB
iii. Memory - 128 MB, 256 MB, 512 MB
If a computer can have exactly 1 processor, 1 HDD and 1 memory stick, what
pattern would be best used here?
A Factory Method
B Builder
C Prototype
D Abstract Factory
E Singleton
Choice B is correct.
Builder (GOF 97) separates the construction of a complex object from its
representation so that the same construction process can create different
representations. Here the complex object is a computer. A computer is always
made up of exactly one processor, one HDD and one Memory stick (problem
description.) However there is no predetermined formula for combining the
parts. Hence Builder is the best pattern here and B is therefore the right
answer.
Answer A is incorrect because Factory Method (GOF 107) defines an interface
for creating an object but lets subclasses decide which class to instantiate.
You may use factories of factories to construct a complex object, but by
itself, the Factory method is good for creating one out of many. Example:
create one processor out of a set of three processors.
Answer C is incorrect because Prototype (GOF 117) specifies the kinds of
objects to create using a prototypical instance. Example: Given a processor,
if you were asked to create a computer that used multi processors, this would
be a good option.
Answer D is incorrect because Abstract Factory (GOF 87) provides an interface
for creating a family of related or dependent objects. If the question had
defined a relation such as 'A computer of 800 MHz processor can only be
coupled with a 40 GB HDD and 128 MB RAM stick', this would have been an ideal
solution.
Answer E is incorrect because Singleton (GOF 127) ensures that a class has
only one instance (or a well-defined number of variable instances) and
appropriate global pointers are available to the instance(s).
36 Ibid is an
e-auction house that auctions refurbished products. Each product has a minimum
bid price. Buyers can query the system for a list of products and then select
a product to bid on. They can then place a higher bid on the selected product.
Transactional Integrity is very important as dirty reads, non-repeatable reads
and phantom reads can lead to data inconsistency.
What technology combination might be most suitable
for addressing Ibid's needs?
A Applets for presentation and
JTA/JTS for transactional integrity
B HTML and JSP for presentation,
and Servlets for data retrieval and transaction management.
C Servlets and JSP for
presentation, a stateful session bean with DAO for list retrieval and a
stateless session bean for transaction management.
D Servlets and JSP for
presentation, a stateless session bean with DAO for list retrieval and CMT
Entity bean for Transaction management.
E Servlets and JSP for
presentation, and a Java class to encapsulate database access and transaction
management.
Choice D is correct.
The Model 2 architecture (based on the Model View Controller pattern) suggests
that Servlets and JSP be used in the presentation tier. JSP combine template
data with dynamic data to display dynamic content to the user. Servlets act as
front controllers, and forward requests to appropriate events in the business
logic tier. Unless concurrent use of shared data is involved, it may be an
overkill to use Entity beans (as in the example of a simple list retrieval.)
The list retrieval is therefore best accomplished by using a session bean with
a Data Access Object (DAO.) Since the bidding represents concurrent use of
shared data, this is best accomplished by using an Entity bean.
Choice A is incorrect because this would not be an ideal application for
applets.
Choice B is incorrect because it suggests the use of Servlets for all
retrieval and updates. Although possible, this is not recommended in the J2EE
best practices as an ideal way when dealing with complex applications.
Choice C is incorrect because it is suggesting that a stateless session bean
be used for managing concurrent access to shared data, something best done by
entity beans. Choice E is incorrect because though it may be suited for
smaller applications that are not very transactional in nature, the discussion
specifically talks about the need for transactional integrity. Therefore this
is not the recommended solution.
37
Heartbreak
Hospital has
two applications - Patient Registration System and
Patient Billing System. Patient Billing, an older application has CORBA
interfaces for updating Billing Information. The newer Patient Registration
system was built as a Java based Application. Heartbreak now wants to
automatically update Billing Information from the Patient Registration
Application. What Java technology may be most suited for this?
A RMI-JRMP
B RMI-JNI
C RMI-IIOP
D EJB
E Java IDL
F Java-CORBA Bridge
Choice E is correct.
The following is taken from:
http://java.sun.com/j2se/1.3/docs/guide/idl/
"Java IDL adds CORBA (Common Object Request Broker Architecture) capability to
the Java platform, providing standards-based interoperability and
connectivity. Java IDL enables distributed Web-enabled Java applications to
transparently invoke operations on remote network services using the industry
standard IDL (Object Management Group Interface Definition Language) and IIOP
(Internet Inter-ORB Protocol) defined by the Object Management Group." Hence
choice E is correct.
RMI-JRMP is used for distributed processing in a pure Java environment. Hence
choice A is incorrect.
There is no indication whether the Patient Billing system supports JNI. Hence
choice B is incorrect.
RMI-IIOP is useful when dealing with EJB applications. Hence choices C and D
are incorrect.
There is no such thing as a Java-CORBA bridge. The Java IDL API performs that
function. Hence choice F is incorrect.
38 In which
of the following cases would an application not necessarily benefit from the
use of Enterprise Java Beans?
A Small Scale deployment
B Large scale deployment
C Transactional in nature
D No Transactional requirements
Choices A and D are correct.
Enterprise Java Beans are best used with large and complex enterprise
applications with high deployment and transactional requirements. Hence
choices A And D are correct.
39 The
container applies what memory management techniques in the case of Session
Beans?
A Bean Pooling
B Bean Passivation
C Bean Persistence
D Bean Purge
Choices A and B are correct.
While EJBs offer business services, EJB Containers offer many peripheral
services such as memory management, persistence, transactions and so on. Bean
Pooling (in the case of Stateless Session Beans) and Bean Passivation (in the
case of Stateful Session Beans and Entity Beans) are two techniques the
container uses for managing memory. Hence choices A and B are correct.
Bean persistence refers to persisting the data represented by Entity Beans to
physical storages such as Relational, Object or other databases. It has
nothing to do with memory management. Therefore choice C is incorrect.
There is nothing called Bean Purge. Beans are removed when the client calls
the remove() method on the Home Interface (Stateful Session Beans) and when
the container decides (in the case of Stateless Session Beans and Entity Beans
which reside in Bean Pools when not in use.) In the case of Entity Beans, the
remove() method also deletes the data the bean instance represents. Hence
choice D is incorrect.
40
Outstanding Perf is a perfume manufacturing company. The management is
currently in the process of architecting a new J2EE based solution for their
online catalog. If performance is paramount and session state needs to be
managed as well, it would be preferable to use HTTP and HTTPSession object as
opposed to using HTTPS. True/False?
A True
B False
Choice A is correct.
The question specifies that performance is important. There is no mention of
the security requirements. Apart from providing Session State, HTTPS includes
additional functionality for allowing secure communication between the client
and the server. Because of all the extra processing with encryption and
decryption, HTTPS is slower than HTTP. Hence in this case, it may be
preferable to use HTTP (which is stateless) with HTTPSession Object (to store
state on the server.) Hence choice A is correct.
41
Staledexho, A renowned catering company has just contracted your
services to track their orders. An online menu is available, for each country
serviced. Customers choose what they want, the quantity and provide relevant
billing information. Fed Ex ships the food in a special container.
What classes and APIs are you most likely to use to
support Internationalization?
A Locale
B Collection Interface
C ListIterator
D ResourceBundle
E KeyStore
F OutputStreamWriter
Choices A, D and F are correct.
The following is taken from:
http://developer.java.sun.com/developer/technicalArticles/Intl/IntlIntro/
"Locales are used throughout the Java class libraries to customize how data is
presented and formatted. They affect language choice, collation, calendar
usage, date and time formats, number and currency formats, and many other
culturally sensitive data representations. If you intend to create
international Java applications, you'll definitely use the java.util.Locale
class. There's no getting around it; you'll use Locales to create
well-behaved, internationalized, multilingual Java applications. So, if you
haven't had time to explore all the JDK 1.1 international features yet, you'll
get a clearer understanding of the core of the internationalization model, the
Locale, as you read and understand the descriptions and examples in this
article.
A Locale is a relatively simple object. It identifies a specific language and
a geographic region. In fact, the only significant contents of a Locale object
are language and country. Although superficially these attributes are not
particularly impressive, they represent a very rich and interesting set of
information. A Locale object represents the language and cultural preferences
of a geographic area. Language is a fairly easy idea to grasp; cultural
preferences may not be immediately clear. Dates, time, numbers, and currency
are all examples of data that is formatted according to cultural expectations.
Cultural preferences are tightly coupled to a geographic area; that's why
country is an important element of locale. Together these two elements
(language and country) provide a precise context in which information can be
presented. Using Locale, you can present information in the language and form
that is best understood and appreciated by the user.
Resource Bundles - This internationalization feature of the JDK provides a
mechanism for separating user interface (UI) elements and other
locale-sensitive data from the application logic in a program. Separating
locale-sensitive elements from other code allows easy translation. It allows
you to create a single code base for an application even though you may
provide 30 different language versions. Although you might be predisposed to
think of text only, remember that any localizable element is a resource,
including buttons, icons, and menus.
The JDK uses resource bundles to isolate localizable elements from the rest of
the application. The resource bundle contains either the resource itself or a
reference to it. With all resources separated into a bundle, the Java
application simply loads the appropriate bundle for the active locale. If the
user switches locales, the application just loads a different bundle.
Resource bundle names have two parts: a base name and a locale suffix. For
example, suppose you create a resource bundle named MyBundle. Imagine that you
have translated MyBundle for two different locales, ja_JP and fr_FR. The
original MyBundle will be your default bundle; the one used when others cannot
be found, or when no other locale-specific bundles exist. However, in addition
to the default bundle, you'll create two more bundles. In the example these
bundles would be named MyBundle_ja_JP and MyBundle_fr_FR. The
ResourceBundle.getBundle method relies on this naming convention to search for
the bundle used for the active locale.
The java.util.ResourceBundle class is abstract, which means you must use a
subclass of ResourceBundle. The JDK provides two subclasses:
PropertyResourceBundle and ListResourceBundle. If these don't meet your needs,
you can create your own subclass of ResourceBundle."
The following is taken from:
http://java.sun.com/docs/books/tutorial/i18n/text/stream.html
"The java.io package provides classes that allow you to convert between
Unicode character streams and byte streams of non-Unicode text. With the
InputStreamReader class, you can convert byte streams to character streams.
You use the OutputStreamWriterclass to translate character streams into byte
streams."
Thus we can see that Locale, ResourceBundle and OutputStreamWriter play a
vital role in Java Internationalization. Hence choices A, D and F are correct.
The Collection interface, ListIterator and KeyStore are not relevant to I18N.
Hence choices B, C and E are incorrect.
42 The
conversion between 16-bit Unicode and 8-bit local encoding formats is done
by:
A MessageFormat and NumberFormat
B Locale and ResourceBundle
C Properties files
D InputStreamReader and
OutputStreamWriter
Choice D is correct.
The following is taken from:
http://java.sun.com/docs/books/tutorial/i18n/text/stream.html
"The java.io package provides classes that allow you to convert between
Unicode character streams and byte streams of non-Unicode text. With the
InputStreamReader class, you can convert byte streams to character streams.
You use the OutputStreamWriterclass to translate character streams into byte
streams." Hence choice D is correct.
MessageFormat, NumberFormat, Locale, ResourceBundle and properties files are
all used in I18N. These are not however used for conversion between Unicode
character format and local 8-bit byte streams. Hence choices A, B and C are
incorrect.
43 Fire Hall,
manufacturers of fire extinguishers, is building a corporate Intranet and
wants its employees to access payroll information via the Internet. They are
planning to use Applets, because of its richer GUI capabilities. The View401K
applet requires a Java 1.4 plug in on the host where it is being executed.
This applet will read data cached on a temporary directory in the host to
calculate 401K distributions.
What are your observations on the use of Applets for
this purpose?
A The Applet technology is not a
viable solution for this application because applets are subjected to the
sandbox model, which prevents them from reading from or writing to the host
where they are being executed.
B The Applet technology is a
viable solution for this application because the Security policy of the Java 2
Platform is totally flexible.
Choice B is correct.
The following is taken from:
http://java.sun.com/docs/books/tutorial/security1.2/overview/index.html
"JDK 1.1 introduced the concept of a "signed applet," as illustrated in the
next figure. A digitally signed applet is treated like local code, with full
access to resources, if the public key used to verify the signature is
trusted. Unsigned applets are still run in the sandbox. Signed applets are
delivered, with their respective signatures, in signed JAR (Java Archive)
files.
JDK 1.2 introduces a number of improvements over JDK 1.1. First, all code,
regardless of whether it is local or remote, can now be subject to a security
policy. The security policy defines the set of permissions available for code
from various signers or locations and can be configured by a user or a system
administrator. Each permission specifies a permitted access to a particular
resource, such as read and write access to a specified file or directory or
connect access to a given host and port.
The runtime system organizes code into individual domains, each of which
encloses a set of classes whose instances are granted the same set of
permissions. A domain can be configured to be equivalent to the sandbox, so
applets can still be run in a restricted environment if the user or the
administrator so chooses. Applications run unrestricted, as before, by default
but can optionally be subject to a security policy." As we can see, the Java 2
Security model is totally flexible. Hence choice B is correct.
44 Which of
the following statements is true about SSL?
A SSL runs above high-level
application protocols such as HTTP and LDAP
B SSL runs below TCP-IP
C SSL runs above TCP-IP and below
application protocols
D SSL does not have anything to
do with either the application or the network layer in the OSI model
Choice C is correct.
The following is taken from:
http://developer.netscape.com/docs/manuals/security/sslin/contents.htm
"The Transmission Control Protocol/Internet Protocol (TCP/IP) governs the
transport and routing of data over the Internet. Other protocols, such as the
HyperText Transport Protocol (HTTP), Lightweight Directory Access Protocol
(LDAP), or Internet Messaging Access Protocol (IMAP), run "on top of" TCP/IP
in the sense that they all use TCP/IP to support typical application tasks
such as displaying web pages or running email servers.
The SSL protocol runs above TCP/IP and below higher-level protocols such as
HTTP or IMAP. It uses TCP/IP on behalf of the higher-level protocols, and in
the process allows an SSL-enabled server to authenticate itself to an
SSL-enabled client, allows the client to authenticate itself to the server,
and allows both machines to establish an encrypted connection." Therefore
choice C is correct.
Choice A is incorrect because it suggests that SSL runs above application
protocols.
Choice B is incorrect because it suggests that SSL runs below TCP/IP.
SSL runs between TCP/IP and HTTP. Hence choice D is incorrect.
45 What
happens when the remove() method is called on the Home Interface of an Entity
Bean?
A The remote reference is
invalidated
B The bean instance is destroyed
C The bean instance is
Passivated
D The data represented by the
bean instance is deleted from the database
E The Bean Instance moves from
pooled state to ready state
Choices A and D are correct.
The remove() method, in the case of Entity Beans, invalidates the client stub,
and deletes the data represented by the bean, from the database. Hence choices
A and D are correct.
The bean instance is returned to the pool. It is not destroyed when the
remove() method is called on an Entity Bean. Therefore choice B is incorrect.
The container passivates the bean instance whenever required (for memory
management.) It is not a consequence of the remove() method though. Hence
choice C is incorrect.
The Bean instance moves from the Ready State to the Pooled State upon removal,
not the other way round as the point suggests. Hence choice E is incorrect.
46 What types
of transactions are supported by Enterprise Java Beans?
A Implicit Declarative
Transactions
B Explicit JTA based
transactions
C Either A or B (based on vendor
implementation)
D Both A and B
Choice D is correct.
Enterprise Java Beans specification supports both Implicit Declarative
transactions and explicit Java Transaction API (JTA) based transactions. Hence
choice D is correct.
47 With
Entity Beans, the container automatically generates implementations of all
find methods at deployment time.True/False?
A True
B False
The above statement is False.
The container only generates implementations of the find methods at deployment
time, in the case of Container Managed Persistence.
48 What does
the ejbCreate() method return in the case of Entity Beans in EJB 1.1?
A A remote reference to the
EJBObject for both BMP and CMP beans
B The Bean's Primary Key for
both BMP and CMP beans
C A reference to itself in BMP
and NULL in CMP
D NULL value of type BeanPK in
CMP and Primary Key in BMP
Choice D is correct.
In EJB1.0, the ejbCreate() method returned void. In EJB1.1, a null value of
the bean's primary key type is returned by the ejbCreate() method (in CMP.) In
BMP, the ejbCreate() method returns the primary key of the newly created
entity. Hence choice D is correct.
The Container intercepts the return value from the Bean and returns a remote
reference to the remote object, to the calling client. Hence choice A is
incorrect.
Choice B suggests that the Primary Key of the newly created instance is
returned in both CMP and BMP. Hence it is incorrect.
The Bean instance never returns a reference to itself upon creation. Hence
choice C is incorrect.
49 You have
just started a new job working for a top finance company and you have been
asked to provide a user-friendly interface to an existing mainframe
application. You don't have any access to the mainframes source code. What is
the best technique for this?
A It can't be done.
B Use a screen scraper.
C Re-write the main frame using
Java and high-end Unix servers. Although it may take some time to do this in
the long run this will benefit the company.
D Write a Java front end then
use CORBA to communicate with the mainframe.
E Use the Java Native Interface
(JNI) to communicate with the mainframe.
F Use object Mapping
F Use JMS
B is correct choice.
The key to this question is that you don't have access to the mainframes
source code. A screen scraper emulates a mainframe terminal. Basically the
screen scraper logs on to the mainframe like a normal user and sends requests
to the mainframe and then reads the response. The problem with a screen
scraper is that if you change any of the mainframes code there is always the
possibility that the screen scraper will stop working.Choice A is incorrect
because it can be done. Choice C would take far too long, would cost too much
and is not what the customer wants. Choice D, E and F are not appropriate are
would require access to the mainframes source code. Choice G is incorrect
because there is no mention that the mainframe supports a messaging system.
Some of them do and even provide interfaces for JMS however as it's not stated
in the question then this is not the right answer.
50 The
company you have been working for has released the next generation of its
sales system. You have several very powerful servers and a few basic servers
at your disposal. A network expert has suggested that in order to get the best
possible performance out of these machine you use reverse proxy load
balancing? What is reverse proxy load balancing?
A Splitting requests evenly
amongst all back end servers
B The proxy sits behind the
backend servers monitoring the performance of each one. When it notices one is
being used too much it will automatically forward requests to a different
server.
C Splitting requests amongst all
back end servers depending on the amount of spare CPU time each server has
available.
D A technique used to target
certain requests to certain backend servers, e.g. All Servlet requests from
one server. All static HTML from another.
E A way of filtering out certain
requests. It is used to protect against denial of service attacks
Choice D is correct.
Reverse proxy load balancing is generally used when you have servers with
different amounts of CPUs and Memory. You might have some really powerful
servers just to be used for SSL sessions and others to handle static html.
Using this will maximise the performance of your applicationChoice A is a
description of round-robin load distribution. Choice B doesn't describe any
particular method of load balancing. Choice C is an inaccurate description of
reverse-proxy load balancing and you would need access to the mainframes
source code to do this. Choice E is a cross between a firewall and a standard
proxy server this does not do any load balancing.
|