Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Macro substitution in c#
Message
From
13/07/2016 13:44:21
 
 
To
13/07/2016 10:51:07
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
01638288
Message ID:
01638335
Views:
62
One of my beefs with interfaces used to be HAVING to implement each method again in different branches whenever the interface was implemented again. Resulted sometimes in code duplication or unnecessary complicated breaking out into different structures/complex microstructures of services (example: common logging options for Kevins example with and without WCF not needing to be leveraged via another interface/class or operations like zipping common to both transfer mechanisms).

One of the nice enhancements in newer Java for me was the option to define a default implementation for interface methods. Has .Net gained this option as well ? Not only from my DRY enthusiast status, but also because it eliminated some of the britlleness in Java: old, high up interfaces can now be enhanced with new methods without breaking automatically all existing implementations, as those "new&defaulted" methods will not cause compiler errors pointing to missing implemention on all "new" methods.

curious

thomas

>Interfaces aren't used enough by most .NET devs. I'm working with junior devs on my team to help them learn how to use them. There's a really good Pluralsight course by Jeremy Clark that I highly recommend.
>
>
>>Dmitry/(and Viv)
>>
>>Before Generics came around, there were scenarios where reflection really helped. But the combination of generics and interfaces often reduces the # of instances where it's necessary. Using generics can mean giving a serious second look at a design, and it's usually worth it.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform