問題文
A uniform supplier has four reuse requirements: keep callers unchanged as new carrier implementations are added, share common behavior between implementations that differ in one step, let an administrator register a new implementation without a code change, and let another package call in. Which set of techniques matches them?
選択肢
- An interface for the stable callers, an abstract class for the shared behavior, a configuration record plus resolving the class by name for the registration, and the common callable interface for the cross-package call.
- An interface for all four, because every one of the four requirements is ultimately about calling something without knowing its concrete type.
- An abstract class for the stable callers, an interface for the shared behavior, resolving the class by name for the registration, and a platform event for the cross-package call, so each of the four requirements is answered by one construct.
- An interface for the stable callers, an abstract class for the shared behavior, a configuration record plus resolving the class by name for the registration, and a global class with public methods for the cross-package call, because declaring the class and its methods as visible outside the package is what lets another package compile against it.