Posts Tagged: generics


20
Jan 07

Generic polymorphism using wildcards

This morning I started thinking about advanced usage of generics to implement polymorphic types. The idea came from the thoughts of doing dynamic runtime binding to a generic collection of types that are bound from some XML representation and not known at runtime. I found a few pieces of information on the web, but those did not provided very clear examples. I thought I’d put together a small use case. I’m currently very busy with something I must finish this weekend, though I won’t provide a very thorough explanation. I’m posting code with comments and will provide a thorough examination of how this is implemented sometime next week. This code also doesn’t demonstrate dynamic binding which I’ll implement with JiBX.

The domain model is a rudimentary encapsulation of the ODM data model, but is only used for demonstration purposes.

Well here it goes…