NathanWolf / BukkitPlugins

My plugins for the Bukkit Minecraft server
mine.elmakers.com
14 stars 7 forks source link

Allow for overriding persisted classes #39

Open NathanWolf opened 13 years ago

NathanWolf commented 13 years ago

When binding to a persisted class, Persistence should check up the class hierarchy for other persisted classes.

From there, they can just be handled like invisible contained objects.

NathanWolf commented 13 years ago

This is pretty far down on the TODO list now, I think.

Anybody really need to extend their DAOs?

Hm, I guess I could be doing it with NetherPlayer and NetherWorld ... maybe it's not such a bad idea.

NathanWolf commented 13 years ago

Wow, this:

http://en.wikibooks.org/wiki/Java_Programming/Annotations/Meta-Annotations#Inherited

I stumbled upon while trying to fix an odd issue (I can't use a persisted class from a library?? Why not? It acts like the annotations aren't there.... hrm...)

Anyway, I don't have time to really play with this now, but if I'm reading this right it means I can just add @Inherited to PersistField, and it tremendously simplifies supporting persisted ineritence- the fields themselves will just work!

Hell, i need to really think about it, but that might be all I need to even do... since each class would get its own PersistedClass with it's own cache table, and instances get looked up based on actual type- so as long as you don't try to get an instance of a class by using its base class (which should be ok, really, and maybe I could implement that eventually) ... well, it might Just Work.

Man, I really want to try this out now.... giving this issue a serious bump to at least test this out a bit when I get a chance... after I fix this lib issue, or at least bail on Gameplay for the time being so I can post a fixed NetherGate. :\