I write a RIA application and my JPA beans must be decoded to push it in Store. My decisions are:
Brute Force. If I have property 'aProp' in bean (and getter/setter for it) i create RecordDef, then Record, then Recrod.set('aProp', bean.getAProp()) and 开发者_运维技巧so on.. (it is terrible)
I can write generator for creating a Factory of Records (it is my desision and i write it). For example:
RecordFactory<User> factory = GWT.create(User.class); //User is entity
I now that i need a reflection, BUT GWT have no implementation of reflection (some libraries emulates this, but they builds on generators)
Exists the best way?
Thanks, Den Bardadym.
I go with method 1) but generate it. I know, it's ugly - but it's easy, proven and it works.
精彩评论