Wednesday, March 31, 2021

SuggestBox SuggestionDisplay Item ToolTip or mouseover handler

Hi All,

I would like to be able to show a tooltip (or some sort of popup) when the user hovers over a suggestion item in the list of suggestions for a SuggestBox.

So far I've extended and/or reimplemented SuggestBox, SuggestBox.DefaultSuggestionDisplay, and DecoratedPopupPanel, so I can attach a Handler to the DecoratedPopPanel's DecoratorPanel.  This works, and I'm able to get the hovered-over list item (actually, a <td> element) so I expect I can add CSS to show popup content (or worst case manually show it.)   

But I'm wondering if there is a better or more appropriate way.

Any suggestions?

thanks,
Linus

--
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/989f95d6-7c23-4631-8eb5-6b3c6217b2d0n%40googlegroups.com.

Tuesday, March 30, 2021

GWT DateBox

I have a problem with Datebox calendar.
The component is inside a widget inside a page.
With IE9 i have no problem but with Chrome the calendar is not showed immediately above
to textbox(see attached image).
Anyone can tell me what's the problem?
Any css property to add?

I need help.
Thanks in advance

--
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/82198c03-c960-41bc-bc5a-04860c1f721en%40googlegroups.com.

Re: DominoKit release announcement

Top! I'll try to update GWT Boot with your latest version in holidays...

David Nouls schrieb am Dienstag, 30. März 2021 um 07:25:31 UTC+2:
Great work, thanks!
On 29 Mar 2021, 21:28 +0200, Juan Pablo Gardella <gardella...@gmail.com>, wrote:
Awesome! Thanks!!

On Mon, 29 Mar 2021 at 16:10, Vegegoku <aka...@gmail.com> wrote:
Dears

DominoKit team are very happy to announce the first Dominokit toolset release candidate, it took us too long but it is finally here and all our tools are now available on maven center, 

the released supports GWT 2.9.0 and Java11, find below a list of all tools and released versions :

domino-ui
Release: 1.0.0-RC1
Development: HEAD-SNAPSHOT

domino-rest
Release: 1.0.0-RC1
Development: HEAD-SNAPSHOT

domino-jackson
Release: 1.0.0-RC2
Development: HEAD-SNAPSHOT

domino-mvp
Release: 1.0.0-RC1
Development: HEAD-SNAPSHOT

domino-history
Release: 1.0.0-RC2
Development: HEAD-SNAPSHOT

domino-aggregator
Release: 1.0.2
Development: HEAD-SNAPSHOT

domino-slf4j-logger
Release: 1.0.2
Development: HEAD-SNAPSHOT

domino-keycloak
Release: 1.0.0
Development: HEAD-SNAPSHOT

domino-immutables
Release: 1.0.0
Development: HEAD-SNAPSHOT

Domino-cli have also been updated to generate projects that use the new releases

You can download the CLI from the project releases page

Your feedback and testing are very welcome.

With regards

DominoKit team


--
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/b46a97ce-75b7-49b9-8209-490b1b60f910n%40googlegroups.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.

--
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/fec0e060-0a60-4c69-a94f-56416c90711fn%40googlegroups.com.

Re: Job opening at Yale Medical School, Pathology Department

Hi Peter,

nice to hear this. Yes, I have also the same opinion about this technology / transpiler GWT / J2CL because I actually just want to write my business codes in Java...

I'll tweet your job openings, hope to see some Java devs join you with your very interesting research area.

Thanks,
Lofi

peter.ge...@yale.edu schrieb am Montag, 29. März 2021 um 03:43:03 UTC+2:
Hi everyone,
First, I would like to thank everyone who is working hard on the GWT framework! I strongly believe that this technology is absolutely critical and important not only to our group but for the world in general.

We made a decision early in 2006 to start using GWT for dynamic web applications in clinical operations in our department. One of the key components was, obviously, the JavaScript compiler that solved a huge number of problems in browser compatibility, portability, security, and in performance. 
It was interesting to hear last year a discussion about web technologies at one of technology conferences in Europe. They were talking about how to overcome the browser loading speed issues of web applications in developing countries. Many were unfortunately unaware that GWT fifteen years elegantly addressed that issue. I am hoping that we see more progress and more recognition of that framework.

Second, I would like to share with you that our small engineering team at Yale is planning add two full stack developers to join our team and help creating future technology for clinical care and research that will be based on GWT and Java. The systems will also include data science components - seamless machine learning and full text indexing integration and image analysis.

If you are interested please read more details at the links below and feel free to contact me with any questions:



Finally, we are thinking about making some of our technologies Opens Source. Open Source experience (in addition to GWT and Java) would be a huge plus!

Best regards,
Peter




Peter Gershkovich, M.D. MHA
Director, Section of Pathology Informatics and Cancer Data Science,
Associate Professor
Yale University School of Medicine
Department of Pathology
Cell phone: 508.208.8798



--
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/d2e81a3b-0401-4478-b8a8-63ca07f9f5c4n%40googlegroups.com.

Monday, March 29, 2021

Re: DominoKit release announcement

Great work, thanks!
On 29 Mar 2021, 21:28 +0200, Juan Pablo Gardella <gardellajuanpablo@gmail.com>, wrote:
Awesome! Thanks!!

On Mon, 29 Mar 2021 at 16:10, Vegegoku <akabme@gmail.com> wrote:
Dears

DominoKit team are very happy to announce the first Dominokit toolset release candidate, it took us too long but it is finally here and all our tools are now available on maven center, 

the released supports GWT 2.9.0 and Java11, find below a list of all tools and released versions :

domino-ui
Release: 1.0.0-RC1
Development: HEAD-SNAPSHOT

domino-rest
Release: 1.0.0-RC1
Development: HEAD-SNAPSHOT

domino-jackson
Release: 1.0.0-RC2
Development: HEAD-SNAPSHOT

domino-mvp
Release: 1.0.0-RC1
Development: HEAD-SNAPSHOT

domino-history
Release: 1.0.0-RC2
Development: HEAD-SNAPSHOT

domino-aggregator
Release: 1.0.2
Development: HEAD-SNAPSHOT

domino-slf4j-logger
Release: 1.0.2
Development: HEAD-SNAPSHOT

domino-keycloak
Release: 1.0.0
Development: HEAD-SNAPSHOT

domino-immutables
Release: 1.0.0
Development: HEAD-SNAPSHOT

Domino-cli have also been updated to generate projects that use the new releases

You can download the CLI from the project releases page

Your feedback and testing are very welcome.

With regards

DominoKit team


--
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/b46a97ce-75b7-49b9-8209-490b1b60f910n%40googlegroups.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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-web-toolkit/CA%2BkiFscqm0xvByT7sq3Wz%2Bj70kUCFOj3hBa6J9XNRpwrXAoEVA%40mail.gmail.com.

Re: DominoKit release announcement

Awesome! Thanks!!

On Mon, 29 Mar 2021 at 16:10, Vegegoku <akabme@gmail.com> wrote:
Dears

DominoKit team are very happy to announce the first Dominokit toolset release candidate, it took us too long but it is finally here and all our tools are now available on maven center, 

the released supports GWT 2.9.0 and Java11, find below a list of all tools and released versions :

domino-ui
Release: 1.0.0-RC1
Development: HEAD-SNAPSHOT

domino-rest
Release: 1.0.0-RC1
Development: HEAD-SNAPSHOT

domino-jackson
Release: 1.0.0-RC2
Development: HEAD-SNAPSHOT

domino-mvp
Release: 1.0.0-RC1
Development: HEAD-SNAPSHOT

domino-history
Release: 1.0.0-RC2
Development: HEAD-SNAPSHOT

domino-aggregator
Release: 1.0.2
Development: HEAD-SNAPSHOT

domino-slf4j-logger
Release: 1.0.2
Development: HEAD-SNAPSHOT

domino-keycloak
Release: 1.0.0
Development: HEAD-SNAPSHOT

domino-immutables
Release: 1.0.0
Development: HEAD-SNAPSHOT

Domino-cli have also been updated to generate projects that use the new releases

You can download the CLI from the project releases page

Your feedback and testing are very welcome.

With regards

DominoKit team


--
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/b46a97ce-75b7-49b9-8209-490b1b60f910n%40googlegroups.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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-web-toolkit/CA%2BkiFscqm0xvByT7sq3Wz%2Bj70kUCFOj3hBa6J9XNRpwrXAoEVA%40mail.gmail.com.

DominoKit release announcement

Dears

DominoKit team are very happy to announce the first Dominokit toolset release candidate, it took us too long but it is finally here and all our tools are now available on maven center, 

the released supports GWT 2.9.0 and Java11, find below a list of all tools and released versions :

domino-ui
Release: 1.0.0-RC1
Development: HEAD-SNAPSHOT

domino-rest
Release: 1.0.0-RC1
Development: HEAD-SNAPSHOT

domino-jackson
Release: 1.0.0-RC2
Development: HEAD-SNAPSHOT

domino-mvp
Release: 1.0.0-RC1
Development: HEAD-SNAPSHOT

domino-history
Release: 1.0.0-RC2
Development: HEAD-SNAPSHOT

domino-aggregator
Release: 1.0.2
Development: HEAD-SNAPSHOT

domino-slf4j-logger
Release: 1.0.2
Development: HEAD-SNAPSHOT

domino-keycloak
Release: 1.0.0
Development: HEAD-SNAPSHOT

domino-immutables
Release: 1.0.0
Development: HEAD-SNAPSHOT

Domino-cli have also been updated to generate projects that use the new releases

You can download the CLI from the project releases page

Your feedback and testing are very welcome.

With regards

DominoKit team


--
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/b46a97ce-75b7-49b9-8209-490b1b60f910n%40googlegroups.com.

Sunday, March 28, 2021

Job opening at Yale Medical School, Pathology Department

Hi everyone,
First, I would like to thank everyone who is working hard on the GWT framework! I strongly believe that this technology is absolutely critical and important not only to our group but for the world in general.

We made a decision early in 2006 to start using GWT for dynamic web applications in clinical operations in our department. One of the key components was, obviously, the JavaScript compiler that solved a huge number of problems in browser compatibility, portability, security, and in performance. 
It was interesting to hear last year a discussion about web technologies at one of technology conferences in Europe. They were talking about how to overcome the browser loading speed issues of web applications in developing countries. Many were unfortunately unaware that GWT fifteen years elegantly addressed that issue. I am hoping that we see more progress and more recognition of that framework.

Second, I would like to share with you that our small engineering team at Yale is planning add two full stack developers to join our team and help creating future technology for clinical care and research that will be based on GWT and Java. The systems will also include data science components - seamless machine learning and full text indexing integration and image analysis.

If you are interested please read more details at the links below and feel free to contact me with any questions:



Finally, we are thinking about making some of our technologies Opens Source. Open Source experience (in addition to GWT and Java) would be a huge plus!

Best regards,
Peter




Peter Gershkovich, M.D. MHA
Director, Section of Pathology Informatics and Cancer Data Science,
Associate Professor
Yale University School of Medicine
Department of Pathology
Cell phone: 508.208.8798



Friday, March 26, 2021

Re: Open PopupDialog relative to cell in DataGrid header on click

FWIW, I figured this out.

The trick was the hack that allows you to get the DataGrid ScrollPanel so you can get the horizontal scroll to correct for the calculated offsetLeft of the widget.

On Tuesday, February 9, 2021 at 10:41:15 AM UTC-8 linus...@gmail.com wrote:
tldr;   I am trying to open a popup dialog relative to a cell in a CompositeCell column header in a DataGrid. I think I am close, but it's not quite right.  The Popup opens in the upper-left corner of the window.

Details:
I have a ClickableTextCell and can either catch the click event by overridding the onBrowserEvent or simply using the default behavior which is to call the FieldUpdater.update() method. So far so good.

But the Popup.showRelativeTo() method takes a UIObject, which the Cell is not.  I discovered the CellWidget wrapper, so when creating the column header, I wrap the ClickableTextCell with a CellWidget.  Using the FieldUpdater.update() method, I can then open the popup using showRelativeTo(theCellWidget).  But the popup opens in the upper-left corner of the browser window.  On inspection, theCellWidget absoluteLeft and Top are 0,0.

I am wondering if this is because when the CellWidget is created, the Cell is not yet visible. 

Is it possible, and if so, how can I open a popup relative to a ClickableTextCell in a DataGrid?

Thanks in advance for any insight,
Linus

The following links provided guidance, but are not directly related to the question at hand.
https://groups.google.com/g/google-web-toolkit/c/cobba9KOwmk/m/PG5wD-bc9uIJ

--
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/d16365b7-2fe5-4db0-aef1-5c33ba514d23n%40googlegroups.com.

How to change GWT Constant locale forcibly and at runtime

I need to change GWT Constant locale for some endpoints in Spring application. I have users and I can change user locale in the admin panel. And I want to force gwt locale for some constants in some cases no matter what locale settings the user has. How I can do it? In my application when I change user locale all constants are changed for all endpoints. I don't know how it works. Class AppContants which inherits com.google.gwt.i18n.client.Constants class doesn't have any methods to set locale.
Thanks in advise

--
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/c1cb5358-9a8c-4479-baf2-3d4efc17fdfbn%40googlegroups.com.

Thursday, March 25, 2021

Re: Double equals

In GWT Boolean, Double and String are represented using their unboxed primitive types.

See for Double:
https://github.com/gwtproject/gwt/blob/master/user/super/com/google/gwt/emul/java/lang/Double.java#L130
https://github.com/gwtproject/gwt/blob/master/user/super/com/google/gwt/emul/java/lang/Double.java#L211
https://github.com/gwtproject/gwt/blob/master/dev/core/src/com/google/gwt/dev/jjs/impl/RewriteConstructorCallsForUnboxedTypes.java

So when compiled to JavaScript Double.equals() would be called with primitive types and that's why it can generally do an instance equality check. However Double.NaN is represented using JavaScript NaN (see: https://github.com/gwtproject/gwt/blob/master/user/super/com/google/gwt/emul/java/lang/Double.java#L35 ) and in JavaScript NaN == NaN is always false. 

So I would consider it an emulation bug and equals() needs to check for NaN and handle it correctly with regard to Java behavior. Feel free to create a bug for it on GitHub.

-- J.


blackh...@gmail.com schrieb am Donnerstag, 25. März 2021 um 09:38:28 UTC+1:
Can someone help me with the double.equals
with the following simple code:
      Double value1 = Double.NaN;
      Double value2 = Double.NaN;

      boolean result1 = value1.equals(value2);

In Java result1 = true;
In web with GWt result1 = false;

Looking at the sourcecode i see that the java double has the following equals method:
public boolean equals(Object obj) { 
return (obj instanceof Double) && (doubleToLongBits(((Double)obj).value) == doubleToLongBits(value));
}

the GWT double source code shows the following:
@Override
public boolean equals(Object o) {
return checkNotNull(this) == o;
}

I do not really understand the GWT version. th emost important thing is that the equals has different results between java and GWT.
How to resolve this?

Regards,

Jasper

--
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/033df899-31e5-42f0-9e00-7ed1474d5313n%40googlegroups.com.

Double equals

Can someone help me with the double.equals
with the following simple code:
      Double value1 = Double.NaN;
      Double value2 = Double.NaN;

      boolean result1 = value1.equals(value2);

In Java result1 = true;
In web with GWt result1 = false;

Looking at the sourcecode i see that the java double has the following equals method:
public boolean equals(Object obj) { 
return (obj instanceof Double) && (doubleToLongBits(((Double)obj).value) == doubleToLongBits(value));
}

the GWT double source code shows the following:
@Override
public boolean equals(Object o) {
return checkNotNull(this) == o;
}

I do not really understand the GWT version. th emost important thing is that the equals has different results between java and GWT.
How to resolve this?

Regards,

Jasper

--
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/74d1f4b1-2977-4496-b8eb-19b921215cc1n%40googlegroups.com.

Monday, March 22, 2021

Re: Spring boot with bootstrap 5 GWT app

Nice, thanks a lot!

Lofi
nikola schrieb am Sonntag, 21. März 2021 um 20:53:12 UTC+1:

A web application to demonstrate usage of dncomponents , MVP pattern, elemenental 2 library and REST communication using DTOs as JS native objects. 

https://github.com/dncomponents/dnnorthwind

enjoy

--
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/bbe94dcd-70df-46fa-9b20-3784caa8033cn%40googlegroups.com.

Sunday, March 21, 2021

Spring boot with bootstrap 5 GWT app

A web application to demonstrate usage of dncomponents , MVP pattern, elemenental 2 library and REST communication using DTOs as JS native objects. 

https://github.com/dncomponents/dnnorthwind

enjoy

--
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/6758fad9-4db8-44d5-a855-b39e7f9822b7n%40googlegroups.com.

Wednesday, March 17, 2021

Conference Talk in German: Web Browser as a Platform

I got invited to talk at this German conference (German language) Navigate:


So hope to give some good messages for GWT / J2CL 😉 

Definitely very interesting conference in April 2021 (free - in German language) with a lot of good content:
  • Spring Boot (OK, no flame this time 😅)
  • Camunda (Bernd Rücker, Co-Founder)
  • Web Component
  • Micronaut / GraalVM
  • Microservices / Monoliths (my fav topic 😂)
Cheers,
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/8a6ebfe7-6490-4b30-8511-6d4bb495ee48n%40googlegroups.com.

Monday, March 15, 2021

Re: New Article "10 Best Java Frameworks to Use in 2021"

Ah, thanks.  Sounds like most projects that want a standalone executable, will still be stuck with Launch4J and similar.

--
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/051a7cc5-d8de-45db-9e4a-4105e81d9d69n%40googlegroups.com.

Re: New Article "10 Best Java Frameworks to Use in 2021"

On 15. 03. 2021. 00:54, Craig Mitchell wrote:
>
> I think I'm missing something.  Spring Boot Native seems to make an exe by
> embedding a JVM (GraalVM).  I don't understand what that has to do with JPA
> / Hibernate?  Wouldn't it work just as well with jOOQ and others?

GraalVM, similar to GWT, supports only subset of Java when building native
executables. Notable feature missing is, (again, same as with GWT)
reflection, which requires declarative workarounds which are PITA (if even
possible).

Lots of existing Java libs can't be compiled to GraalVM's native image.

Fun fact: GraalVM still doesn't support generating WASM images, which is a
great opportunity for J2CL which seems to have active efforts on that front
(https://github.com/google/j2cl/commits/master).

-gkresic.

--
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/86ff8ffa-ca28-ca0c-cf5b-cbfb0fd50e29%40steatoda.com.

Sunday, March 14, 2021

Re: New Article "10 Best Java Frameworks to Use in 2021"

For all Non-Spring-Devs: Spring Boot Native Beta is there!
  • JPA / Hibernate with Spring Data supported and Hibernate Reactive for Spring Data also available. Damn my analysis article is just right, Hibernate for 2021 :-)
 
I think I'm missing something.  Spring Boot Native seems to make an exe by embedding a JVM (GraalVM).  I don't understand what that has to do with JPA / Hibernate?  Wouldn't it work just as well with jOOQ and others?

--
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/f5483f38-2cd6-4284-a6e0-e52307bf76b0n%40googlegroups.com.

Friday, March 12, 2021

Re: New Article "10 Best Java Frameworks to Use in 2021"

I'm still inside the flame ;-)

For all Non-Spring-Devs: Spring Boot Native Beta is there!
Cheers,
Lofi
t.br...@gmail.com schrieb am Donnerstag, 11. März 2021 um 20:27:52 UTC+1:
On Thursday, March 11, 2021 at 3:39:37 PM UTC+1 Luis Fernando Planella Gonzalez wrote:
We use JPA with EclipseLink. Gave us a lot better performance than Hibernate when we compared both.
The thing I like more with ORMs is that they are class-first. One creates the entity, annotates it correctly and generate the schema.

Ah yes, that's also one of those things I dislike about JPA 😊
And retrofitting JPA on an existing schema is… not easy (or leads to non-idiomatic entities). Fortunately I've only had to do that twice I think.
Many performance issues I've seen had to do with databases when doing complex queries, so in addition to not fully controlling your SQL queries, you also don't fully control the schema; or maybe more accurately you have to learn how each JPA mapping strategy translates to SQL.
Unless I'm mistaken, this also leads to putting zero or very few "check constraints" in the database (i.e. besides not null, unique constraints and referential integrity). Lately I've used exclusion constraints in Postgres (https://www.postgresql.org/docs/current/ddl-constraints.html#DDL-CONSTRAINTS-EXCLUSION) to handle complex uniqueness or non-overlapping date ranges, and other check constraints for some things others would likely implement as "business rules" in the application (things like "if that enum field's value is A then this other field must be null, and otherwise then it must be non-null and positive", or simpler things like "only one of those 2 fields can be null at a time", and in some cases they must not both be null).
 
For those liking a schema-first approach, I like a lot the Querydsl project. It is not as active nowadays as it used to be, but is very nice.
And works both for plain SQL and JPA (I HATE with passion the JPA criteria queries, Querydsl is so much more readable). 

Querydsl is quite similar to jOOQ (which can generate code from JPA entities too: https://www.jooq.org/doc/3.14/manual/code-generation/codegen-jpa/), although less "integrated" with JPA: https://www.jooq.org/doc/3.14/manual/sql-execution/alternative-execution-models/using-jooq-with-jpa/
jOOQ will always do native SQL though, whereas Querydsl will use JPQL (or similar).
 
It gives us typed queries and is very extensible. You can even define your own extensions as annotated static methods and it generates those as methods in the metamodel, so things like these are possible:

This is interesting.
I've used extension methods in a Kotlin project, that alleviates the need for such a feature; but with Java indeed one would have to write isActive(p) without that.
I'm actually not sure what I prefer.

(fwiw, JPA Criteria with JPA Metamodel in JPA 2.0 also gives you typed queries; the API still is 🤢)
 

// Q* are the generated classes for the Querydsl metamodel
QPerson p = QPerson.person;
List<Person> admins = query
    .select(p)
    .from(p)
    .where(
        p.role.eq(Role.ADMIN),
        p.isActive()) // This would be a custom method via extension
    .orderBy(p.name.asc())
    .fetch();

--
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/e952dacc-c967-4c0d-8da3-c2decaaeca3fn%40googlegroups.com.

Re: New Article "10 Best Java Frameworks to Use in 2021"

No one mentioned proxy issues with Hibernate. Am I the only one who suffers from that? Basically with those proxies you never know if your code will actually work in production because Hibernate sometimes returns proxies sometimes it does not. I have even seen (though years ago) a mix of proxies and non-proxies in the same result set. Since we've started to use inheritance extensively in our persistence entities we face issues with Hibernate proxies where standard Java approach to check "instanceof" don't work. So we have to introduce special "instance of" method and don't forget to deproxy entity before casting it to a subclass. This means that Java compiler is not able to catch bugs when such special "instanceof" and deproxying is not used. Hibernate supports byte code entity enhancing as a replacement for default usage of Hibernate proxies but we are not able to configure byte-code enhancement to work properly. For example, the same query that returns single entity with several joined entities produces just one additional query without byte-code enhancement and produces  23 additional queries with byte-code enhancement. I would have never chosen Hibernate and JPA again for several reasons. Here is another one. If code changes a property of a persistence entity you have to know if it is detached or not, depending on situation if you want the change to be propagated to DB or you just updating it for a view. So I have come to conclusion that all  the classes that use Hibernate / JPA should be hidden behind some interface and not to leak its issues to the rest of application. And those interfaces should never ever return any JPA persistence entities. And all business logic should not be in those persistence entities which means these are just shallow ORM entities.
On Thursday, March 11, 2021 at 2:27:52 PM UTC-5 t.br...@gmail.com wrote:
On Thursday, March 11, 2021 at 3:39:37 PM UTC+1 Luis Fernando Planella Gonzalez wrote:
We use JPA with EclipseLink. Gave us a lot better performance than Hibernate when we compared both.
The thing I like more with ORMs is that they are class-first. One creates the entity, annotates it correctly and generate the schema.

Ah yes, that's also one of those things I dislike about JPA 😊
And retrofitting JPA on an existing schema is… not easy (or leads to non-idiomatic entities). Fortunately I've only had to do that twice I think.
Many performance issues I've seen had to do with databases when doing complex queries, so in addition to not fully controlling your SQL queries, you also don't fully control the schema; or maybe more accurately you have to learn how each JPA mapping strategy translates to SQL.
Unless I'm mistaken, this also leads to putting zero or very few "check constraints" in the database (i.e. besides not null, unique constraints and referential integrity). Lately I've used exclusion constraints in Postgres (https://www.postgresql.org/docs/current/ddl-constraints.html#DDL-CONSTRAINTS-EXCLUSION) to handle complex uniqueness or non-overlapping date ranges, and other check constraints for some things others would likely implement as "business rules" in the application (things like "if that enum field's value is A then this other field must be null, and otherwise then it must be non-null and positive", or simpler things like "only one of those 2 fields can be null at a time", and in some cases they must not both be null).
 
For those liking a schema-first approach, I like a lot the Querydsl project. It is not as active nowadays as it used to be, but is very nice.
And works both for plain SQL and JPA (I HATE with passion the JPA criteria queries, Querydsl is so much more readable). 

Querydsl is quite similar to jOOQ (which can generate code from JPA entities too: https://www.jooq.org/doc/3.14/manual/code-generation/codegen-jpa/), although less "integrated" with JPA: https://www.jooq.org/doc/3.14/manual/sql-execution/alternative-execution-models/using-jooq-with-jpa/
jOOQ will always do native SQL though, whereas Querydsl will use JPQL (or similar).
 
It gives us typed queries and is very extensible. You can even define your own extensions as annotated static methods and it generates those as methods in the metamodel, so things like these are possible:

This is interesting.
I've used extension methods in a Kotlin project, that alleviates the need for such a feature; but with Java indeed one would have to write isActive(p) without that.
I'm actually not sure what I prefer.

(fwiw, JPA Criteria with JPA Metamodel in JPA 2.0 also gives you typed queries; the API still is 🤢)
 

// Q* are the generated classes for the Querydsl metamodel
QPerson p = QPerson.person;
List<Person> admins = query
    .select(p)
    .from(p)
    .where(
        p.role.eq(Role.ADMIN),
        p.isActive()) // This would be a custom method via extension
    .orderBy(p.name.asc())
    .fetch();

--
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/6711bec4-4772-42e7-8574-08a406a5f2acn%40googlegroups.com.

Thursday, March 11, 2021

Re: New Article "10 Best Java Frameworks to Use in 2021"



On Thursday, March 11, 2021 at 3:39:37 PM UTC+1 Luis Fernando Planella Gonzalez wrote:
We use JPA with EclipseLink. Gave us a lot better performance than Hibernate when we compared both.
The thing I like more with ORMs is that they are class-first. One creates the entity, annotates it correctly and generate the schema.

Ah yes, that's also one of those things I dislike about JPA 😊
And retrofitting JPA on an existing schema is… not easy (or leads to non-idiomatic entities). Fortunately I've only had to do that twice I think.
Many performance issues I've seen had to do with databases when doing complex queries, so in addition to not fully controlling your SQL queries, you also don't fully control the schema; or maybe more accurately you have to learn how each JPA mapping strategy translates to SQL.
Unless I'm mistaken, this also leads to putting zero or very few "check constraints" in the database (i.e. besides not null, unique constraints and referential integrity). Lately I've used exclusion constraints in Postgres (https://www.postgresql.org/docs/current/ddl-constraints.html#DDL-CONSTRAINTS-EXCLUSION) to handle complex uniqueness or non-overlapping date ranges, and other check constraints for some things others would likely implement as "business rules" in the application (things like "if that enum field's value is A then this other field must be null, and otherwise then it must be non-null and positive", or simpler things like "only one of those 2 fields can be null at a time", and in some cases they must not both be null).
 
For those liking a schema-first approach, I like a lot the Querydsl project. It is not as active nowadays as it used to be, but is very nice.
And works both for plain SQL and JPA (I HATE with passion the JPA criteria queries, Querydsl is so much more readable). 

Querydsl is quite similar to jOOQ (which can generate code from JPA entities too: https://www.jooq.org/doc/3.14/manual/code-generation/codegen-jpa/), although less "integrated" with JPA: https://www.jooq.org/doc/3.14/manual/sql-execution/alternative-execution-models/using-jooq-with-jpa/
jOOQ will always do native SQL though, whereas Querydsl will use JPQL (or similar).
 
It gives us typed queries and is very extensible. You can even define your own extensions as annotated static methods and it generates those as methods in the metamodel, so things like these are possible:

This is interesting.
I've used extension methods in a Kotlin project, that alleviates the need for such a feature; but with Java indeed one would have to write isActive(p) without that.
I'm actually not sure what I prefer.

(fwiw, JPA Criteria with JPA Metamodel in JPA 2.0 also gives you typed queries; the API still is 🤢)
 

// Q* are the generated classes for the Querydsl metamodel
QPerson p = QPerson.person;
List<Person> admins = query
    .select(p)
    .from(p)
    .where(
        p.role.eq(Role.ADMIN),
        p.isActive()) // This would be a custom method via extension
    .orderBy(p.name.asc())
    .fetch();

--
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/77504c44-e66e-4df9-a1d7-b31bd1822b76n%40googlegroups.com.

Re: New Article "10 Best Java Frameworks to Use in 2021"

We use JPA with EclipseLink. Gave us a lot better performance than Hibernate when we compared both.
The thing I like more with ORMs is that they are class-first. One creates the entity, annotates it correctly and generate the schema.
For those liking a schema-first approach, I like a lot the Querydsl project. It is not as active nowadays as it used to be, but is very nice.
And works both for plain SQL and JPA (I HATE with passion the JPA criteria queries, Querydsl is so much more readable).
It gives us typed queries and is very extensible. You can even define your own extensions as annotated static methods and it generates those as methods in the metamodel, so things like these are possible:

// Q* are the generated classes for the Querydsl metamodel
QPerson p = QPerson.person;
List<Person> admins = query
    .select(p)
    .from(p)
    .where(
        p.role.eq(Role.ADMIN),
        p.isActive()) // This would be a custom method via extension
    .orderBy(p.name.asc())
    .fetch();

Em terça-feira, 9 de março de 2021 às 12:10:44 UTC-3, aka...@gmail.com escreveu:
I don't like Hibernate/JPA because of the horror and terror it gave me during my career years. Yet 
Hibernate appeared in times when we were having a hard time dealing with database and SQL in java, mapping/parsing query results, or even constructing the queries themselves and I have seen it going wildly bad.
Hibernate then came with its benefits and problems .. (maybe too many problems) but it came first .. and was adopted by so many.. and it became a large part of Java ecosystem ..so large that you hardly find a project that talks to the database and not using hibernate.. (we would like to see more of this)
I am not sure but maybe hibernate was there around 2008 (the oldest version I checked in maven central) imagine by that we had JOOQ first ..or JDBI ..or whatever suggested alternative... (I think most of them came after 2010 checking the issue trackers on Github) .. imagine we had text blocks :-) way before hibernate came along.

Now you see projects using hibernate for no reason (especially with how easy it is being promoted by spring).. from using it for simple CRUD (can be replaced by one of the suggested solutions) or for the complex queries (which should be replaced with one of the suggested solutions) I think.

BTW,  
@Thomas you didn't start a flame war it was just a flame, I got to learn few things from this conversation so why not flame the rest of the list? 


On Tuesday, March 9, 2021 at 3:44:02 PM UTC+2 t.br...@gmail.com wrote:
Main issues with JPA: the entity caches, and lazy-loading which makes things work but are a PITA for performance (I've worked on a project where each and every HTTP request causes between 10 and 30 SQL queries, only to get the user's information and access rights; being so bad might very well be caused by the app architecture too, as it also has N+1 issues on some screens; but definitely JPA is to blame as well).
(also, the Criteria API is 🤢)

On Tuesday, March 9, 2021 at 10:34:18 AM UTC+1 lofid...@gmail.com wrote:
@TBroyer: of course we are going to start a flame war for Hibernate ;-)

"Hibernate" is the most searched word in Google 2021... OK, I mean "how to hibernate your PC" :-)

I agree with @Gordan, it depends on the use case. Strangely enough, we have today ORM also on Android Room (https://developer.android.com/training/data-storage/room) and iOS Core Data (https://developer.apple.com/documentation/coredata). So from the resources and speed point of view, it seems that they are just fine.

Actually it's a pitty that the standard SQLJ (https://en.wikipedia.org/wiki/SQLJ) did not get any further, I think it would be a good choice if you need SQL but need the "type and compile time" safety in Java.

Cheers,
Lofi
Gordan Krešić schrieb am Dienstag, 9. März 2021 um 09:11:06 UTC+1:
On 09. 03. 2021. 08:29, Craig Mitchell wrote:
>
> Too late.  Flame war!  ;P  But seriously, what's wrong with using Hibernate
> as JPA provider?  Okay, yes, there is nothing to learn, it does all its
> magic behind the scenes, but is there something better?  Or maybe using JPA
> is bad, and we go back to pure SQL?  I'm curious.

I did try various ORMs, including some for non-relational databases (but
then it's not an ORM, but... what?) but never figured out the benefits. They
all demo well, but when I go past most basic usage, they always felt more
like an obstacle than a tool.

Only case where I would agree using ORM saves time are projects with high
number of tables compared to complexity of their usage (simple SELECTs on
hundreds or thousands of tables). But, I don't have such a project in my
portfolio.

Can you name few other benefits? Type safety? "Compile-time checks" of SQL
"queries"? I can see *some* benefits there, but hardly ones that justifies
learning another, fairly complex, DSL on top of SQL.

From time to time I found a survey with question like "Which ORM do you
use?" and there are usually low-double-digits of percentages of users who
claim to be using "raw JDBC with SQL". It gives me hope that I'm not a lone
lunatic, but still, 80+% of users must know *something*, right?

So, if we assume that someone already knows SQL (and it's an 'if', I know),
what would be the benefits of using ORM of any kind?

Bonus question: I've been looking for years for a most simplistic SQL
templating library, mainly for things like reusing WHERE clauses (i usually
end up with fairly complex ones used in multiple queries), linking '?' with
setters on PreparedStatements and things like that. I even wrote small lib
because I was tired of experimenting, but I seriously doubt that I'm the
only one with this need and would instead like to contribute to already
existing project rather than maintain my own.

-gkresic.

--
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/45f8410e-8301-4de5-ad98-aa80a6c5ddc9n%40googlegroups.com.

Re: New Article "10 Best Java Frameworks to Use in 2021"

We ended up using no plugins for GWT with Gradle. Even if there are some, none of them fit well.
Luckily, GWT compiler has a nice CLI, so...
Also, we make the gwt a subproject, as we don't use GWT RPC anyway. This helps keeping gwt-dev out of any runtime classpath!!!

Below is a trimmed version (not sure it even compiles, and it is the build.gradle for a subproject) of the build.gradle file for reference, for both compilation (even with a system flag to compile only the dev module) and for running the super dev mode:

ext {
    buildWebapp = "${project(':web').buildDir}/generated/webapp"
    gwtDev = Boolean.getBoolean('gwt.development')
}

configurations {
    gwt
}
dependencies {
    gwt(project(':api')) { transitive = false }
    gwt files(project.sourceSets.main.java.srcDirs)
    gwt files(project.sourceSets.main.resources.srcDirs)
    gwt files(project(':api').sourceSets.main.java.srcDirs)
    gwt "com.google.gwt:gwt-user:$gwtVersion"
    gwt "com.google.code.gwtx:gwtx:$gwtxVersion"
    gwt "com.github.branflake2267:gwt-maps-api:$googleMapsApiVersion"
    gwt "com.google.elemental2:elemental2-webstorage:$elementalVersion"
    gwt "com.google.elemental2:elemental2-dom:$elementalVersion"
    gwt "com.google.elemental2:elemental2-promise:$elementalVersion"
    gwt "com.fasterxml.jackson.core:jackson-annotations:$jacksonVersion"
    gwt "com.google.gwt:gwt-dev:$gwtVersion"
}

task compileGwt(type: JavaExec) {
    dependsOn compileJava
    ext {
        outDir = "$buildWebapp/gwt"
    }
    group = 'Build'
    description = 'Compile the GWT source'
    inputs.files configurations.gwt
    inputs.property 'development', gwtDev
    outputs.dir outDir
    classpath = configurations.gwt
    main = 'com.google.gwt.dev.Compiler'
    args = []
    args += ['-sourceLevel', "1.$javaVersion"]
    args += ['-war', buildWebapp]
    args += ['-logLevel', 'INFO']
    args += ['-workDir', "$buildDir/tmp/gwt"]
    args += ['-XfragmentCount', '6']
    args += ['-failOnError']
    if (gwtDev) {
        args += ['-style', 'PRETTY']
        args += ['-draftCompile']
        args += ['-optimize', '0']
        args += ['-XmethodNameDisplayMode', 'ABBREVIATED']
        args += ['org.example.MyModuleDev']
    } else {
        args += ['-style', 'OBFUSCATED']
        args += ['-optimize', '9']
        args += ['-XnoclassMetadata']
        args += ['org.example.MyModule']
    }
}
task cleanGwtTemp {
    doLast {
        ant.delete(dir: "$buildWebapp/gwt")
        ant.delete(dir: "$buildDir/tmp/gwt")
    }
}
clean {
    dependsOn cleanGwtTemp
}

task gwtSuperDev(type: JavaExec) {
    dependsOn compileJava
    description = 'Run the GWT code server for Super Dev Mode'
    classpath = configurations.gwt
    main = 'com.google.gwt.dev.codeserver.CodeServer'
    args = []
    args += ['-sourceLevel', "1.$javaVersion"]
    args += ['-launcherDir', buildWebapp]
    args += ['-logLevel', 'INFO']
    args += ['-workDir', "$buildDir/tmp/gwt"]
    args += ['-precompile']
    args += ['-failOnError']
    args += ['-bindAddress', '0.0.0.0']
    args += ['org.example.MyModuleDev']
    
    doFirst {
        file("$buildDir/tmp/gwt").mkdirs()
    }
}



Em quarta-feira, 10 de março de 2021 às 12:44:57 UTC-3, aka...@gmail.com escreveu:
Even if it is opinionated, please give us Gradle GWT archetype. :-)

On Wednesday, March 10, 2021 at 5:25:47 PM UTC+2 t.br...@gmail.com wrote:


On Wednesday, March 10, 2021 at 4:13:03 PM UTC+1 pavel....@gmail.com wrote:
We had the same problem with maven but at the end, maven's multi-module project and profiles helped to solve hack around it.

There, fixed it for you 😉

(and yet, gwt-maven-archetypes use a "dev" profile 🤷, but it's know to be kind of hackish in places due to Maven and jetty-maven-plugin's limitations)

--
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/b369da9d-78fc-4d5f-9227-68a47b18dd61n%40googlegroups.com.

Wednesday, March 10, 2021

Re: New Article "10 Best Java Frameworks to Use in 2021"

What i mean is that mockito make it very easy to mock things, that we end up mocking everything, have we seen tests that mock every argument going into the constructor? have we seen concrete implementation being mocked without introducing an abstraction level that opens the doors for other implementations? have wee seen code that ends up with hight coupling because we actually mocked things in the tests? I mean tests are a way to design not just to verify that code is working..this might be just my opinion but here is a small example - those are no exact conversion but they are the best I could find from the old code

@ExtendWith(MockitoExtension.class)
class SubmitIssuanceCheckRequestUseCaseTest {

@Mock
private ChecksRepository checksRepository;
@Mock
private EventPublisher eventPublisher;
@Mock
private IdentityProvider identityProvider;

@InjectMocks
private SubmitIssuanceCheckRequestUseCase submitIssuanceCheckRequestUseCase;

private String currentUserName = UUID.randomUUID().toString();

@BeforeEach
void setUp() {
when(identityProvider.currentIdentity().getName()).thenReturn(currentUserName);
}

@Test
void givenNull_whenExecute_thenShouldThrowException() {
String message = assertThrows(IllegalArgumentException.class,
() -> submitIssuanceCheckRequestUseCase.execute(null))
.getMessage();
assertThat(message).isEqualTo(CHECK_CANNOT_BE_NULL);
}

@Test
void givenStockCheck_whenExecute_thenShouldUpdateCheckStatusToIssued() {
Check check = new Check();
check.setStatus(CheckStatus.STOCK);
check.setReference(UUID.randomUUID().toString());

submitIssuanceCheckRequestUseCase.execute(check);

ArgumentCaptor<Check> captor = ArgumentCaptor.forClass(Check.class);
Mockito.verify(checksRepository).update(captor.capture());
assertThat(captor.capture().getStatus()).isEqualTo(CheckStatus.ISSUED);
assertThat(captor.capture().getReference()).isEqualTo(check.getReference());
assertThat(captor.capture().getIssuanceDate()).isNotNull();
assertThat(captor.capture().getIssuedBy()).isEqualTo(currentUserName);
}

@Test
void givenStockCheck_whenExecute_thenShouldPublishCheckIssuedEvent() {
Check check = new Check();
check.setStatus(CheckStatus.STOCK);
check.setReference(UUID.randomUUID().toString());

submitIssuanceCheckRequestUseCase.execute(check);

ArgumentCaptor<CheckEventEvent<Address>> captor = ArgumentCaptor.forClass(CheckEvent.class);
verify(eventPublisher).publish(captor.capture());
assertThat(captor.getValue().getHeader().getReference()).isEqualTo(check.getReference());
assertThat(captor.getValue().getHeader().getEventType()).isEqualTo(CHECK_ISSUED);
assertThat(captor.getValue().getBody().getPayload()).isEqualTo(check);
}
}



VS 

public class PostCheckUseCaseTest {
private PostCheckUseCase postCheckUseCase;

private Check validCheck;
private Check savedCheck;
private CheckEvent<Check> publishedEvent;
private Check publishedCheck;

@Before
public void setUp() {
postCheckUseCase = new PostCheckUseCase(
check -> this.savedCheck = check,
checkEvent -> this.publishedEvent = checkEvent,
check -> this.publishedCheck = check
);
validCheck = buildValidCheck();
}

private Check buildValidCheck() {

Check check = new Check();
check.setReference("ABCDEFGHIJKLMN");
check.setPostingType(PostingType.IMMEDIATE);
check.setStatus(CheckStatus.DEPOSITED);
check.setSubmissionDate(LocalDateTime.now());
UserDecisionLog userDecisionLog = new UserDecisionLog();
userDecisionLog.setPostingDecision(PostingDecision.INITIAL);
check.setUserDecision(Arrays.asList(userDecisionLog));

return check;
}

@Test
public void givenNullCheck_whenExecute_thenShouldThrowException() {
assertThatExceptionOfType(IllegalArgumentException.class)
.isThrownBy(() -> postCheckUseCase.execute(null))
.withMessage("check cannot be null");
}

@Test
public void givenValidCheck_whenExecute_thenShouldUpdateStatusWithDepositedAndSubmissionDateOnRepository() {
validCheck.setStatus(null);
validCheck.setPostingType(PostingType.IMMEDIATE);
Check postedCheck = postCheckUseCase.execute(validCheck);
assertThat(postedCheck.getStatus()).isEqualTo(CheckStatus.DEPOSITED);
assertThat(postedCheck.getSubmissionDate()).isEqualToIgnoringSeconds(LocalDateTime.now());
assertThat(getLastUserDecision(postedCheck).getPostingDecision()).isEqualTo(PostingDecision.POST_IMMEDIATELY);
assertThat(savedCheck).isEqualTo(postedCheck);
}

@Test
public void givenReceivedCheck_whenExecute_thenShouldPublishEvent() {
Check postedCheck = postCheckUseCase.execute(validCheck);

assertThat(publishedEvent.getHeader().getReference()).isEqualTo(postedCheck.getReference());
assertThat(publishedEvent.getHeader().getEventType()).isEqualTo(CheckStatus.DEPOSITED.getEventType());
assertThat(publishedEvent.getBody().getPayload()).isNotNull();
assertThat(publishedEvent.getBody().getPayload()).isSameAs(postedCheck);
}

@Test
public void givenRepresentedCheck_whenExecute_thenShouldPublishEvent() {
validCheck.setStatus(CheckStatus.REPRESENTED);
Check postedCheck = postCheckUseCase.execute(validCheck);
assertThat(publishedEvent.getHeader().getReference()).isEqualTo(postedCheck.getReference());
assertThat(publishedEvent.getHeader().getEventType()).isEqualTo(CheckStatus.REPRESENTED.getEventType());
assertThat(publishedEvent.getBody().getPayload()).isNotNull();
assertThat(publishedEvent.getBody().getPayload()).isSameAs(postedCheck);
}

@Test
public void givenValidCheck_whenExecute_thenShouldSendMessageToBank() {
Check postedCheck = postCheckUseCase.execute(validCheck);
assertThat(publishedCheck).isEqualTo(postedCheck);
}

private UserDecisionLog getLastUserDecision(Check validCheck) {
return validCheck.getUserDecision().get(validCheck.getUserDecision().size() - 1);
}

I have seen tests that way far more code just doing  ArgumentCaptor  or When(..).then(...) .. etc than any actual testing code.. it could go wildly bad...
I had to write tests in both styles to convince myself.. but I believe this will remain a topic with a debate. 
On Wednesday, March 10, 2021 at 5:56:20 PM UTC+2 gardella...@gmail.com wrote:
Hi Vegeoku,

Could you please elaborate on this?

IMHO tests should help you improve the design of your code, Mockito is the opposite of that, Once I converted some test cases to use manually writing test doubles (spies, fakes, stubs) instead of Mockito to show the other guy how it reduced the code in the test and improves the design. Mockito makes it super easy to look away from design issues.

Thanks,
Juan

P.S. Amazing thread.

On Wed, 10 Mar 2021 at 12:47, Josselin Bardet <nam...@gmail.com> wrote:


Le mer. 10 mars 2021 à 16:42, Vegegoku <aka...@gmail.com> a écrit :


Spring: I think the thing I dislike the most about Spring is what many people like about it: it's an entire, wide, and fat, ecosystem. You can hardly use one piece of Spring without using everything else; I mean, each Spring piece builds on top of another Spring piece, so it's basically an all-or-nothing. I also fear that people doing mostly Spring won't know how to do things without it (like most big/fat framework actually).


That does really summaries it about spring, also I hate how it is being overused for simple projects,  Like sucking this huge ecosystem just because we need dependency injection or want to talk to the database (JPA -> spring data) and it ends up building a huge complexity instead of simplifying things.. (Tests for example), I once want to contribute to a project that was using spring to find out that I had to inject a single bean into 500+ other classes using the constructor where even the arguments were not arranged to make this any easier and while doing that I had to fight merge conflicts .. it is overrated and overused .. and I pretty sure that most of spring project developer relay too much on mocking to make the tests faster or avoid such dependency injection hell.
 

Spring is well tested and works well, can handle your transctions, can help you to make AOP, can make dependency injection, etc...
Spring is for me a killer feature, I can't imagine making a project, even simple, without using it.

I don't think nowadays there is a good reason to "optimize" and don't use spring

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

--
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/605271a7-3edf-4fac-bd8c-f91602854c47n%40googlegroups.com.