Chapter 3: Client Software Design Chapter goal: ■ Algorithm and issues Concurrency in client Client examples 哈工大计算机学院李全龙 Network Application Development Client Software Design 1
哈工大计算机学院 李全龙 Network Application Development Client Software Design 1 Chapter 3: Client Software Design Chapter goal: Algorithm and issues Concurrency in client Client examples
Chapter 3: Client Software Design Chapter goal: Algorithm and issues Concurrency in client Client examples 哈工大计算机学院李全龙 Network Application Development Client Software Design 2
哈工大计算机学院 李全龙 Network Application Development Client Software Design 2 Chapter 3: Client Software Design Chapter goal: Algorithm and issues Concurrency in client Client examples
Learning algorithm instead of details An application that uses TCP/IP must specify many details about the desired communication Knowing the low-level details of all possible socket functions and their exact parameters does not provide programmers with an understanding of how to build well-designed, distributed program general understanding of the functions used for network communication is important If the programmer knows what the program should do finding ouf how to do it is straightforward Although programmers need to understand the conceptual capabilities of the protocol interface, they should concentrate on learning about ways to structure communicating programs instead of memorizing the details of a particular interface 哈工大计算机学院李全龙 Network Application Development Client Software Design 3
哈工大计算机学院 李全龙 Network Application Development Client Software Design 3 Learning algorithm instead of details An application that uses TCP/IP must specify many details about the desired communication. Knowing the low-level details of all possible socket functions and their exact parameters does not provide programmers with an u n d erstandi ng of how to build well-designed, distributed program. General underst anding of the functions used for network communication is important. If the programmer knows what the program should do, finding out how to do it is straightforward. Although programmers need to understand the conceptual capabilities of the protocol interface, they should concentrate on learning about ways to structure communicating programs instead of memorizing the details of a particular interface
Client architecture Clients are conceptually simpler than servers Most client does not explicitly handle concurrent interaction with multiple servers Most client executes as a conventional app program Most client does not need to enforce protections 哈工大计算机学院李全龙 Network Application Development Client Software Design
哈工大计算机学院 李全龙 Network Application Development Client Software Design 4 Client architecture Clients are conceptually simpler than servers. Most client does not explicitly handle concurrent interaction with multiple servers. Most client executes as a conventional app program. Most client does not need to enforce protections
Identify a server Several methods to find a server s Ip address and protocol port number Domain name or ip address as a constant in program Requiring user to identify: From stable storage Using a separate protocol to find Allowing the user to specify a server address when invoking client software makes the client program more general and makes it possible to change server ocations Building client that accepts a server address as an argument makes it easy to build extended versions of the software that use other ways to find the server address 哈工大计算机学院李全龙 Network Application Development Client Software Design 5
哈工大计算机学院 李全龙 Network Application Development Client Software Design 5 Identify a server Several methods to find a server’s IP address and protocol port number: Domain name or IP address as a constant in program; Requiring user to identify; From stable storage; Using a separate protocol to find; Allowing the user to specify a server address when invoking client software makes the client program more general and makes it possible to change server locations. Building client that accepts a server address as an argument makes it easy to build extended versions of the software that use other ways to find the server address