Friday, May 15, 2020

Re: how to run gwt newer version in netbeans

thank you Dr. Lofi for your quick response. the presentation is very helpful.

but there are few hurdles in using maven:

1. the team has expertise in netbeans. they don't now how to use maven. to use it first we have to arrange the training sessions.
2. company do not allow to move the code out of the company premises. they want the whole code to be kept only on there company server.
   
again I request, is there any way that we could continue netbeans. 


secondly! as you said never mix client- and server-side.
can you share any small example where we could see how we can keep client and server-side separately in gwt. 
because we are using the base architecture of gwt: 

example: 

-demo.home.client 
  -Home.java

-demo.home.server
  -Home_ServerImpl.java

-demo.home.shared
  -Home_Model.java
  -Home_RemoteService.java
  -Home_AsyncService.java


demo.home.shared.Home_RemoteService.java (class)
public interface Home_RemoteService extends RemoteService {

    public List<Home_Model> getHome(String id, boolean flag);
}

demo.home.shared.Home_AsyncService.java (class)
public interface Home_AsyncService {

    public void getHome(String id, boolean flag, AsyncCallback<List<Home_Model>> result);
}

demo.home.shared.Home_Model.java (class)
public class Home_Model implements Serializable, IsSerializable {

    private String name, address, ............;
    
    public getter & setters ............;

}

demo.home.server.Home_ServerImpl.java (class)
public class Home_ServerImpl extends RemoteServiceServlet implements Home_RemoteService {

    @Override
    public List<Home_Model>> getHome(String id, boolean flag) {
           ........................;
           ........................;
           ........................;
           ........................;
           return listHome_Model;

}

demo.home.client.Home.java (class)
public class Home implements IsWidget, ClickHandler {

    private final ServiceInvoker<Home_AsyncService> srvAsync;

    public Home() {
        srvAsync = new ServiceInvoker<Home_AsyncService>(GWT.create(Home_RemoteService.class), "Home");
    }

    public button_click() {

        srvAsync.getHome(id, flag, new AsyncCallback<List<Home_Model>>() {

                    @Override
                    public void onFailure(Throwable caught) {
                        ......................;
                        ......................;
                    }

                    @Override
                    public void onSuccess(List<Home_Model> result) {
                        ......................;
                        ......................;
                        ......................;
                        ......................;
                    }
         });
    }
}
 


* we have many Home_Model.java like classes which hold many common functions that we use both server & client side.

please suggest the architecture to separate the client & server side code in GWT. 



On Saturday, May 16, 2020 at 3:53:03 AM UTC+5:30, Dr. Lofi Dewanto wrote:
I would prefer just using:

(1) Maven for everything, never depends on IDE plugins, you can use GWT Maven plugin to run the transpiler and serve the HTML + JS files, no need to use plugin. 
(2) For debugging I'm using Chrome and it has a very good source map debugger.
(3) Best practice, never mix client- and server-side. Make a stand-alone Maven project for your client-based webapp / webbrowser.

Take a look at this presentation for the anatomy of GWT webapps: https://bit.ly/gwtintropresentation

Hope this helps,
Lofi

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-web-toolkit/631e9f09-5cf1-4548-a7f2-9cff4ea5fca6%40googlegroups.com.

No comments:

Post a Comment