开发者

Gwt-ext. Bean to record and record to bean

I write a RIA application and my JPA beans must be decoded to push it in Store. My decisions are:

  1. 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)

  2. 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

  3. 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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜