확장 메서드가 포함 된 네임 스페이스를 참조하여 클래스에 코드를 삽입하여 일부 인터페이스의 기본 클래스 구현을 시뮬레이션 할 수 있습니까? 아니면 이것이 가능하지 않더라도 나쁜 관행으로 간주됩니까?확장 메소드를 사용하여 클래스에 'Inject'구현을 구현하여 인터페이스를 구현 하시겠습니까?
Imports MyApp.Extensions
Class SomeClass : Inherits System.SomeBaseClass : Implements MyApp.IAppInterface
End Class
Public Interface IAppInterface
Sub InterfaceMethod()
End Interface
Namespace MyApp.Extensions
Public Module SomeClassExtensions
Public Sub InterfaceMethod(ByVal someClass as MyApp.SomeClass)
//Implementation
End Sub
End Module
End Namespace
아니요, 불가능합니다. – Josh