You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The change in NLog 4.0 was unwanted breaking. We need to fix this:
The problem:
WcfLogReceiverClientFacade won't inherit from ClientBase<...>. But in 3.2.0 WcfLogReceiverClient was returned, and this class did implement ClientBase<...> (which contains 'EndpointandClientCredentailsproperties). Thus: WcfLogReceiverClientFacade should inherit fromClientBase<..>`. But this is difficult to fix. We have to find a good solution for this.
The class WcfLogReceiverClientFacade introduced in 4.0 (#565), contains unwanted stuff:
there is a lot of code duplication in the constructors
every property is implemented with the same if-else constructions
there are two properties, m_twoWayClient and m_oneWayClient and there is always only one used, hence, it should be one property.
there are some Hungarian names. e.g. m_oneWayClient should be without the prefix m_.
ILogReceiverClient and ILogReceiverOneWayClient are almost identical
WcfLogReceiverClient and WcfLogReceiverOneWayClient are code duplication?
Solutions:
We should clean this up and create one factory method with do the if (useOneWay) check. It should return an interface and only that interface should be used in the rest of the class.
I just finished doing it in my fork. Can you take a look? I'm not sure how things should be named. I just used "V2" but I'll change it to something else if you want to.
I restarted from the original code and added the method to the client interface. For the server interface, I inherited the original interface and added the new method. The target kept its parameter to indicate which method to use.
There is however one possibility in which the changes could break old code, it is if someone was inheriting directly the client interface, they would have to implement the new method for the code to compile. I tried to make it work with two client interfaces, but I get errors with the .config file that I have not managed to fix yet.
Fix backwardscompatiblity with 3.2
The change in NLog 4.0 was unwanted breaking. We need to fix this:
The problem:
ClientBase<...>
. But in 3.2.0WcfLogReceiverClient
was returned, and this class did implementClientBase<...>
(which contains 'Endpointand
ClientCredentailsproperties). Thus: WcfLogReceiverClientFacade should inherit from
ClientBase<..>`. But this is difficult to fix. We have to find a good solution for this.See: #783 and #561
Refactor or remove WcfLogReceiverClientFacade
The class
WcfLogReceiverClientFacade
introduced in 4.0 (#565), contains unwanted stuff:m_twoWayClient
andm_oneWayClient
and there is always only one used, hence, it should be one property.m_oneWayClient
should be without the prefixm_
.ILogReceiverClient
andILogReceiverOneWayClient
are almost identicalWcfLogReceiverClient
andWcfLogReceiverOneWayClient
are code duplication?Solutions:
if (useOneWay)
check. It should return aninterface
and only that interface should be used in the rest of the class.code: https://github.com/NLog/NLog/blob/master/src/NLog/LogReceiverService/WcfLogReceiverClientFacade.cs
The text was updated successfully, but these errors were encountered: