[dotnet] [bidi] Hide Broker as internal implementation#16982
[dotnet] [bidi] Hide Broker as internal implementation#16982nvborisenko merged 1 commit intoSeleniumHQ:trunkfrom
Conversation
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
||||||||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||||||||||||
User description
This pull request refactors the
BrokerandBrowserModuleclasses in the BiDi WebDriver implementation, focusing on improving encapsulation and simplifying the command execution interface. The most significant changes include making theBrokerclass internal, consolidating subscription methods, and updating theBrowserModuleto use its own command execution method instead of delegating to theBroker.💥 What does this PR do?
Encapsulation and API Surface Changes
Brokerclass frompublictointernalto restrict its usage to within the assembly, improving encapsulation.Command Execution Refactoring
BrowserModuleto use its ownExecuteCommandAsyncmethod instead of callingBroker.ExecuteCommandAsync, simplifying the module's interface and reducing coupling.Subscription API Simplification
SubscribeAsyncmethod inBrokerthat accepted delegates (Action<TEventArgs>andFunc<TEventArgs, Task>), consolidating to a single version that takes anEventHandler. This reduces API surface and potential confusion.🔄 Types of changes
PR Type
Enhancement
Description
Made
Brokerclass internal to restrict public API surfaceConsolidated subscription methods in
Brokerby removing delegate overloadsAdded protected helper methods in
Modulebase class for command execution and subscriptionsUpdated all module implementations to use inherited methods instead of direct
BrokercallsFixed typo: "occured" to "occurred" in error messages
Diagram Walkthrough
File Walkthrough
1 files
Made Broker internal and consolidated subscription API12 files
Added protected helper methods for command executionUpdated to use inherited ExecuteCommandAsync methodReplaced Broker calls with inherited module methodsUpdated command execution to use module methodsReplaced Broker method calls with inherited methodsUpdated subscription calls to use module methodsReplaced all Broker calls with inherited methodsUpdated to use inherited ExecuteCommandAsync methodReplaced Broker method calls with inherited methodsUpdated command execution to use module methodsReplaced Broker calls with inherited methodsUpdated to use inherited ExecuteCommandAsync method