|
126 In EJB 2.0 what
is the Component interface?
A The interface that
Message-Driven Beans must implement
B There is no component
interface in EJB 2.0.
C The new name for the Home
interface.
D The new name for the Remote
interface.
Choice D is correct.
Note: This type of question will not be in the EJB 1.1 version of the SCEA but
is likely to be in the EJB 2.0 version of the SCEA.Message-Driven beans don't
implement any interfaces in EJB 2.0. The Component interface is the new name
for the Remote interface as introduced in the EJB 2.0 specification.Remote
Interface (Component Interface in EJB 2.0): Defines the Bean's business
methods. The Remote Interface extends javax.ejb.EJBObject.Home Interface:
Defines the Bean's life cycle methods - creation, location and removal. The
Home Interface extends javax.ejb.EJBHome. Note that the create method is
optional for Entity Beans. This is useful when you do not want to clients to
be able to insert data into the database.
127 You are working
on a new application that will help your company co-ordinate sales data across
different departments. The aim is to have everyone access the same sales data
at all times. This project needs to be finished as soon as possible and you
have bought some third party code to speed up the development process. The
code has been signed using a digital certificate and packaged in a jar file.
What do you know about it? Note: Digital certificates have been provided that
have been signed by a trusted Certificate Authority.
A The jar file contains no
malicious code.
B The jar file was signed by the
3rd party vendor
C The jar file contents may
contain malicious code.
D Someone impersonating the 3rd
party vendor may have signed the jar file.
E The code is fully tested and
performs the task it was designed for.
Choice C is correct.
All you actually know is that the code has been signed using the 3rd party
vendors private certificate. You don't know that it was actually signed by the
3rd party vendor. For example if the certificate was copied or stolen then
there is no guarantee that the thief hasn't distributed code signed with the
stolen certificate. The jar file may contain malicious code or it may not,
that is all you can guarantee. Just because code is signed doesn't mean it is
fully tested and does what it was supposed to do. Choice E is therefore
incorrect.
128 You have been
contracted by a movie memorabilia company to set up an online shop. The
company buys bulk goods from movie sets (stage props, costumes, gadgets etc),
splits them into single items and then auctions them. The company used to hire
sports halls or community centers to auction items in a traditional manner.
They predict that by moving to an online solution they will reach a wider
audience and make a greater profit despite the initial investment that the new
system will involve. What is the most suitable initial design in the list
below?
A The business logic will be
handled in a Servlet
B The business logic will be
handled in a Stateful Session Bean
C Use Container Managed
Transactions
D Use Bean Managed Transactions
E The customer will be
represented wth an Entity Bean
F There is no need for a
customer bean as a customers interaction with the site is just business logic
and will be handled in the Servlet/Stateful Session Bean
G Use Container Managed
Persistence
H Use Bean Managed Persistence
I The sale items will be
represented with an Entity Bean
J The sale items will be stored
directly on a database
Choices B, D, E, G and I are correct.
This is question is really 5 mini questions. If the business logic is put into
the Servlet you are creating Fat clients with presentation and business logic
tightly coupled. Therefore it is more appropriate to use a Stateful Session
Bean especially since the Bean can be used in the Session Façade pattern (See
below). The site is an online auction site with bids being placed at different
times. This implies that transactions will need to be handled at a very fine
level of granularity therefore Bean Managed Transactions is the most
appropriate choice.
The customer and sales items both need to be persisted so they should be
implemented as Entity Beans. The Entity Beans (customer and sales items) would
not be complicated objects so Container Managed Persistence would be the
better choice.Session Façade:A client should never"talk" directly to an Entity
EJB. Instead a Session to Entity pattern called a Session-Façade should be
used. As the name suggests, this pattern is based on the GoF Façade pattern.
The Session Facade provides a simple interface to a complex subsystem. The
simple interface is the Session Bean and the Complex subsystem is the Entity
Bean. The client talks to the Session Bean, which in turn communicates with
the Entity Bean.
129 You have an
application that is running in a DMZ that your company has set up. There are
two firewalls, the first filters out packets based on destination ports other
than port 80 (allows standard HTTP requests). The second filters out packets
based on the origin IP address (only allows company IP addresses through). Can
you connect to the application running in the DMZ from your Home
computer?
Note: The application running in the DMZ is on port
80. True/False?
A True
B False
The above statement is True.
DMZ stands for Demilitarized zone. To set up a DMZ you need two firewalls and
you create 3 separate regions. The different regions are the internet, DMZ (in
the middle) and the third is your network. You would have a server in the DMZ
that is accessible to both the public and your network. The internet may not
access your network but they can access the server in the DMZ. Your network
must access the internet through the server in the DMZ.The key to this
question is that you are not trying to connect to an application within the
second firewall that filters out requests based on IP address. So you could
definitely connect to the application from home.A Useful
link:http://www.saintrochtree.com/network-advices/000004.htm
130 The
Enterprise
JavaBean 2.0 specification has introduced the notion of local Clients. What
are Local Clients and why were they introduced?
A Local Clients should be used
when the web server is running on the same machine as the application server.
B Local Clients should be used
when Session Beans need to communicate with Entity Beans.t;Beans in the same
Virtual Machine should use local Clients.
C Local Clients have been
introduced to make testing code easier.
D Local Clients have been
introduced to improve maintainability.
E Local Clients have been
introduced to improve performance.
F Local Clients should be used
when the database is running on the same machine as the application server.
Choices C and F are correct.
Note: This type of question will not be in the EJB 1.1 version of the SCEA but
is likely to be in the EJB 2.0 version of the SCEA.Prior to the Enterprise
JavaBean 2.0 specification all Bean clients were seen as remote clients. This
meant that if a Session Bean needed to talk to an Entity Bean inside the same
Virtual Machine it would still need to make a remote call. This obviously had
a direct impact on performance. In EJB 2.0 Enterprise Beans can now treat
other beans in the same VM as local clients. Local Clients can access the
beans through its local and local home interfaces.Remote clients use
pass-by-value but Local clients use pass-by-reference.For more information
please see:http://java.sun.com/products/ejb/2.0.html
131 Which of the
following offers an accurate description of Message-Driven Enterprise
Beans?
A Message-Driven beans are just
a new way of describing a JMS message. This has been formalized with the EJB
2.0 specification.
B A Message-Driven bean is an
enterprise bean that allows J2EE applications to process messages
asynchronously.
C A Message-Driven bean is an
enterprise bean that allows J2EE applications to process messages
synchronously.
D A Message-Driven bean is used
when you need to interact with messaging systems other than JMS.
E A Message-Driven bean is like
a Session Bean except that if the server is busy it will put the
Message-Driven beans' method requests in a queue and execute them one at a
time to reduce the load on the Application Server.
Choice B is correct.
Note: This type of question will not be in the EJB 1.1 version of the SCEA but
is likely to be in the EJB 2.0 version of the SCEA.As stated in choice B a
Message-Driven bean is an enterprise bean that allows J2EE applications to
process messages asynchronously. Choice C is incorrect because messages are
sent asynchronously. Choices A, D and E are all factually incorrect. For more
information about Message-Driven beans see below.The following is taken
from:http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/EJBConcepts5.htmlA
message-driven bean is an enterprise bean that allows J2EE applications to
process messages asynchronously. It acts as a JMS message listener, which is
similar to an event listener except that it receives messages instead of
events. The messages may be sent by any J2EE component--an application client,
another enterprise bean, or a Web component--or by a JMS application or system
that does not use J2EE technology. Message-driven beans currently process only
JMS messages, but in the future they may be used to process other kinds of
messages.
132 What's the
biggest difference between Message-Driven Beans and Entity and Session
Beans?
A There is no difference in
structure between Message-Driven Beans and Entity and Session Beans. They all
have Home, Remote interfaces and a bean class.
B Message-Driven beans don't
have a Home interface.
C A Message-Driven bean is
different from Session Beans because its state is persisted.
D Clients don't access
Message-Driven beans through interfaces.
Choices B and D are correct.
Note: This type of question will not be in the EJB 1.1 version of the SCEA but
is likely to be in the EJB 2.0 version of the SCEA.Choice A is incorrect,
Message-Driven beans don't have Home or Remote interfaces, they just have a
bean class. The state of Message-Driven beans is not persisted like Entity
beans. So choice C is incorrect.The following is taken
from:http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/EJBConcepts5.htmlThe most
visible difference between message-driven beans and session and entity beans
is that clients do not access message-driven beans through interfaces. Unlike
a session or entity bean, a message-driven bean has only a bean class.
133 When should you
use Message-Driven Beans?
A If you need to send any JMS
message.
B When you need to use an
external service such as a credit card validation service and performance is
essential.
C When you need to send JMS
messages asynchronously.
D When you need to send JMS
messages synchronously.
Choice C is correct.
Note: This type of question will not be in the EJB 1.1 version of the SCEA but
is likely to be in the EJB 2.0 version of the SCEA.Choice B is incorrect,
Message-Driven beans will not increase the performance of a service. Choice D
is the other way around and choice A is factually incorrect.The following is
taken
from:http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/EJBConcepts5.htmlSession
beans and entity beans allow you to send JMS messages and to receive them
synchronously, but not asynchronously. To avoid tying up server resources, you
may prefer not to use blocking synchronous receives in a server-side
component. To receive messages asynchronously, use a message-driven bean.
134 You are
developing an application that will have to support a huge number of users.
You are worried about the performance of the application because you need to
use many Entity Beans. A work colleague has suggested using the Value Object
design pattern. What is the pattern and how will it benefit you?
A A snapshot of the state of an
Entity Bean at a particular time.
B An object that is used instead
of an Entity Bean. For example if you were going to use a Customer bean you
would create a Customer Value Object and the Application Server would use this
instead. A Stateful Session Bean would control it.
C An object that is used instead
of an Entity Bean. For example if you were going to use a Customer bean you
would create a Customer Value Object and the Application Server would use this
instead. A Stateless Session Bean would control it.
D There is no such thing as a
Value Object design pattern.
E There is a Value Object design
pattern but it would not be appropriate to use it here.
F A Value Object is the state of
an Entity Bean that is kept in memory by the Application Server. (Its state is
periodically persisted.)
G A Value Object is the state of
an Entity Bean that is kept in memory by the Application Server. (Its state is
not persisted and the data becomes stale after a while.)
Choice A is correct.
Note: This type of question will not be in the EJB 1.1 version of the SCEA but
is likely to be in the EJB 2.0 version of the SCEA.Every time you access an
Entity Bean there is a significant overhead, as the call must go across the
network and through the container to access the bean. One way to reduce the
number of calls you need to make to Entity beans is by using the Value Object
pattern. A Value Object (VO) is a snapshot of the state of an Entity Bean at a
particular time. The idea is that a client will require more than one value
from an Entity bean so instead of making several calls to an Entity Bean a
Value Object is created containing all of these values. This Value Object is
downloaded by the client so they can make the same calls only this time
locally and directly on the bean. A Value Object is normally implemented as a
JavaBean and is made immutable because there is no data synchronization (the
JavaBean only provides getter methods).
135 Your have been
contracted by a company to upgrade their online shopping application. Their
site sells health care insurance to customers at huge discounts. The process
of buying insurance is complicated. They have however tried to simplify it as
much as possible for the customer. When the customer arrives at their site to
register, they fill out a 40-question questionnaire covering basic health and
lifestyle information. The answers are then used for selecting the most
appropriate level of insurance. (Each customer does NOT get a custom health
care insurance agreement; they get the most suitable one out of a choice of
30). The customer then has the opportunity to purchase the insurance within
seven days before the quote becomes void. Based on the rough description of
the system which of the following is the most suitable design?
Note: This question should be based upon the EJB 2.0 specification.
A The Customer should be an
Entity Bean
B The business logic should be
represented with a Stateful Session Bean.
C The business logic should be
represented with a Servlet.
D The system should use CMT.
E Should use BMT.
F The Health Plan should be an
Entity Bean that supports local clients.
G The Health Plan should be a
Stateful Session Bean.
H The Health Plan should be a
Stateful Session Bean that supports local clients.
I There is no need for Customer
Bean as there is no need to store the customers details just the Health Plan
they bought.
J The Customer should be an
Entity Bean that supports local clients.
Choices B, D, F and J are correct.
Note: This type of question will not be in the EJB 1.1 version of the SCEA but
is likely to be in the EJB 2.0 version of the SCEA.The data that needs to be
persisted are the customer data and the Customer's Health Plans data (which
one out of the 30 different plans.) Although the process of buying health care
insurance sounds complicated (40-question questionnaire) the data that
actually needs to be stored is very simple (customer id, health plan id etc).
This means that CMT is more appropriate than BMT (choice E is therefore
incorrect.) There is no benefit in putting the business logic in a Servlet,
there still needs to be a Session Bean to talk to the Customer and Health Plan
Entity Beans. It is also possible to use the Entity Beans local client
interfaces (introduced in EJB 2.0) which will improve the performance of the
application.
136 What are the
benefits of synchronous messaging?
A Less coupling between the
sender and receiver.
B Network doesn't have to be
available.
C Does not block the sender.
D Good for transaction
processing.
Choice D is correct.
Choices A, B and C are all describing asynchronous messaging. Synchronous,
tightly coupled communication between distributed components: This is the
model of CORBA, RMI, EJB and so on. The programming model is called Remote
Procedure Call (RPC).Asynchronous, loosely coupled communication between
components: This is the Message Oriented Middleware or MOM model. The
programming model is called Messaging.
137 Can you use BMT
(Bean Managed Transactions) with Entity Beans?True/False?
A Yes
B No
Choice B is correct.
Entity Beans can only use Container Managed Transactions (CMT) but Session
Beans can use either CMT or Bean Managed Transactions (BMT). CMT is less
flexible than BMT and can't handle transactions at the same level of
granularity as BMT.The following is taken
from:http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/Transaction3.htmlIn an
enterprise bean with container-managed transactions, the EJB container sets
the boundaries of the transactions. You can use container-managed transactions
with any type of enterprise bean: session, entity, or message-driven.
Container-managed transactions simplify development because the enterprise
bean code does not explicitly mark the transaction's boundaries. The code does
not include statements that begin and end the
transaction.http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/Transaction4.htmlIn
a bean-managed transaction, the code in the session or message-driven bean
explicitly marks the boundaries of the transaction. An entity bean cannot have
bean-managed transactions; it must use container-managed transactions instead.
Although beans with container-managed transactions require less coding, they
have one limitation: When a method is executing, it can be associated with
either a single transaction or no transaction at all. If this limitation will
make coding your bean difficult, you should consider using bean-managed
transactions.
138 How has
Container-Managed Persistence Changed from EJB 1.1 - 2.0?
A There has been no change with
CMP but BMP has changed.
B The performance of CMP has
been improved so it no now more efficient than BMP.
C The Bean class is now an
abstract class.
D You no longer need a
deployment descriptor.
E CMP doesn't exist in EJB 2.0
because BMP out performs CMP.
F You define the fields to be
persisted in the Remote interface.
G You define the fields to be
persisted in the Home interface.
Choice C is correct.
Note: This type of question will not be in the EJB 1.1 version of the SCEA but
is likely to be in the EJB 2.0 version of the SCEA.The following is taken
from:http://developer.java.sun.com/developer/technicalArticles/ebeans/EJB20CMP/Prior
to the EJB 2.0 specification, a client stored and accessed persistent data via
an entity bean's instance variables. With the introduction of the 2.0
specification, you can designate instance variables to be container-managed
persistence fields (cmp fields) or container-managed relationship fields (cmr
fields). You define these cmp and cmr fields in the deployment descriptor. You
retrieve and set the values of these cmp and cmr fields using public get and
set methods defined in an entity bean. Similar to the JavaBeans model, you do
not access the instance variables directly, but instead use the entity bean's
get and set methods to retrieve and set these instance variables. (An
enterprise bean does not declare these instance variables.) Furthermore, you
use the deployment descriptor to specify the relationships between entity
beans. These relationship specifications serve as the schema definition, so
that when the bean is deployed, the bean relationships may be captured in a
relational database. For example, a relationship between two beans specified
in the deployment descriptor may appear as a foreign key relationship in a
relational database. Choice A is incorrect because CMP has been reviewed in
EJB 2.0. Choices F, G and D are incorrect as specified in the above
paragraphs. The performance of CMP has improved but not to the point where it
is more efficient than BMP so choice B and E are incorrect.
139 What are the
benefits of the J2EE Blueprints Fast Lane Reader design pattern and when
should it be used?
A When you the performance of an
application is essential and you need to perform lots of read/write actions.
B Should be used when reading
large amounts of read only data.
C Increases maintainability.
D Should be used when you need
to access data that becomes stale very quickly.
E Can reduce the amount of code
needed.
F Increases the amount of code
needed.
Choices B and E are correct.The following is taken
from:http://java.sun.com/blueprints/patterns/FastLaneReader.htmlSometimes
applications access data in a tabular fashion, such as when browsing a catalog
or a list of names or when exporting data in batches for use elsewhere. This
kind of data access is usually read-only. In such situations, using entity
beans to represent persistent data incurs overhead and provides little
benefit. Entity beans are best for coarse-grained access to individual
business entities, and are not effective for read-only access to large
quantities of tabular data. The Fast Lane Reader design pattern provides a
more efficient way to access tabular, read-only data. A fast lane reader
component directly accesses persistent data using JDBCTM components, instead
of using entity beans. The result is improved performance and less coding,
because the component represents data in a form that is closer to how the data
are used. Choice F is incorrect because the Fast Lane Reader can reduce the
amount of code needed. Choice C is not the most appropriate answer because
although there is less coding involved it does not have a direct affect on the
maintainability of the application. (It may even reduce maintainability by
increasing the coupling between the data store and business logic). Choice A
is incorrect because the Fast Lane Reader pattern should only be used with
Read Only data. Although choice D is feasible it is not the most appropriate
choice.
140 In which of the
following situations would you use the Observer pattern?
A When you need to have objects
notified of events but you don't know which objects would have such needs, or
if you will need to add more objects to receive such notification, at a later
date.
B You want one object to monitor
when the state of another object but you don't want the object being monitored
to need to send any messages regarding its state.
C When the instances of your
class can be use interchangeable and you want to reduce the number of
instances created in order to improve performance.
D You are building an online
auction site to sell rare and collectable toys. You want customers to be
notified of bids on items they are bidding for in as close to real time as
possible. You would use the Observer pattern to notify the customer objects of
changes in the auction object.
E When you need to co-ordinate
state changes between other objects by using one object.
Choices A and D are correct.
The observer pattern is used to notify an objects dependents' when that object
changes state. Choice E is a description of the Mediator pattern. Choice C is
incorrect because the Observer pattern does not reduce the number of instances
you need to create. Choice B is almost correct except that messages are sent
when the object being monitored changes state.Observer - (GOF 293): "Define a
one-to-many dependency between objects so that when one object changes state,
all its dependents are notifies and updated automatically."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 it lets you vary their interaction independently."
141 You need to
access a complex object in a recursive way…building the object from other
objects. This is an example of which pattern?
A Abstract Factory
B Factory Method
C Builder
D Composite
E Recursive Builder
Choice D is correct.
This is a bit of a trick question; you would assume that you would need to use
a creational pattern such as the Builder or Abstract Factory to do this
<Prototype could be applicable as well, if we are not building a family or
an aggregate object, but simply prototyping existing objects>. The key is
that you need to recursively build a composite object from other objects. This
is an example of the Composite pattern. There is no such pattern as the
Recursive Builder so choice E is incorrect.Composite - (GOF 163): "Compose
objects into tree structures to represent part-whole hierarchies. Composite
lets clients treat individual objects and compositions of objects
uniformly."The other patterns were:Abstract Factory - (GOF
87): "Provide an interface for creating
families of related or dependent objects without specifying their concrete
classes."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."Builder - (GOF 97): "Separate the construction of a complex object
from its representation so that the same construction process can create
different representations."&&Sanjay"need to build a complex object"
almost certainly suggests that we are talking about a creational pattern. I
understand the tricky nature of the question, however I was wondering if the
question needed to be reworded as"accessing a complex object" or something.
Has been updated
142 When would you
use the Flyweight pattern?
A When you need classes to be
notified of events but you don't know which classes or if you will need to add
more at a later date.
B When the instances of your
class can be used interchangeably and you want to reduce the number of
instances created in order to improve performance.
C When the instances of your
class cannot be used interchangeable and you need to convert them so that they
are interchangeable.
Choice B is correct.
Choice A is a description of the Observer pattern. Choice C is incorrect
because the instances of your class can be used interchangeably in the
Flyweight pattern.Flyweight - (GOF 195):"Use sharing to support large numbers
of fine-grained objects efficiently."
143 You are
currently designing your own Desktop Publishing application, as you have not
found any that do exactly what you want with existing applications. As part of
the design you are using a Controller to which you send all GUI requests. Not
all objects can process the same commands. For example you can't select the
spell check tool when an image has the focus. To stop any possible errors you
would like to filter out some of the messages as they are passed from these
objects to the Controller object. What pattern could you use?
A Firewall
B Proxy
C Adapter
D Observer
E Chain of Responsibility
F Filter
Choice B is correct.
Firewall and Filter are not design patterns. In this scenario what you are
essentially trying to do is filter all packets that don't meet a certain set
of requirements. This behavior is just like a Proxy server dropping packets
from certain IP address etc.Proxy - (GOF 207): "Provide a surrogate or
placeholder for another object to control access to it."The other
patterns: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."Observer - (GOF 293):"Define a
one-to-many dependency between objects so that when one object changes state,
all its dependents are notifies and updated automatically."Chain of
Responsibility - (GOF 223):"Avoid coupling the sender of a request to its
receiver by giving more than one object a chance to handle the request. Chain
the receiving objects and pass the request along the chain until an object
handles it."
144 When would you
use the Mediator pattern?
A When you need to co-ordinate
state changes between other objects by using one object.
B When you need to add
functionality to a class without changing its interface.
C When you need create a
separation between abstractions and classes that implement those abstractions.
D You need a class that will be
used in lots of different applications where the logic will only change
slightly.
Choice A is correct.
The Mediator pattern allows you to co-ordinate state changes between many
objects by using one mediator object. Choice B is a description of the
Decorator pattern. The Strategy pattern is described in choice D and choice C
describes the Bridge pattern.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 it lets you
vary their interaction independently."
145 A prospective
employer is describing the existing architecture of a solution that is
currently in production. He says that it's a 3-tier system with 3 clustered
web servers; a server for the Oracle database with the business logic
implemented using PL/SQL scripts. What is true about this system?
A This solution has fat clients
B This solution has thin clients
C There is a good separation of
business logic
D The solution has good
Scalability
E There is a poor separation of
business logic
F The solution has poor
scalability
Choices B, E and F are correct.
The key to this question is the fact that the business logic has been
implemented using PL/SQL stored procedures. This means the business logic is
on the same server as the database and therefore this is a 2-tier system not a
3-tier system as your prospective employer suggests. There is a very tight
coupling between the data store and the business logic this has a direct
affect on the potential scalability of this system.When you think of 2-Tier
systems you would normally associate them with Fat clients. However as the
business logic has been implemented using PL/SQL scripts this system will have
thin clients making choice A incorrect. Choice C is incorrect because the
business logic and data store are tightly coupled. This tight coupling will
have a direct affect on scalability. You may not be able to horizontally scale
this system (adding more machines); vertical scaling might be easier (add more
memory and CPUs.) But even with vertical scaling you would always run the risk
of a network bottleneck making choice D is incorrect as well.
146 Your have been
contracted by a company to help them improve the performance of their sales
application. You have suggested that the hardware the application is currently
deployed on (2 web servers and a database server) be migrated to 3 web
servers, an application server and a database server (all on different
machines.) You assure them that all the software re-writes needed will be well
worth it in the end. What are the characteristics of your suggested
architecture?
A Fat Clients
B Thin Clients
C Good separation of business
logic
D Good Scalability
E Poor separation of business
logic
F Poor scalability
G There is no difference in the
separation of business logic
Choices B, C and D are correct.
The system you have suggested they migrate to is a 3-tier system. The
characteristics of a 3-tier system are thin clients, good separation of
business logic and good scalability. This is due to the fact that each tier is
separate from the other (for example it would be possible to change the data
store without affecting the business logic.)Choice A is incorrect; the
suggested system has thin clients, the business logic residing on the
application server, in the middle tier. Since there is a good separation of
business logic, choices E and G are incorrect. Choice F is incorrect the
3-tier nature of the system makes it very scalable.
147 Your boss is
raving about the new 3-Tier architecture that your company's sales application
will be deployed on. He says that this architecture will solve all the
existing problems. Is he right, or does a 3-Tier architecture have the
potential to introduce any new problems?
A Fat Clients
B Thin Clients
C Poor scalability
D Poor manageability
E Reduced performance
F Reduced separation of business
logic
G Single point of failure
Choice D is correct.
The only problem a 3-Tier architecture could have is the potential for poor
manageability. The separation of tiers creates thin clients and distributes
business logic processing. However because of the distributed nature of the
servers, there could be manageability problems. With J2EE solutions however,
the potential for such problems is limited because J2EE tiers and layers have
very well defined roles and responsibilities. Choice A is incorrect because
Fat clients are a characteristic of 2-Tier architecture where the business
logic is implemented on the client side. Thin clients are good. Therefore
choice B is incorrect. A 3-Tier architecture has excellent scalability,
including horizontal scalability, making choice C incorrect. It's possible to
argue that a 3-Tier architecture may not perform as well as a single machine
containing your web server, business logic and database. However as soon as
you introduce a significant amount of users a 3-Tier architecture would out
perform a single machine. Therefore choice E is correct. Choice F is incorrect
because a 3-Tier architecture actually increases the separation of business
logic. Choice G is incorrect because a"single Point of failure" is not a
problem that a 3-Tier architecture introduces. Although it may have a single
point of failure, with careful design you can avoid such pitfalls easily. This
is much harder to do with 2-Tier architecture and impossible with 1-Tier
architecture.
148 You have
written an application to allow customers to reserve tables at their favourite
restaurants. In return your company receives 10% of whatever the customer
spends at the restaurant. At the moment, the application is being run on a
single Apache web server using
PERL and
CGI scripts
for presentation and business logic with a separate server for the Sybase
database containing the restaurant details. What are the most notable
weaknesses of this architecture?
A Fat Clients
B Thin Clients
C Scalability
D Potential Network bottlenecks
E Performance
Choices A,C and D are correct.
The architecture being described here is a 2-Tier architecture. The key as to
whether this system has fat or thin clients is that there is no reference to
stored procedures. Generally if the business logic resides on the server it is
in the form of stored procedures. We therefore assume that all the business
logic is in the PERL and CGI scripts. The reason for poor scalability is due
to the tight coupling of business logic and client presentation (fat clients).
There is always a potential of a network bottleneck in 2-Tier architectures
because all requests have to go to one data store.Choice B in incorrect as
there is no mention of stored procedures in the scenario we assume that the
business logic has been implemented in PERL and CGI scripts on the client
side. Performance is not the best answer here and so choice F is incorrect.
149 You have just
bought a brand new dual processor server with over 3 Gigabytes of memory, the
fastest server in its class. This server will host Apache Web server (shipped
with the Oracle Database) and an Oracle 8i database. What are the most notable
weaknesses of this architecture?
A Scalability
B Manageability
C Security
D Performance
Choice A is correct.
You can only vertically scale this system (add memory, CPUs etc). As soon as
this system comes under a heavy load you would have to separate the Apache web
server from the Oracle database and build up a cluster of web servers. This
would be hard to do as the Oracle database and Apache web server are so
tightly coupled.Note: A system can still be scalable even if it is only one
machine providing it has a good separation of the business logic, data store
and client presentation. Choice B is incorrect because this system would be
easy to manage as everything is in one place. Choice C is incorrect, you don't
need to authenticate yourself to other machines or send traffic across the
network to other machines. Choice D is incorrect because although the system
would perform really well under light traffic as soon as it had heavy loads of
traffic the performance would drop dramatically.
150 When should
Java IDL be used?
A When performance is essential
(Performance is more important than scalability).
B When accessing RMI servers.
C When servicing requests from
RMI clients.
D When accessing existing CORBA
servers.
E When servicing requests from
CORBA clients.
Choice D is correct.
The following is taken
from:http://java.sun.com/j2se/1.3/docs/guide/idl/index.htmlThis is a
fundamental question and it's important to understand the distinction between
these two ways of integrating the Java programming language with CORBA. Java
IDL is for CORBA programmers who want to program in the Java programming
language based on interfaces defined in CORBA Interface Definition Language
(IDL). This is "business as usual" CORBA programming, supporting Java in
exactly the same way as other languages like C++ or COBOL. Although CORBA can
slightly out perform RMI that is not a reason to use Java IDL so choice A is
incorrect. In choices B and C you would use RMI-JRMP and inc choice E you
would use RMI-IIOP.
|