'. '

Adaptable

From APIDesign

(Difference between revisions)
Jump to: navigation, search
(New page: A pattern to support meta-morphosis of an object into another. In its simplest incarnation it can take form of a single method: <source lang="java"> <T> T reincarnate(Class<T> type); </so...)
Current revision (05:36, 21 April 2009) (edit) (undo)
 
Line 8: Line 8:
More advanced implementation of the same concept can be found in the [[Lookup]] library. It supports multiple results, notification of changes, etc.
More advanced implementation of the same concept can be found in the [[Lookup]] library. It supports multiple results, notification of changes, etc.
 +
 +
[[Category:APIDesignPatterns]]
 +
[[Category:APIDesignPatterns:Evolution]]

Current revision

A pattern to support meta-morphosis of an object into another. In its simplest incarnation it can take form of a single method:

<T> T reincarnate(Class<T> type);

The method either return instance of the given type, or null if the caller cannot be converted into given object.

More advanced implementation of the same concept can be found in the Lookup library. It supports multiple results, notification of changes, etc.

Personal tools
buy