Exam3 (EJB, XML, Web service, OOAD)

1. What does the EJB specification architecture define?

The answer is: D<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

  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:支持併發事件。

發佈了15 篇原創文章 · 獲贊 16 · 訪問量 15萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章