Exam3 (EJB, XML, Web service, OOAD)

1. What does the EJB specification architecture define?

The answer is: D

  A.  Transactional components 

  B.  Distributed object components 

  C.  Server-side components 

  D.  All of the above 

 

2.  What type of enterprise bean is good to be a façade bean and to implement façade design pattern?

The answer is: C

  A.  javax.ejb.EnterpriseBean 

  B.  javax.rmi.Remote 

  C.  javax.ejb.SessionBean 

D.     javax.ejb.EntityBean

E.      javax.ejb.MessageDrivenBean

 

3. What do enterprise beans use to communicate with the EJB container to get runtime context information?

The answer is: A

  A.  The javax.ejb.EJBContext provided by the container 

  B.  A JNDI ENC context 

  C.  A javax.ejb.EJBHome object provided by the container 

  D.  A javax.ejb.EJBMetaData object provided by the container 

 

4. Through what interface does an application create, find, and remove enterprise beans?

The answer is: B

  A.  java.rmi.Remote 

  B.  javax.ejb.EJBHome 

  C.  javax.ejb.EJBObject 

D.     javax.ejb.EntityBean 

E.      javax.ejb.MessageDrivenBean

 

5. What type of enterprise bean is used to embody business objects?

The answer is:A

  A. javax.ejb.EnterpriseBean 

  B.  java.rmi.Remote 

  C.  javax.ejb.SessionBean 

D.     javax.ejb.EntityBean 

E.      javax.ejb.MessageDrivenBean

F.       

 

 

 

6. What type of enterprise bean is used to embody application processing state information?

The answer is:C

  A.  javax.ejb.EnterpriseBean 

  B.  javax.rmi.Remote 

  C.  javax.ejb.SessionBean 

F.      javax.ejb.EntityBean

G.     javax.ejb.MessageDrivenBean

 

7. What interface must the enterprise bean implement so that an application can invoke its operations?

The answer is:C

  A.  javax.ejb.EntityBean 

  B.  javax.ejb.EJBHome 

  C.  javax.ejb.EJBObject 

  D.  javax.rmi.Remote 

 

8. At what point, precisely, in the life-cycle is a container-managed entity bean considered created?

The answer is:A

  A.  Immediately prior to the execution of its ejbCreate() method 

  B.  Immediately after the execution of its ejbCreate() method 

  C.  After the CMP bean's data has been committed to the underlying persistent datastore 

  D.  During the execution of its ejbPostCreate() method 

 

9. What distinguishes a bean-managed persistent (BMP) enterprise bean from a container-managed persistent (CMP) enterprise bean?

The answer is:D

  A.  A BMP bean must implement the ejbLoad() and ejbStore() methods 

  B.  A BMP bean can implement persistence to custom datastores such as legacy systems 

  C.  A BMP bean is responsible for managing its own persistence to a persistent datastore 

  D.  All of the above 

 

10. What is a deployment descriptor?

The answer is:A

  A.  An XML file format used by the container to learn about the attributes of a bean, such as transactional characteristics and access control 

  B.  A method for transporting enterprise beans back and forth between systems 

  C.  An XML file used by enterprise bean clients to learn about the attributes of a bean, such as access control and transactional characteristics. 

  D.  A format for bundling enterprise beans for delivery to customers 

 

11. The conversational states stateless session beans have can across multiple invocations?

The answer is:A

 A. True

 B. False

 

12. The deployment descriptor for a Web project is an XML file stored in the:

The answer is: A

  A. META-INF directory that defines the location of configuration files to be used by the production server

  B. project root context directory that defines the location of configuration files to be used by the production server

  C. WEB-INF directory that defines the configuration of modules to the production server

  D. project root context directory that defines the configuration of modules to the production server

 

13. Filters can be applied to a data connection for what purpose?

 The answer is:D

  A. Restricting tables included in the generated data model

  B. Restricting the data that is returned by any SQL statement executed against the connection

  C. Setting limits on the maximum result set size returned via the connection

  D. Setting limits on the number of concurrent queries that can be executed against the connection

 

14. A developer joins a new department where they will be developing J2EE applications, but still needs to support the Java application they developed while in their previous job. What is the BEST way to completely separate the new J2EE projects from the existing Java projects in WebSphere Studio?

The answer is:D

   A. Use options under the File menu to load the desired projects as necessary.

  B. Load all the projects into the workspace and configure each with a unique name.

  C. Name the projects with a scheme that distinguishes them from each other.

  D. Separate the projects into two workspaces, one for each department's codebase.

 

15. A local home or component interface for an EJB can only be used by:

The answer is:C

  A. Another EJB

  B. A web-tier client

  C. A business logic-tier client

  D. A client located in the same JavaTM Virtual Machine (JVM)1

 

16. What type of enterprise bean is used to implement asynchronous invocation?

The answer is:E

  A.  javax.ejb.EnterpriseBean 

  B.  javax.rmi.Remote 

  C.  javax.ejb.SessionBean 

D.     javax.ejb.EntityBean

E.      javax.ejb.MessageDrivenBean

 

17. The bean class for an entity that uses the EJB 2.0 model of container-managed persistence:

The answer is:D

  A. Must implement java.io.Serializable

  B. Is only used for better integration with popular IDEs

  C. Must be abstract

  D. Must not be abstract

 

18. Describe MVC design pattern:

The answer is:B

A. View encapsulates business logic, model uses business result and presented to the user, controller controls all the interaction between the user and the application

B. Model encapsulates business logic, view uses business result and presented to the user, controller controls all the interaction between the user and the application

  C. Model encapsulates business logic, controller uses business result and presented to the user, view controls all the interaction between the user and the application

  D. Nonsense 

 

19. Describe the possible EJB clients:( select 3 answers)

The answer is:A B C

  A. Session Bean

  B. JSP

  C. Servlet

D.     Web browser

E.      Java stand-alone Application

 

20. The conversational states stateful session beans have can across multiple invocations?

The answer is:B

 A. True

 B. False

 

 

21. What are DTD and XML Schema, What are their responsibility?

DTD:文档类型定义.是文档内容的元信息.

XML SchemaDTD有相同的功能,符合XML语法,正在取代DTD.

 

 

22. What are differences between DOM parser and SAX parser?

DOMTree-based parse,是基于树结构的解析器。

SAXEvent-base parse,是基于时间的解析器。

 

 

23. Why we want to use namespace in XML ?

命名空间用来标识内容,应用程序有可能有二个文件拥有相同的标签表示不同的内容,命名空间可以用来防止冲突。

 

 

24. Describe the XML naming rules?

不能以数字开头。

不允许有空格。

不能包含XML等字样。

 

 

25. What is well-formed XML file? What is Validated XML file?

良构的XML文件符合以下条件:

    1) 标签必须成对。

    2) 一份文档必须包含一个根元素。

    3) 所有的开始标签和结束标签必须匹配。

    4) 空标签必须以“/>”结束。

    5) 标签必须嵌套正确。

    6) 元素名称大小写敏感。

    7) 所有的属性值必须位于单引号或双引号中。

    8) 在同一个开始标签或空标签澡属性不允许出现超过一次。

验证的XML文件符合以下条件:

1) 一份结构良好的文档只有当它包含一个合适的文档类型声明并且符合这份声明的约束时才是有效的。

    2) 所有有效的文档都是结构良好的,但结构良好的文档并不一定是有效的。

 

 

 26. What does SOA stand for? What are building blocks of SOA?

SOA: Sevice Oriented Architecture.

SOA的组成是envelop, head, body

 

 

27. Web services are self-contained, self-describing, modular applications that can be Published, Located, and Invoked across the Web?

 

 

28.What are three web service roles?

Service Provider, Service Broker & Service Request.

 

29. What are three types of web service?

静态的,动态的,混合的。.

 

30. What do SOAP, WSDL, and UDDI stand for?

SOAP——简单对象访问协议(Simple Object Access Protocol)

WSDL——Web服务描述语言

UDDI——统一查找、描述以及综合

 

31. List 5 static UML diagrams

Use case diagram

Class diagram

Object diagram

Component diagram

deployment diagram

 

 

32. List 4 dynamic UML diagrams

Sequence diagram

Collaboration diagram

State chart diagram

Activity diagram

 

 

33. Why Use Case is most important in OOAD?

Use Case图可直接关联Sequence图,Collabration,Activity,Class图,Component图,Deployment图。间接关联State chart图,Object图。是九个图的基础和关键。

 

 

34. List different relationships between classes in UML class diagrams

Association

Aggregation

Composition

Inheritance

 

 

35. What are differences between Activity diagram and State diagram.

State diagram:单一流程。

Activity diagram:支持并发事件。

你可能感兴趣的:(bean,Web,xml,ejb,service,application)