General comment: I used to love the good old bakery example. Bakery could be the perfect domain for such an example application. Everybody loves bread, itâs easy to understand but has a lot of use-cases that can even show-case pro components like Maps (where is the next bakery) or charts (how many breads got sold each day). So I would highly suggest to use a domain people can easily grasp and build-upon.
Some high and low level comments regarding the available source code - itâs probably not complete⊠took some timeâŠ
Dependencies:
I would definitely remove the following:
- jOOQ
- Flyway
- Testcontainer
Iâm thinking about removing also:
- PostgreSQL in favor of H2
- ArchUnit
Even though the selected technologies are not bad, there add additional complexity which is IMHO not needed in a âVaadin Showcaseâ. None of those dependencies (except ArchUnit) have influence on the way you build your Vaadin Applications - therefore they only make it harder for ânewbiesâ to understand what is happening, why there are present and so on.
jOOQ: While pretty cool and has a big following within the Vaadin Community. I would say JDBC / JPA (Hibernate) should still be used. Database Management is really âbiasedâ⊠so itâs really hard to make it âperfectâ for everybody - therefore would I suggest to make it âas simple as possibleâ which would be plain old JPA with Spring Repositories.
Flyway + Testcontainer: Adds complexity that should not be needed in a show-case app how to build good Vaadin UIs.
PostgreSQL: I would replace it with H2 so that people are not forced to have database running to play with the application.
ArchUnit: I like it personally, but it might add a little bit too much âproblemsâ for people that wanna check our Vaadin.
Tests
Did you reinvent âIntegrationtestsâ with your own annotation and non-standard naming scheme? Please donât. Maven Surefire and Failsafe Plugin exists for reasons. None of your test classes follow the required naming for Failsafe Plugin to pick them up.
Biased: AssertJ +1
VaadinErrorHandler.java
Iâm not a fan of this design⊠I would create proper classes that extends ErrorHandler, inject context, filter exceptions via Springâs DisconnectedClientHelper as well as NestedExceptionUtils. At the current state this implementation is a downgrade to the default error handler.
UserId.java (can be applied to all ***Id)
Why are those not records? Immutable ID âclassesâ (read records) are the first thing that come to mind.
TaskStatusFormatter
Suggestion 1: add the human readable text as field to each enum
Suggestion 2: add a translation key to as field to each enum allowing this to be retrieved in the frontend language-dependent (+ e.g. interface âHas18nâ which could be added to all enums to allow to create a single renderer for all enums in the UI)
using âprivate static VaadinComponent create(A, BâŠ)
Using âstaticâ to create Vaadin Components might result in people doing stupid things⊠I would suggest to remove this keywordâŠ
TODO Iâm not sure what I feel about this style of creating views
Iâm sure how I feel: like said on Github, please donât do it.
ProjectsNavigation
+1. Cool idea, not sure about the naming (couldnât come up with something better)
Binder with Records
Records represent immutable data structures. Editing records with the Binder feels IMHO totally obscure and should not be advertised. Support of records with Binder is even broken that all properties need to be present⊠otherwise it fails⊠you canât use bind(::get/::set) which forces you to use bind(string) which is not typesafe⊠all good things lost⊠itâs just a nightmare to maintain.
Design Decision 001: Package Structure
Controversial topic⊠and understandable points. Personally, I already find the project really hard to read with like 20-30 classes in a single package and it does not even have much logic to begin with. I prefer âlayersâ - even tho that results in âtoo muchâ public classesâŠ
I would have structured like this:
api/ - common classes shared by services and UI, enums etc.
app/ - general classes affecting the whole application
- security/ - all stuff regarding security (except User(roles)⊠I would put those class into API
- vaadin/ - stuff like AppShell⊠NpmConfigurations⊠ErrorHandler⊠SystemMessages⊠ApplicationInitListener
backend/ - all classes related to none-UI stuff⊠names should be self explanatory
- entity/
- repository/
- schedule/
- service
ui/ - all classes related to the UI
- shared/ - stuff like NotifcationUtils⊠ComponentCreatorâŠ
- views/
- project/ - all views related to projects
- form/ - forms , binder etc. for the views