Skip to content
This repository was archived by the owner on Mar 16, 2026. It is now read-only.
This repository was archived by the owner on Mar 16, 2026. It is now read-only.

Impact of c# 8 extensions on design #37

Open

Description

@farlee2121

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

Activity

  1. farlee2121 commented on Apr 5, 2019

    @farlee2121
    OwnerAuthor

    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

  2. farlee2121 commented on Apr 5, 2019

    @farlee2121
    OwnerAuthor

    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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions