I'm trying to avoid hand-coding gnarly model definitions. For example, say I need to deserialize an object from a collection that I didn't create. Is there a recommended approach?
I have a sub-optimal proto-solution here. I was curious to see just how dynamic I could make it. I used objectWeb's ASM to dynamically generate a case class at runtime, but had to resort to a class hierarchy so I could use the concrete class type of the parent as a type parameter for the grater. I'd rather not use a hierarchy, but I'm currently limited because the dynamic class appears to be loaded as `Class[?0]`, and I don't know how to properly type it. I wish I knew more about how Salat used Product and ScalaSig, because both appear accessible to me in the Dump.scala files that generate the case class bytecode.
So to reiterate,
- Do y'all ever need to generate case classes? How do you do it?
- Is what I want to do totally unsafe and heinous and I just don't know better?
- Is there a way to properly type my dynamically loaded class without using a hierarchy?
Thanks very much for your input,
-Julian