M
M
Maxim2013-04-16 20:59:54
Java
Maxim, 2013-04-16 20:59:54

GWT - working with server classes?

There is a DAO layer.
There are classes in the gwt.client package that duplicate model classes from DAO.
How to properly, easily and naturally ensure their interaction during the request?
Those. when requested, turn the array of objects returned by the DAO service classes into an array of class objects from gwt.client, for use in the interface.
How to eliminate (or reduce) duplication of client and server code?
PS
I apologize for the confusion, if it's not clear, I'll try to rephrase the question.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
asm0dey, 2013-04-16
@asm0dey

Option 1 - RequestFactory. Requires satellite interfaces.
Option 2 (I choose this one) - all model classes are in shared, when objects are returned, they are run through the dozer. It has a special config for hibernate. In order not to resolve uninitialized collections, there is a special mapper in one line. I can give you the code.
Well, do not forget about the right patterns - MVP represented by gwt-platform, for example.

B
bazarnazar, 2013-04-17
@bazarnazar

Maybe I didn’t quite understand the problem, but maybe this post of mine will help you: habrahabr.ru/post/154321/

M
Maxim, 2013-04-17
@mgramin

Thanks for the good advice.
I use MyBatis, but I would be very grateful for the code.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question