For example:

[Bridge(TypeToBridgeTo)]
Class abridge : BaseClass, Interface1, … InterfaceN
{
}

This would automatically:

  • Create a private instance of type ‘TypeToBridge’
  • Create accessors for that instance (a get property to retrieve the instance)
  • Automatically generate methods into the abridge class that when called defer into the ‘TypeToBridgeTo’ instance
  • Automatically call the default constructor on the bridged type
  • Allow declaration on alternate constructor to call through attributes
  • Allow overriding of automatically generated methods in the class declaration, and the ability to call default methods.
Perhapsthis could be done better through an alternate syntax with attributes,and code injection, and there would most likely need to be come kind ofruntime initializer that would scan for classes with this attribute andautomatically inject the methods into the class at runtime, and thiscould also be an interesting parallel to AoP.