Personal tools
Document Actions

#1: Adapt based on class

Contents
  1. Definitions
  2. Motivation
  3. Assumptions
  4. Proposal
  5. Implementation
  6. Deliverables
  7. Risks
  8. Progress log
  9. Participants
by Dan Fairs last modified 2007-06-25 13:41
Allow adapters to be registered for a set of classes, not just a set of interfaces.
Proposed by
Dan Fairs
Proposal type
New functionality
Assigned to release
State
completed

Definitions


Motivation

Currently, you need to have an interface implemented by an object which is to be adapted for adaptation to work. It should be possible to register an adapter for a class, like this:

registry.Register(typeof(Object), typeof(IProvidesInterface), typeof(Adapter));

This example would register an adapter type Adapter as an adapter for objects of class Object to interface IProvidesInterface.


Assumptions

In the example above, we register an adapter for type Object. This will adapt only instances of Objects. Allowing this registration to apply for all other object subclasses (ie. all objects) is out of scope of this proposal.

Proposal

  • Allow registration of object types as well as interface types as adaptees
  • Extend lookup logic to consider object registrations as well as interface registrations

Implementation


Deliverables


Risks


Progress log


Participants



Powered by Plone CMS, the Open Source Content Management System

This site conforms to the following standards: