steve wrote:
You realize those tests are actually two distinct ways to acheive the same thing, right? I don't understand how either of those approaches is anything different or more complex than what you suggest with "instantiation engine".
Yes, I realize we're always talking about entity-name.
The fact is that I'm used to my framework approach of dependency injection and inversion of control, and I tend to think that programming by interfaces is more flexible.
So in my mind I was trying to achieve that with Hibernate : mapping an interface, and letting the developer choose the implementation for each customized installation.
I understand that this is not necessarily possible out-of-the-box, and I'm implementing the entity-name approach in my framework right now.
If the entity-name solution worked in both ways (entity-name -> class, class -> entity-name) my approach would have been succesful; but I see that is not possibile, probably because while the entity-name is unique, you could re-use the same class for more than one entity.
Since customization is my primary concern (well, making it the most cheap possibile, it is), I always use a Factory-based approach.
Regards,
Giulio