-
Notifications
You must be signed in to change notification settings - Fork 1k
[Server] Add several interfaces to improve testability & prepare for Dependency Injection #3448
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…nager, IStandardServer, IApplicationInstance interfaces to Server. Add IMainNodeManagerFactory to create Diagnostics & MainNodeManager
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request adds several interfaces to improve testability and prepare for Dependency Injection in the OPC UA .NET Standard Server implementation. The changes introduce interface abstractions for key server components including StandardServer, MasterNodeManager, and various NodeManager types.
Changes:
- Added six new interfaces: IStandardServer, IMasterNodeManager, IMainNodeManagerFactory, ICoreNodeManager, IDiagnosticsNodeManager, and IConfigurationNodeManager
- Modified existing classes to implement these new interfaces
- Changed return types from concrete classes to interfaces in multiple methods
- Added IApplicationInstance interface for ApplicationInstance class
- Introduced MainNodeManagerFactory to support factory-based instantiation
Reviewed changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated 29 comments.
Show a summary per file
| File | Description |
|---|---|
| Libraries/Opc.Ua.Server/Server/IStandardServer.cs | New interface defining the standard server contract |
| Libraries/Opc.Ua.Server/Server/StandardServer.cs | Implements IStandardServer, adds factory creation pattern for node managers |
| Libraries/Opc.Ua.Server/NodeManager/IMasterNodeManager.cs | New interface for master node manager with comprehensive API surface |
| Libraries/Opc.Ua.Server/NodeManager/MasterNodeManager.cs | Implements IMasterNodeManager, uses factory for creating core node managers |
| Libraries/Opc.Ua.Server/NodeManager/IMainNodeManagerFactory.cs | New factory interface for creating main node managers |
| Libraries/Opc.Ua.Server/NodeManager/MainNodeManagerFactory.cs | Factory implementation for creating ConfigurationNodeManager and CoreNodeManager |
| Libraries/Opc.Ua.Server/NodeManager/ICoreNodeManager.cs | New interface for core node manager |
| Libraries/Opc.Ua.Server/NodeManager/CoreNodeManager.cs | Implements ICoreNodeManager, fixes lock usage, makes ImportNodes public |
| Libraries/Opc.Ua.Server/Diagnostics/IDiagnosticsNodeManager.cs | New interface for diagnostics node manager |
| Libraries/Opc.Ua.Server/Diagnostics/DiagnosticsNodeManager.cs | Implements IDiagnosticsNodeManager, changes method visibility |
| Libraries/Opc.Ua.Server/Configuration/IConfigurationNodeManager.cs | New interface for configuration node manager |
| Libraries/Opc.Ua.Server/Configuration/ConfigurationNodeManager.cs | Implements IConfigurationNodeManager |
| Libraries/Opc.Ua.Server/Server/IServerInternal.cs | Adds MainNodeManagerFactory and ConfigurationNodeManager properties, uses interface types |
| Libraries/Opc.Ua.Server/Server/ServerInternalData.cs | Uses interface types, adds MainNodeManagerFactory support |
| Libraries/Opc.Ua.Configuration/IApplicationInstance.cs | New interface for application instance |
| Libraries/Opc.Ua.Configuration/ApplicationInstance.cs | Implements IApplicationInstance, uses IServerBase |
| Tests/Opc.Ua.Client.Tests/ReferenceServerWithLimits.cs | Updates CreateMasterNodeManager to return interface type |
| Libraries/Opc.Ua.Gds.Server.Common/GlobalDiscoverySampleServer.cs | Updates CreateMasterNodeManager to return interface type |
| Applications/Quickstarts.Servers/Utils.cs | Updates method signatures to use IStandardServer |
| Applications/Quickstarts.Servers/ReferenceServer/ReferenceServer.cs | Updates CreateMasterNodeManager to return interface type |
Proposed changes
Add IConfigurationNodeManager, IDiagnosticsNodeManager, IMasterNodeManager, IStandardServer, IApplicationInstance interfaces to Server. Add IMainNodeManagerFactory to create ConfigurationNodeManager & CoreNodeManager.
Types of changes
Checklist