Skip to content
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

Impact of c# 8 extensions on design #37

Open
farlee2121 opened this issue Apr 5, 2019 · 2 comments
Open

Impact of c# 8 extensions on design #37

farlee2121 opened this issue Apr 5, 2019 · 2 comments
Labels
question Further information is requested

Comments

@farlee2121
Copy link
Owner

https://adrientorris.github.io/csharp/what-i-get-from-the-preview-of-csharp-8-with-Mads-Torgersen.html#extension_everything
dotnet/csharplang#110

C# will get extensions to instances that can add properties, instance methods, etc.
It may also get Type Classes (like interfaces, but instead of being part of the type definition it is more verified that the class fits the constraint)

What does this mean for my design?

Could I use extension to mimic AOP without dynamic proxies? I.e. extend all types with a log function. These log functions can be maintained separately and different ones can be used based on what log assembly is included? Hmm. This has a hole that I still need funnel info to the logger, which would require to accept the right info to pass on....

Anyway. Questions like that

@farlee2121
Copy link
Owner Author

farlee2121 commented Apr 5, 2019

It is worth noting that I the new asp.net logging paradigm is closer to what I want. It automagically injects a generic logger instantiated for the right type. I could plug into that to extend specific logger types with convenient logging functions. Not as transparent as AOP, but still a nicer logging paradigm

@farlee2121
Copy link
Owner Author

TypeClasses / Concepts may enable easier test data generation like in clojure, which generates for all values allowed by type constraints (i.e. can say this field is an in 0 to 10).

@farlee2121 farlee2121 added the question Further information is requested label Apr 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant