202 . The Remote Interface of an Enterprise Bean extends from?
203 . Which of the following are not applicable to the Primary Key Class?
- It must implement the java.io.Serializable interface
- It must provide a default constructor
- It must override hashCode() and equals()
- Cannot be undefined if the PK is a Compound Primary Key
- Primitive wrappers cannot be used when dealing with Single field keys
204 . Which of the following statements is true about Session Beans?
- All attributes of a Stateless Session bean have to be set to null prior to passivation
- All non-transient and non-serializable fields of a Stateful Session Bean have to be set to null in the ejbPassivate() method
- The container uses Passivation on Stateful and Stateless Session Beans to allow pooling and swapping which are good techniques for resource management
- Passivation only applies to Entity Beans and not to Session Beans
205 . When a call is made to a single-entity find method in an entity bean, the ObjectNotFoundException is thrown indicating that the requested entity was not found. What happens to the transaction?
- It is automatically rolled back since it is an application exception
- It is not automatically rolled back since it is a system exception
- It is not automatically rolled back since it is an application exception
- It is automatically rolled back since it is a system exception
- It may or may not automatically rollback based on container specific implementation
206 . Which of the following services does the EJB Container provide?
- Object Distribution
- Life Cycle Management
- Integrated Web Server and Servlet Engine
- Just in Time management Java Runtime Engine
- Transaction Management
207 . When a client calls the create() on a Stateless Session Bean’s Remote Interface?
- The newInstance() method is invoked by the container
- The ejbCreate() method is called by the container
- Passivated instance is activated and attached to the EJB Object
- The Container takes an instance from the Method Ready Pool and attaches it to the EJB Object
208 . The container will synchronize an Entity Bean’s state with the database?
- After every setXxx() method
- When a client calls the ejbLoad() or ejbStore() method
- When the container thinks its appropriate based on various factors including the Transactional Context
- When the connection.flush() method is called
209 . The standard ports for HTTPS and HTTP are?
- 21 / 110
- 80 / 443
- 443 / 80
- 21 / 119
210 . A browser client C1 opens an SSL session with Server S1 on port 443. C1 then opens a new browser window and opens an SSL session with Server S2 (while the SSL session with S1 is active in the other browser window.) At the same time client C2 opens an SSL session with S1 on 443 as well?
Which of the following statements are false?
Choose the one below:
- Client C1 cannot be engaged in two SSL connections as the same time
- S1 cannot be engaged in two SSL connections on the same port at the same time
- C1 can have multiple SSL connections open at the same time
- S1 can have multiple SSL connections open at the same time
211 . Messaging is achieved by?
- Synchronous tightly coupled communication between distributed components
- Asynchronous loosely coupled communication between components
- Using Stubs and Skeletons
- Marshalling and unmarshalling of data
212 . Messaging supports which of the following two models?
- Point to Point
- Send to List
213 . Which of the following is not true about RPC?
- RPC attempts to mimic the behavior of a system that runs in one process
- When a remote procedure is invoked, the caller is blocked until the procedure completes and returns control
- RPC is asynchronous in nature
- RPC is tightly coupled
214 . What is the difference between Maintainability and Manageability in Software Engineering?
- Manageability is the ability to correct flaws in the system whereas maintainability is the ability to ensure the continued health of the system
- Maintainability is the ability to correct flaws in the system whereas manageability is the ability to ensure the continued health of the system
- Maintainability deals with ensuring that the system is always reliable and accessible whereas manageability deals with the ability to add functionality to the system
- They are both the same
215 . Which of the following are not considered tiers in a J2EE based n-tier model?
- Client Tier
- Web Tier
- EJB Integration Tier
- EIS Tier
- EIS Integration Tier
- Legacy Connectivity Tier
- JCA Tier
216 . Which of the following are true about client/server based applications?
- Clients are typically used for data presentation, validation and for processing business logic
- Most client/server applications follow the Model2 architecture as opposed to n-tier applications that follow Model3
- In client/server applications, the client normally consists of the view, controller and parts of the model
- In typical client/server applications, the presentation tier (windows) generally talks to controller (a data dispatcher), which then talks to objects that represent the enterprise data
- Client/server applications generally have fat clients and sometimes, fat servers as well. Hence both the client and the server could offer portability problems
217 . In n-tier models, which tier is best suited for implementing the view, and controller components of an MVC application?
- Client Tier
- Web Tier
- MVC Tier
- Business Tier
- EIS Integration Tier
- EIS Tier
218 . Which of the following are not service level requirements that affect software architecture?
- Detailed Design
- Design Patterns
219 . Which of the following UML diagrams may be best suited for a Business Analyst?
- Use Case
220 . Since a dependency exists between two packages if a dependency exists between any two classes in the packages, it can be deduced that all package dependencies are transitive in nature?
Choose the one below:
221 . Refer to the diagram for the following question?
In the diagram, the initialization call 1.1.1 is made by?
Choose the one below:
- The Session Facade Object
- The Acct Object
- The AcctWebImpl Object
222 . Megasoft Corporation has a old application that uses a legacy database. Recently Megasoft made a decision to develop the front-end code for the application using the Java Applet technology. At this time however, Megasoft is not interested migrating its data to a relational database?
In the order of importance, which of the following may be the best approach to connect to the legacy database?
Choose the one below:
- JDBC-Bridge, Database Middleware, JDBC
- Database Middleware, JDBC-ODBC bridge, JDBC
- JDBC, Database Middleware, JDBC-ODBC bridge
- JDBC, JDBC-ODBC Bridge, Database Middleware
223 . Michael Fell runs a computer assembly company. He purchases parts from a wholesale parts distributor. Fell has a legacy application to track purchases of parts and sale of computers. Although the current system is very inflexible, the GUI is not very tightly coupled to the business layer. As an architect, what medium to long-term solution would you offer, given that Fell does not want to do away with his entire application yet?
Choose the one below:
- Use Screen Scraping and Off-board server to provide information to a Java based application
- Refactor the legacy code to make it flexible
- Rewrite the inflexible parts of the application alone using Servlets
- Decouple the existing front-end and replace it with a J2EE based solution
- Replace the inflexible parts with a flexible ERP solution
224 . Which design pattern can be used to create a family of dependent objects?
- Factory Method
- Abstract Factory
225 . Pensacola, a Florida based soda company has just started operations in Dallas, TX to counter competition from Dr. Pepper. Pensacola believes that using a J2EE based application will put them ahead of the competition. Their new architect is suggesting that Session Beans be used to provide a unified interface to the Entity Beans in the system?
The use of session beans here illustrates the use of what design pattern?
Choose the one below:
226 . One of the advantages of using Stateless Session Beans is that they are lightweight objects and do not have conversational state overheads. Further, the container swaps these bean instances in and out of the bean pool to appropriately manage resources. This allows the container to use fewer instances of the bean to service a larger number of clients?
What design pattern is being illustrated here?
Choose the one below:
202 : 3 is correct.
Remote Interfaces of EJBs extend from javax.ejb.EJBObject. Hence choice 3 is correct.
Though it sounds likely, 1, 2 and 4 are incorrect because there is no interface called EJBRemote, RemoteInterface or RemoteReference.
203 : 4 & 5 is correct.
The question says ‘not applicable’ and only choices 4 and 5 are not true. Compound Primary Keys can remain undefined until deployment time and primitive wrappers can be used with dingle field keys. Hence choices 4 and 5 are correct.
Choices 1, 2 and 3 are true about Primary Keys and therefore incorrect choices.
204 : 2 is correct.
When a bean is about to be passivated, the container calls the ejbPassivate() method. At this time, the bean instance can close all open resources and set all non-transient non-serializable fields to null. Hence choice 2 is correct.
Stateless Session Beans are not passivated. Hence choice 1 is incorrect. While Stateful Session Beans are pooled and swapped, Stateless Session Beans are not. Hence choice 3 is incorrect. In addition to Entity Beans, Stateful Session Beans are passivated as well. Hence choice 4 is incorrect.
205 : 3 is correct.
The question deals with the ability to differentiate between system exceptions and application exceptions, and their impact on transactions. The container throws the ObjectNotFoundException to indicate that the entity requested by the single entity find method was not found. When this happens, the transaction is not typically rolled back. Hence choice 3 is correct.
Application exceptions are thrown in response to errors encountered in the processing of business logic. Application exceptions do not cause transactions to roll back. Hence choice 1 is incorrect.
The ObjectNotFoundException is not a system exception. Hence choice 2 is incorrect. Again choice 4 indicates that the ObjectNotFoundException is a system exception and is therefore incorrect. Choice 5 indicates that it is up to the container to either roll back the transaction or not, which is incorrect.
206 : 1,2 & 5 is correct.
The EJB developer is only responsible to developing the core service that the component provides. All other services are decorations provided by the container. For example, the container provides object distribution via the Home Interface and Remote Interface implementations and manages the life cycle of Beans. It also provides transaction management capabilities. Hence choices 1, 2 and 5 are correct.
Many popular EJB vendors provide a web server and a Servlet engine as well. But that is not a responsibility of the EJB Container. Hence choice 3 is incorrect.
Choice 4, mentions something about just in time management JRE, irrelevant jargon meant to throw off the reader. Hence choice 4 is incorrect.
207 : 4 is correct.
With Stateless Session Beans, a new instance is not created each time a client request comes in. Instead, the container manages a pool of bean instances, and when a client requests the service (via a create method), an instance from the pool is assigned to service the request. Hence choice 4 is correct.
The newInstance() method and the ejbCreate() method are invoked by the container to set up the instances in the bean pool and are not called with each create() method called by the client. Hence choices 1 and 2 are incorrect.
Choice 3 is incorrect because Stateless Session Beans are not passivated or activated.
208 : 3 is correct.
In CMP, the container automatically handles synchronization between the bean and the database. With BMP the developer is responsible for providing the logic for database synchronization. In both cases however, the container decides when the synchronization should occur, based on various activities such as transactions, concurrency and resource management. Hence choice 3 is correct.
It is not guaranteed that data will be synchronized after each set method. Again this is because the container decides when to synchronize data. Hence choice 1 is incorrect.
The methods ejbLoad() and and ejbStore() are considered callback methods – the container uses them to communicate with the entity when it is about to or just has synchronized database state. Hence clients do not make calls to these methods. Choice 2 is therefore incorrect.
There is no method called connectionFlush(). Hence choice 4 is incorrect.
209 : 3 is correct.
Although port numbers are configurable, the default ports for HTTPS and HTTP are 443 and 80. Hence choice 3 is correct.
Port 21 is used with FTP, port 110 is used with POP3 and port 119 is used with NNTP. Hence choices 1 and 4 are incorrect. Choice 2 has the port numbers in the reverse order. Hence choice 2 is incorrect.
210 : 1 & 2 is correct.
Note that the question asks you which choices are false. Since clients can simultaneously engage in multiple SSL connections (through different browser instances) and servers can support multiple concurrent SSL connections, only choices 1 and 2 are false and therefore the right answers.
Choices 3 and 4 are true and therefore incorrect.
211 : 2 is correct.
Messaging is a middleware architecture that is used for asynchronous communication. This is generally achieved through a store-and-forward mechanism. All message producers and message consumers communicate to each other via a Message Oriented Middleware. Message consumers receive messages via a polling mechanism or a server-push mechanism. Hence choice 2 is correct.
Synchronous tightly coupled communication is a feature of RPC middleware applications. Hence choice 1 is incorrect.
Stubs and Skeletons are used to Marshall and unmarshall data in distributed RPC environments. Hence choices 3 and 4 are incorrect.
212 : 1 & 3 is correct.
There are two models available in Messaging. Point-to-Point is typically used for a one to one communication and Publish Subscribe is used when messages need to be broadcast to a group of subscribers. Hence choices 1 and 3 are correct.
The envelope-content is not a messaging paradigm. It is an example used to illustrate how messages are constructed when using Simple Object Access Protocol (SOAP.) Hence choice 2 is incorrect.
There is no paradigm called Send to List. Publish Subscribe is used for one to many communication. Hence choice 4 is incorrect.
213 : 3 is correct.
The question is asking what is false about RPC. Only choice 3, which says that RPC is asynchronous in nature, is false. Therefore choice 3 is correct.
Choices 1, 2 and 4 are true statements about RPC based communication and hence incorrect.
214 : 2 is correct.
Maintainability (Cade 8),”is the ability to correct flaws in the existing system without impacting other components of the system” and manageability (Cade 9)”is the ability to manage the system to ensure the continued health of a system with respect to scalability, reliability, availability, performance and security.” Hence choice 2 is correct.
The definitions in choice 1 are in the reverse order and incorrect in choice 3. Choice 4 is trying to say that the two non-functional requirements refer to the same thing. Hence they are all incorrect.
215 : 3,6 & 7 is correct.
The question is asking what choices are not considered as J2EE tiers. There are no tiers called ‘EJB Integration Tier’, ‘Legacy Connectivity Tier’ or ‘JCA Tier.’ Hence choices 3, 6 and 7 are correct.
J2EE applications have the following tiers: Client (Browsers, Applications, Applets, Mobile clients and so on), Web (presentation tier consisting of JSP as view and Servlets as controllers), EJB (Business Tier, consisting of EJB and supporting classes), EIS Integration (Java classes that integrate to the Enterprise Information System tier) and finally the EIS tier (relational databases, XML databases, ERP systems and so on.) Hence choices 1, 2, 4 and 5 are all valid J2EE application tiers and therefore incorrect.
216 : 1,3 & 5 is correct.
In 2-tier applications, clients are typically used for data presentation, validation of user inputs and processing of business logic. Hence choice 1 is correct.
If you compare the functions performed by the client with the MVC pattern, the client performs the duties of the view, the controller and parts of the model. The client interacts with the database and retrieves data. This data is then assembled into the required view. For example, a window that shows all orders taken in 1 day sorted by the customer number. The client thus acts as the view in MVC.
When some search criteria is entered and the user presses a button to retrieve necessary data, the client appropriately dispatches the request to the database interaction object that retrieves the necessary data. Here the client acts as the controller.
Most database interaction is encapsulated in a set of database access objects. These objects perform business rules processing. Here the client performs the job of the MVC model. Some logic is also encapsulated on the server side via triggers and stored procedures. Hence it is possible that the database also performs some model tasks in 2-tier applications. Hence choice 3 is correct.
Client/server applications frequently suffer from fat clients or fat servers or a combination of both. This is because either all the logic is coded in the client (4GL scripting language) or all the logic is coded on the server (through stored procedures and triggers) or a combination of both. This results in poor portability of such applications. Hence choice 5 is correct.
Choice 2 indicates that 2-tier applications follow Model2 architecture whereas n-tier applications follow Model3 architecture. This is untrue, because it is n-tier applications that normally follow the Model2 architecture. Hence choice 2 is incorrect.
Although object oriented client/server platforms may offer the tools to decouple windows and database interaction objects that is not a normal feature in 2-tier applications. Hence choice 4 is incorrect.
217 : 2 is correct.
n-tier models typically follow a Model2 architecture where each tier has specific responsibilities. The view and most of the controller components are generally placed in the Web Tier (note: in some Model2 architectures, some controller components are also placed in the business logic tier.) Hence choice 2 is correct.
Choice 1 is incorrect because the client tier is not responsible for the view and controller objects. Choice 3 is incorrect because there no such tier as MVC tier. Choices 4, 5 and 6 are incorrect because none of them hold the view components (although some controller components may be present in the Business logic tier.)
218 : 1,4 & 7 is correct.
Service level requirements (Cade 6) or Quality of Service (QoS) requirements are those that are needed by an application to satisfy the business requirements of a system. Performance, Scalability, Reliability, Availability, Extensibility, Maintainability, Manageability and Security are Non-functional service level requirements. While choices 1 and 4 illustrate important aspects of a software project, they are not considered QoS requirements. Although choice 4 describes a best practice that is frequently used by good designers, it too is not a Service level requirement. Hence choices 1, 4 and 7 are correct.
Performance, Reliability, Availability and Security are service level requirements and therefore choices 2, 3, 5 and 6 are incorrect.
219 : 3 is correct.
Use Case diagrams (Cade 43)”show a set of use cases and actors and their relationships. Use Case diagrams show the static view of a system. These diagrams are especially important in organizing and modeling the behaviors of a system.” Use case diagrams are frequently used by Business Analysts to capture business requirements of a system. Choice 3 is therefore correct.
Deployment diagrams (Cade 50)”show the configuration of run time processing nodes and the components that live within these nodes. Deployment diagrams address the static view of the architecture.” Architects frequently use deployment diagrams. Choice 1 is therefore incorrect.
A class diagram (Cade 44)”shows a set of classes, interfaces and collaborations and their relationships…Class diagrams address the static design view of a system.” Software designers frequently use class diagrams. Choice 2 is therefore incorrect.
Activity diagrams (Cade 48)”are a special kind of state chart diagram that show the flow from activity to activity within the system. This type of diagram is important in modeling the function of a system and emphasizing the flow of control among objects.” Designers and Developers frequently use Activity diagrams. Hence choice 4 is incorrect.
A Collaboration diagram (Cade 46)”is an interaction diagram that emphasizes the structural organization of objects that send and receive messages.” Designers and developers frequently use Interaction diagrams. Choice 5 is therefore incorrect.
Sequence Diagrams (Cade 46) are”interaction diagrams that emphasize the time ordering of messages.” Interaction diagrams address the dynamic view of a system and are frequency used by designers and developers. Hence choice 6 is incorrect.
220 : 2 is correct.
Package Diagrams (Fowler 108)”show packages of classes and the dependencies among them A dependency exists between two elements if changes to the definition of one element may cause changes to the other…A dependency between two packages exists if any dependency exists between any two classes in the packages…With packages dependencies are non-transitive.” The question makes an argument that all package dependencies are transitive in nature, which is false. Hence choice 2 is correct.
221 : 3 is correct.
The diagram shows a Collaboration Diagram (Collaboration diagrams are Interaction diagrams and they address the dynamic view of a system. They emphasize on the structural organization of objects. Read the SCEA for J2EE Study Guide for more information.)
1.1.1 Represents an initialization method called by the value object AcctWebImpl on itself upon construction.
222 : 4 is correct.
Updating the data storage tier (Jaworski 532.) “If the data storage tier of a legacy system utilizes a relational database system, JDBC may be used to provide connectivity to legacy databases. In most cases, legacy databases will not support a pure JDBC driver. If the existing system provides ODBC support, the JDBC-ODBC Bridge can be used. If the database uses custom drivers, it might be possible to find database middleware that supports the custom driver and either an ODBC or JDBC interface.” It is therefore preferable to try for pure JDBC driver support, failing which one may opt for a JDBC-ODBC Bridge. If that too is not possible, then a database middleware may be used. Choice 4 is therefore correct.
Although choices 1, 2 and 3 give the same three alternatives, they are in incorrect orders of preference. Hence choices 1, 2 and 3 are incorrect.
223 : 4 is correct.
The key in this question is that the GUI is not very tightly coupled to the business layer. This means that the GUI can be decoupled form the system fairly easily. Further, the question asks for a medium to long-term solution. Thus in this case, using a J2EE based front-end may be preferable. Hence choice 4 is correct.
The use of screen scrapers may have been the best short-term solution. However it is certainly not the best medium to long-term approach. Hence choice 1 is incorrect.
Code re-factoring is not an alternative here. The question does not say anything about what the legacy system is written in and whether is easy to modularize its code. Hence choice 2 is incorrect.
The question only mentions about changing the GUI. They are not looking to rewrite all inflexible parts of the system. Hence choice 3 is incorrect.
Choice 5 is incorrect because it refers to replacing all inflexible parts of the system. Further there is no indication anywhere in the question that an ERP solution might make it more flexible.
224 : 4 is correct.
Abstract Factory (GOF 87)”Provide an interface for creating families of related or dependent objects without specifying their concrete classes.” Hence choice 4 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 1 is incorrect.
Prototype (GOF 117)” Specify the kinds of objects to create using a prototypical instance, and create new objects by copying this prototype.” Hence choice 2 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 3 is incorrect.
Singleton (GOF 127)” Ensure a class only has one instance, and provide a global point of access to it.” Hence choice 5 is incorrect.
225 : 3 is correct.
Fa ade (GOF 185)”Provide a unified interface to a set of interfaces in a subsystem.”
The following is taken from:
“Use a session bean as a facade to encapsulate the complexity of interactions between the business objects participating in a workflow. The Session Facade manages the business objects, and provides a uniform coarse-grained service access layer to clients.” Hence choice 3 is correct.
Flyweight (GOF 195)”Use sharing to support large numbers of fine-grained object efficiently.” Hence choice 1 is incorrect.
Proxy (GOF 207)”Provide a surrogate or placeholder for another object to control access to it.” Hence choice 2 is incorrect.
Decorator (GOF 175)”Attach additional responsibilities to an object dynamically. Decorators provide a flexible alternative to subclassing for extending functionality.” Hence choice 4 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 5 is incorrect.
Bridge (GOF 151)”Decouple an abstraction from its implementation so that the two can vary independently.” Hence choice 6 is incorrect.
226 : 4 is correct.
Flyweight (GOF 195)”Use sharing to support large numbers of fine-grained object efficiently.” Here the container uses fewer instances of Stateless Session Beans to service a larger number of clients. Hence choice 4 is correct.
Decorator (GOF 175)”Attach additional responsibilities to an object dynamically. Decorators provide a flexible alternative to subclassing for extending functionality.” Hence choice 1 is incorrect.
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 2 is incorrect.
Facade (GOF 185)”Provide a unified interface to a set of interfaces in a subsystem.” Hence choice 3 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 5 is incorrect.