Original Post
just looking to pick some brains here for an 'elegant' solution. problem: A resource manager deals out serializable 'handles' to resources. the handles themselves only store a string to the resource they refer to, and keep track of which resource manager they're associated w/ so that it can retrieve the resource. There are two seperate resource managers for static Images, and Animated Sprites. I'm writing a tile-based map editor, for which I want tiles to be able to be represented by either Images, or Animated Sprites. However in the tile class, storing a handle of each type, and enforcing checks to make sure only one is ever valid, doesn't seem like a clean or 'elegant' solution. I believe some form of abstraction is needed here, but I do not want to violate the rules of encapsulation. I'm using Java, so any solution involving multiple inheritance will not work :( any help?