Solution
Use a Data Access Object to abstract and encapsulate all access to the data source. The Data Access Object manages the connection with the data source to obtain and store data.
The Data Access Object (DAO) is the primary object of this pattern. The DAO implements the access mechanism required to work with the data source. The data source could be a persistent store like an RDBMS, an external service like a B2B exchange, a repository like an LDAP database or a business service accessed via CORBA IIOP or low-level sockets. The business component that relies on the DAO object uses the simpler interface exposed by the DAO for its clients. The DAO completely hides the data source implementation details from its clients. Because the interface exposed by the DAO to clients does not change when the underlying data source implementation changes, this pattern allows the DAO to adapt to different storage schemes without affecting its clients or business components. Essentially, the DAO acts as an adapter between the component and the data source.
Originally posted by Jacky Doner:
hi,all
I have been preparing the exam of SCEA PHASE I,and I have some question listed as follows.I'm not sure the correct answer to each question,I hope
someone can give me some instructions on them.Thanks a lot.
1. Which statement describes a normal default security restriction applied to classes loaded from untrusted sourced by Java-enabled browsers? (Choose one)
A. Untrusted classes cannot load trusted classes.
B. Untrusted classes cannot create server sockets.
C. Untrusted classes cannot load untrusted classes.
D. Untrusted classes cannot initiate any network connections.
eeeeE. Untrusted classes cannot display windows outside of the browser.
:For A: Applet can load trusted classes such as classes in anonther jar file at the source downloading server.
:For B: Applet can connect the server from which it was downloaded, either by server socket or client socket.
:For C: Similar as A.
:For D: At least an applet can create such a connection as B said.
:For E: Applet cannot create Window.
2. A steel industry association has hired you, a Megasoft network consultant, to create a B2B architecture for the steel industry.What does this mean? (Choose one)
A. You have to create a portal to allow consumers to order steel products.
B. You have to create a portal to exchange news and information about the steel industry.
C. You have to create an infrastructure to allow the exchange of product catalog information between steel companies.
ddddD. You have to create an architecture to allow the exchange of order information between steel companies order systems.
:For D: B2B means purchase order.
3. What is a benefit of bean pooling in an EJB container? (Choose one)
A. It improves the portability between databases.
B. It reduces the number of database connections.
C. It provides better support to object-oriented databases.
ddddD. It reduces the memory allocation and garbage-collection cycles.
4. Which items provides tools to allow the formatting of currency and date information according to local conventions? (Choose one)
aaaaA. java.text package
B. java.util.Locale class
C. java.lang.String class
D. Pluggable look and feel in Swing
E. Readers and Writers in the java.io package
:For A: The question says what "tools"(the java.text package contains Format/MessageFormat/NumberFormat/DateFormat as tool), while java.util.Locale is an identity of locale
5. Which statement describes a normal default security restriction applied to untrusted classes by a Java-enabled browser? (Choose one)
aaaaA. Untrusted classes cannot read data from arbitrary files.
B. Untrusted classes cannot initiate any network connections.
C. Untrusted classes cannot write sensitive data to the screen.
D. Untrusted classes cannot make unrestricted use of CPU power.
E. Untrusted classes cannot read sensitive data from the keyboard.
:For A: for example, applet can not read local file system.
6. Megasoft Grapes, a vineyard, is developing an online ordering system to sell wine online. Because of local sales restrictions, the vineyard is working with local wine stored to deliver wine to the customers. The requirements for the system are:
? Customers keep their choices in a "wine list"
? Requests are fulfilled as the vintage become available.
? Local wine shops track wines that have been ordered by customers in their area.
? All order and product data is stored in an RDBMS.
? Both customers and local wine shops use the Internet to access the system.
? The system must be scalable and secure.
Which two interactions must be secure? (Choose two)
A. Customers adding wine to their wine list.
bbbbB. The application server generating a sales report.
ccccC. The application server updating the order information into the DB.
D. The local wine stop checking what wines have been ordered locally.
:For A: because adding to wine list occurs in the web server session, it does not need security. But if you send credential card number via network/internet, the interaction needs security.
:For B: the business report is security-sensitive.
:For C: the netwrok between application server and database server needs to be security.
:For D: i do not understand it.
7. What are three benefits of design patterns? (Choose three)
aaaaA. They act as a learning aid.
B. They provide standard code libraries.
ccccC. They provide a common design vocabulary.
ddddD. They standardize the way designs are developed.
E. They describe an object-oriented development process.
:For B: DP do not have code lib.
:For E: non-OO tech can use DP too.
8. Which two statements about JMS are true? (Choose two)
aaaaA. JMS supports Publish/Subscribe.
bbbbB. JMS uses JNDI to find the destination.
C. JMS enhances access to email services.
D. JMS uses JMX to create a connectionFactory.
:For c: jms do nothing with mail service.
:For D: jmx is about management
9. Which three are aspects of an application are most likely to be determined at runtime based on the user's declared nationality of locale? (Choose three)
aaaaA. Currency formats.
B. Network protocols.
ccccC. Textual output messages.
ddddD. Calculations and/or algorithms.
E. Server host names and/or addresses
:For B: network protocal does nothing with human interaction.
:For D: Algorithms is different among different countries.
10. These are the requirements for your new system:
? All current business logic is in the form of database-stored procedures.
? All current and new business logic is to be migrated to EJB.
? The system is an online, Web-based system. The UI is HTML-based.
? There are three EJBs: Customer, Order, and Account. There is one Java object, ShoppingList,which holds the current list of ordered items.
? Only account and order data are stored in the database.
? The Customer EJB maintains a reference to the ShoppingList.
Which three architectural decisions adhere to the requirements? (Choose three)
aaaaA. Make Order and Account an entity EJB.
bbbbB. Make Customer a stateful-session EJB.
C. Make Customer a stateless-session EJB.
D. Make Customer an entity EJB and put business logic in it.
eeeeE. Make Customer a session EJB and put business logic in it.
F. Use the Container Managed Persistence policy for the Customer session EJB.
:For A: "Only account and order data are stored in the database"
:For B: "The Customer EJB maintains a reference to the ShoppingList", something like shoping cart.
:For E: "These are the requirements for your ***new*** system" and "All current and new business logic is to be migrated to EJB"
11. Megasoft's application uses several entity beans accessing each other for information. The company found the architecture to be low in flexibility because they embedded entity relationships in the entity beans.
What is an alternative solution? (Choose one)
aaaaA. Use a stateful session bean as a Mediator to the entity beans.
B. Use a stateful session bean as a Fa?ade to other session beans.
C. Use a servlet to give clients direct access to data in a database table.
D. Use a stateless session bean to access the database directly instead of using entity beans.
:For A: Omar Ocampo said "in order to remove the entity embedded relationship, but yet have relationship "
Originally posted by Jacky Doner:
Thanks for your valuable replies.As for question 7,can you give the three
whole answers to us.while,I have some other unsure questions,hope for any
replies and any ideas again.The questions list as follows:
1. The following statement is true about which type of EJB?
"All bean instances are equivalent when they are not involved in serving a client-invoked method". (Choose one)
A. Stateful session bean
B. Stateless session bean
C. Entity bean with bean-managed persistence
D. Entity bean with container-managed persistence
(b)
2. Which two statements are true about management of an EJB's resources? (Choose two)
A. The reference to the remote object is obtained through JNDI to improve maintainability and flexibility.
B. The reference to home object is obtained through JNDI to improve maintainability and flexibility.
C. The EJB container can manage the instance's access to its resources because the home object acts as a proxy.
D. The EJB container can manage the instance's access to its resourced because the remote object acts as a proxy.
(b d)
Home object is not proxy of bean instance
3. Which statement about an EJB container's lifecycle management of session beans is true? (Choose one)
A. The client is responsible for the object identity for session beans.
B. The client can passivate a session bean after a specified timeout period.
C. The container can passivate a stateful session bean to free limited resources.
D. The container can passivate a stateless session bean to free limited resources.
(c)
session bean has no id.
session bean instance will be removed when timeout.
stateless bean has no passivation/activation.
4. Which two statements about stateless session beans are true? (Choose two)
A. They provide a generic service.
B. They maintain a cached state on behalf of a specific client.
C. They maintain a conversational state on behalf of several clients.
D. They may provide high performance by being available for multiple clients.
(a d)
generic service such as transaction,security,naming.
5. What are two clear advantages to using message services in an application? (Choose two)
A. Provides scalability
B. Provides secure communication services.
C. Allows loose coupling between components.
D. Allows clients and servers to communicate directly.
(a c)
6. A department of Megasoft Inc uses entity beans with bean-managed persistence to access an RDBMS.The entity beans contain the code to access the database directory. Megasoft decides that other departments can reuse the business logic to access their database, which include an OODBMS and a different type of RDBMS.
Which statement best describes how the Megasoft can integrate their departmental business logic to access the various databases, and to ensure that the entity bean code is easy to read? (Choose one)
A. Use session beans to access an entity bean through a data access object.
B. Move the data-access code out of the entity beans into a data-access object.
C. Distribute the data-access code among several entity beans to access different databases.
D. Use session beans to access several entity beans that represents the data in all three databases.
(b)
DAO pattern.
DAO makes ejb independent of db/resource adapter
7. You have determined that the interactions between objects in a system are complex, and that the objects are tightly coupled. Furthermore, additional functionality would require the modification of many objects in the system.
Which pattern will solve this problem? (Choose one)
A. Fa?ade
B. Mediator
C. Template
D. Prototype
E. Command
(b)
8. The requirements for an online shopping application are:
? It must support millions of customers.
? The invocation must be transactional.
? The shopping cart must be persistent.
Which technology is required to support these requirements? (Choose one)
A. JNI
B. JMS
C. EJB
D. JMX
(c)
9. Which two services does EJB provide? (Choose two)
A. HTML generation
B. Transaction services
C. Lifecycle management
D. Remote-method invocation
(b c)
rmi is protocal
Originally posted by Yanqu Zhou:
I think the correct answer for Q10 is ACE
10. These are the requirements for your new system:
? All current business logic is in the form of database-stored procedures.
? All current and new business logic is to be migrated to EJB.
? The system is an online, Web-based system. The UI is HTML-based.
? There are three EJBs: Customer, Order, and Account. There is one Java object, ShoppingList,which holds the current list of ordered items.
? Only account and order data are stored in the database.
? The Customer EJB maintains a reference to the ShoppingList.
Which three architectural decisions adhere to the requirements? (Choose three)
A. Make Order and Account an entity EJB.
B. Make Customer a stateful-session EJB.
C. Make Customer a stateless-session EJB.
D. Make Customer an entity EJB and put business logic in it.
E. Make Customer a session EJB and put business logic in it.
F. Use the Container Managed Persistence policy for the Customer session EJB.
Because Customer EJB maintains a reference to the ShoppingList, it keeps the state of the shopping list, stateful session bean is not required, any thoughts?
Space pants. Tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
|