Giter Site home page Giter Site logo

jasonbock / dynamicproxies Goto Github PK

View Code? Open in Web Editor NEW
8.0 5.0 4.0 63 KB

This is an assembly that creates proxy classes on-the-fly using the Reflection.Emit API. Generics are supported.

License: Microsoft Public License

C# 96.36% Smalltalk 1.75% Visual Basic .NET 1.89%

dynamicproxies's Introduction

dynamicproxies's People

Contributors

jasonbock avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

dynamicproxies's Issues

Check Opcodes for Short Form Usage

I don't think I'm being as aggressive as I can be with using "short form" opcodes. I need to review the emitting code to see if there's any places for this kind of optimization.

Support a Group of Interfaces

Change Proxy.Create() to take a List<> (or array) of interfaces. Create a proxy that implements all interface members (and handle collisions among the interfaces gracefully).

Consider Overriding Finalizers

Since finalizers can be overriden, consider having the proxy override them if it sees them.

I think I do this by default anyway, but I should investigate if this should continue to work this way, and if this should be added to the ProxyContext object as a configurable flag.

Support Abstract Types

Self-explanatory. If Proxy.Create() gets an abstract type, create a proxy for it. Add before/after calls for abstract methods, but no-op the implementation in the proxy subclass (return the default value if the method has a return value).

Address Serializable Types

I.e. I'm giving a Serializable type, how do I effectively implement that in the dynamic type? And if that's serialized, how (if it can) does it get deserialized into the base class type? Need to (probably) mark the wrapped object and handler fields as [NotSerializable].

Use the Compiler API to Generate Proxies

It would be interesting to see if using the Compiler API to generate the proxy objects would be an overall "better" experience. Basically do what Rocks does: generate the proxy class via C# (as a string) and then compile/emit. That would probably be slower than doing direct IL generation, but it would make the overall process cleaner and easier (and it would also make it far easier to debug).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.