OK, now I understand you 😉

Yes, we always have to separate the Client and the Server part. This is 
also GWT best practice.

But if you are using JavaScript on browser you lose the advantages like:

   1. We use *Java* as the language
   2. We have the best *ecosystem* like libraries, frameworks, build system 
   and IDEs.
   3. We know best design patterns to make our apps maintainable like 
   Dependency Injection, Mock Testing and many other just take a look at: 
   http://bit.ly/DesignPatternsJava
   4. … and if you use Java on the server-side with *Spring Framework* or 
   *JavaEE* you have *one language* through the whole stack. So, you could 
   reuse Validation APIs, Business Rules, Business Model, etc. from server to 
   client.

I've built this sample project: 
https://github.com/gwtboot/domino-rest-enum-date to show some reuse for 
Client and Server and I plan to write more articles on this topic: 
Dependency Injection, Mocking Test, Validation API, Business Rules - all 
from Server to Client.

This type of reuse cannot be done if you are using JavaScript / TypeScript 
on the web browser...

Thanks,
Lofi
rmr...@gmail.com schrieb am Montag, 28. September 2020 um 23:20:23 UTC+2:

> If the server part is a Java servlet that handles REST calls, there is no 
> need for GWT at all. No need to deal with JSInterop and no need to deal 
> with annotations, that's cleaner code!
>
> If you have a server that exposes a REST API, you can write the client in 
> anything. JavaScript is great in the browser and TypeScript improves the 
> coding experience while sharing direct use of JavaScript libraries.
>
> Running a Java client in the browser implies extra steps and 
> complications. First and foremost, you can't mix Java and JavaScript 
> libraries without wasting a lot of time with compatibility layers. That is, 
> at least for me, the greatest advantage of using JavaScript in the browser. 
>
> The number of libraries available for JavaScript outnumbers by orders of 
> magnitude the available libraries you can use with Java in the browser. 
>
> Java is a very useful language, but it's not the best one for writing code 
> that runs in a web browser.
>
> Regards,
> Rodolfo
>
>
>
>
>
> On Mon, Sep 28, 2020 at 5:55 PM lofid...@gmail.com <lofid...@gmail.com> 
> wrote:
>
>> I'm not sure whether I follow you... what is the difference using Java / 
>> GWT + REST and TypeScript + REST... The server part is the same. The web 
>> browser part is also the same. The difference is only the language and 
>> ecosystem you use on the web browser...
>>
>> Thanks,
>> Lofi
>>
>> rmr...@gmail.com schrieb am Montag, 28. September 2020 um 18:02:03 UTC+2:
>>
>>> Hi Lofi,
>>>
>>> I once used GWT + Electron + Materialize running with Jetty. That 
>>> worked, but after getting rid of GWT the code was much cleaner. 
>>>
>>> Class com.sun.net.httpserver.HttpServer is more than enough for running 
>>> a Java server with REST interface on the desktop. 
>>>
>>> Another advantage of moving away from GWT is that I don't need to work 
>>> with JSInterop and things that require annotations in the Java code. 
>>> Creating a REST servlet in plain Java is quite straightforward.
>>>
>>> Regards,
>>> Rodolfo
>>>
>>>
>>>
>>> On Mon, Sep 28, 2020 at 12:46 PM lofid...@gmail.com <lofid...@gmail.com> 
>>> wrote:
>>>
>>>> Hi Rodolfo,
>>>>
>>>> thanks a lot for the feedbacks!
>>>>
>>>> TypeScript is not bad. After all it's coming from Anders Helsjberg 
>>>> creator of Turbo Pascal, Delphi, VisualJ++, C#. He is a great language 
>>>> designer... 😉
>>>>
>>>> But actually you could use GWT to build an Electron app as you don't 
>>>> need to have a Java server for the transpiled code... or did you have 
>>>> something extra?
>>>> *@Frankhossfeld* told me that he has done Electron app with GWT, very 
>>>> easy 😉 Maybe he could elaborate here...
>>>>
>>>> I never use GXT but I've used GWTBootstrap3 (Open-Source) and actually 
>>>> it was very easy to use, quite the same with using the integrated GWT 
>>>> widgets. Today Dmitrii has migrated *GWTBootstrap3 to Elemental2* (
>>>> https://github.com/treblereel/gwtbootstrap3). And the cool thing is 
>>>> that for the app devs, it doesn't change anything. You could use the same 
>>>> components and nothing has changed, only deep in the framework itself it 
>>>> uses Elemental2 instead the older technology... Maybe *@Dmitrii* could 
>>>> elaborate this...  
>>>>
>>>> Thanks,
>>>> Lofi
>>>>
>>>>
>>>>
>>>> rmr...@gmail.com schrieb am Montag, 28. September 2020 um 12:36:03 
>>>> UTC+2:
>>>>
>>>>> Hello Lofi,
>>>>>
>>>>> Java + GWT + GXT + Eclipse was my main toolkit for over a decade. When 
>>>>> Sencha went crazy with the price of license renewals, I started looking 
>>>>> for 
>>>>> alternatives.
>>>>>
>>>>> Today my toolkit has changed to Java for backend/server side, 
>>>>> TypeScript for client side and Visual Studio Code for code development. 
>>>>> Communication between Java server and TypeScript UI is handled via REST 
>>>>> interface.
>>>>>
>>>>> Now I'm free to choose any UI style I like, my code has simplified a 
>>>>> lot and there is a clearer separation between server and client code. 
>>>>> There 
>>>>> are no license costs and I don't have to deal with GWT and GXT, except 
>>>>> for 
>>>>> an old project I still have to maintain.
>>>>>
>>>>> The switch to JavaScript/TypeScript gave me a huge advantage: now I 
>>>>> can use ElectronJS to create cross-platform desktop apps that are 
>>>>> actually 
>>>>> web apps running on a local Java server.
>>>>>
>>>>> I don't regret moving away from GWT + GXT. Actually, I'm quite happy 
>>>>> with the refreshed coding experience.
>>>>>
>>>>> Regards,
>>>>> Rodolfo M. Raya
>>>>>
>>>>>
>>>>> On Thu, Sep 24, 2020 at 4:02 PM lofid...@gmail.com <lofid...@gmail.com> 
>>>>> wrote:
>>>>>
>>>>>> I would like to know, what are the *obstacles* for you as *Java 
>>>>>> developers* not using *Java as programming language for writing Web 
>>>>>> browser apps*. Web browser apps are client-side and *not server-side* 
>>>>>> Web 
>>>>>> apps. 
>>>>>>
>>>>>>    - Open discussion at https://bit.ly/HackerNewsTypeScriptJavaGWT
>>>>>>    - Article at https://bit.ly/TypeScriptVsJavaGWT
>>>>>>
>>>>>> I would like to know from you... Java developers...
>>>>>>
>>>>>> Thanks, 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-tool...@googlegroups.com.
>>>>>> To view this discussion on the web visit 
>>>>>> https://groups.google.com/d/msgid/google-web-toolkit/b099f262-5a83-4a1e-83d8-5cc6ef336e53n%40googlegroups.com
>>>>>>  
>>>>>> <https://groups.google.com/d/msgid/google-web-toolkit/b099f262-5a83-4a1e-83d8-5cc6ef336e53n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>>> .
>>>>>>
>>>>>
>>>>>
>>>>> -- 
>>>> 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-tool...@googlegroups.com.
>>>>
>>> To view this discussion on the web visit 
>>>> https://groups.google.com/d/msgid/google-web-toolkit/8dc3253a-a818-49b1-8e63-65492fb39d90n%40googlegroups.com
>>>>  
>>>> <https://groups.google.com/d/msgid/google-web-toolkit/8dc3253a-a818-49b1-8e63-65492fb39d90n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>> .
>>>>
>>>
>>>
>>> -- 
>>> Rodolfo M. Raya <rmr...@maxprograms.com>
>>> http://www.maxprograms.com
>>>
>> -- 
>> 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-tool...@googlegroups.com.
>>
> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/google-web-toolkit/01f21223-57f0-472b-831f-a213478d426en%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/google-web-toolkit/01f21223-57f0-472b-831f-a213478d426en%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>
>
> -- 
> Rodolfo M. Raya <rmr...@maxprograms.com>
> http://www.maxprograms.com
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit/06eaa3dd-33bf-4545-8e85-6b22d3e3f595n%40googlegroups.com.

Reply via email to