Consider an application that must select dynamically an encryption algorithm based on security requirements and computing time constraints. Which design pattern would you select? Draw a UML class diagram depicting the classes in the pattern and justify your choice.

What will be an ideal response?

A strategy pattern can be used to address this problem. The EncryptionAlgorithm interface defines the common

interface that all encryption algorithms must comply with. A Policy class selects a concrete algorithm based on the

computing time constraints and the security requirements of the application. The Client interacts only with the

Context interface which stores the reference to the concrete algorithm.



Computer Science & Information Technology

You might also like to view...

When users enter currency values as criteria, they do NOT need to type the dollar sign

Indicate whether the statement is true or false

Computer Science & Information Technology

Use citations to credit information sources and avoid ____.?

A. ?ethics B. ?principles C. ?property rights D. ?plagiarism

Computer Science & Information Technology