Java For Artists: The Art, Philosophy, And Science Of Object-Oriented Programming
Self-Test Questions
1. | What is a computer network? What is the primary purpose of a computer network? | |
2. | Describe the two types of computer networking environments. | |
3. | Describe the purpose of the TCP/IP Internet networking protocols. | |
4. | What’s the difference between the terms server and server application? Client and client application? | |
5. | Describe the relationship between a server application and client application. | |
6. | List and describe at least two ways network applications can be distributed? | |
7. | What term is used to describe a server application that can handle multiple simultaneous client connections? | |
8. | What term is used to describe a network application logically divided into more than one functional layer? List and describe the purpose of three possible functional layers. | |
9. | List and describe the purpose of the layers of the Internet protocol stack. Describe how data is transmitted from one computer to another via the Internet protocols. | |
10. | What’s the difference between TCP and UDP? | |
11. | What services does IP provide? | |
12. | Describe a client-server network application connection scenario. Focus on the purpose and use of the classes ServerSocket, Socket, and the I/O stream classes InputStream & OutputStream. | |
13. | In what way does the URL class simplify network programming? | |
14. | Describe in general terms how Java’s Remote Method Invocation (RMI) works. | |
Answers
1. | - The primary purpose of a computer network is resource sharing. A resource can be physical (i.e. a printer or a computer) or metaphysical (i.e. knowledge or data). |
2. | - homogeneous; heterogeneous |
3. | - Transmission Control Protocol (TCP) and Internet Protocol (IP) — collectively referred to as TCP/IP, have emerged as the standard network protocols through which different types of computers can talk to each other. |
4. | - The term server refers to the hardware on which a server application (software) runs; The term client refers to the hardware on which a client application (software) runs. |
5. | - A server application provides one or more services to a client application. |
6. | - Logically and physically |
7. | - multithreaded |
8. | - multitiered (or multilayered); data access tier, mission tier, presentation tier |
9. | - Application layer, transport layer, network layer, data link and physical layers |
10. | - TCP guarantees packet delivery whereas UDP does not |
11. | - The Internet Protocol (IP) is a connectionless service that permits the exchange of data between hosts without a prior call setup. |
12. | - a Socket object is used to connect to a ServerSocket object which is listening on a specified host and port. When the ServerSocket object detects an incoming client connection the accept() method will return a Socket object that can be used to communicate between server and client applications. |
13. | - It hides the messy details of socket programming. |
14. | - An RMI service is created and registered to run on a server via the RMI registry. Stub classes are generated for the service and deployed with the client. The client gets a reference to the remote object using the Naming.lookup() method. |
Категории