Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
81stAirhacksQ&A.md

Ask questions and see you at December, 7th, 8.PM. CET: https://vimeo.com/event/154379

Also checkout recent episode:

80th airhacks.tv

Please keep the questions Jakarta EE-stic. Means: as short and as concise as only possible. Feel free to ask several, shorter questions. Upcoming airhacks.tv events are also going to be announced at meetup.com/airhacks

@AdamBien

This comment has been minimized.

Copy link
Owner Author

@AdamBien AdamBien commented Nov 6, 2020

Web Component project structure, snowpack and redux vs. redux-toolkit discussion: AdamBien/webcomponents-with-redux.training#3 (comment)

@JosefMaderKreiner

This comment has been minimized.

Copy link

@JosefMaderKreiner JosefMaderKreiner commented Nov 14, 2020

Hi Adam!

Thank's a lot for answering my questions in your last Q&A-session.

I've got other questions where I'm exited about your answers.

In our company we've got a lot of batch-use cases. Therefore the Jakarta Batch specification is really interesting for us. We're running our applications in a containerized environment - so we want to scale out as well. What is your experience about Jakarta Batch applications and running them in a container platform - is there cloud native support of Jakarta Batch?

My second question is your opinion of OpenJ9. Standard Docker images of Openliberty include only OpenJ9. Do you think it's ready for a production environment? In our tests we didn't reach the promoted startup times of about 1 second for a liberty application. So why shouldn't we use GraalVM or standard OpenJDK.

Thank's for your advice!

Josef

@BLTuckerDev

This comment has been minimized.

Copy link

@BLTuckerDev BLTuckerDev commented Nov 15, 2020

Hey Adam,

I've been watching airhacks and learning from you for years. I've learned lots about java, architecture, and webcomponents in that time.

My question for you is: what do you do when its time to learn something new?
What resources did you use when you first sat down to start learning about web components for example?

I hope you have a Merry Christmas :) Be sure to have a gluhwein for me

-Brett Tucker

@Amasianikk

This comment has been minimized.

Copy link

@Amasianikk Amasianikk commented Nov 16, 2020

Am using window 10 home version and Netbeans IDE 12. Am trying to running the examples in JAVA EE through the IDE, it didn't work and command prompt the server can't start the server

@AdamBien

This comment has been minimized.

Copy link
Owner Author

@AdamBien AdamBien commented Nov 16, 2020

Am using window 10 home version and Netbeans IDE 12. Am trying to running the examples in JAVA EE through the IDE, it didn't work and command prompt the server can't start the server

Please attach your screenshot / terminal output

@AdamBien

This comment has been minimized.

Copy link
Owner Author

@AdamBien AdamBien commented Nov 17, 2020

It can;t create virtual machine or configuration. cargo-maven2 plugin : 1.4.4 redeploy failed

I never used cargo-maven2 plugin.

@AdamBien

This comment has been minimized.

Copy link
Owner Author

@AdamBien AdamBien commented Nov 17, 2020

"...But this year in Ukraine I discovered that all (including you) write Java code in Visual Studio Code. How come? Is Java support in VS Code superior to IntelliJ? I only use it for JavaScript/TypeScript. Do you recommend it for Java?..."

@Amasianikk

This comment has been minimized.

Copy link

@Amasianikk Amasianikk commented Nov 17, 2020

@Amasianikk

This comment has been minimized.

Copy link

@Amasianikk Amasianikk commented Nov 17, 2020

@AdamBien

This comment has been minimized.

Copy link
Owner Author

@AdamBien AdamBien commented Nov 18, 2020

".. I don't want to resort to native queries just to be able to use these features. I want the advantages of the type system, the powerful joins to associations, inheritance hierarchies and secondary tables..." from: https://www.youtube.com/watch?v=vN_8K-6TzAg

@hrstoyanov

This comment has been minimized.

Copy link

@hrstoyanov hrstoyanov commented Nov 20, 2020

@AdamBien
I liked your redux web components course (even left some feedback here). A couple of follow-up questions:

  1. How do you know when to use redux and when not. I know custom element events can end up in a mess in theory. Is it always better to start with redux knowing that the web app will grow? I am asking for your experience with client's projects - do all of your clients jump to redux right away or gradually, do X% of them use it ...?

  2. Have you considered redux toolkit as the better/successor redux library.

@AdamBien

This comment has been minimized.

Copy link
Owner Author

@AdamBien AdamBien commented Nov 23, 2020

Announcing https://foojay.io

@wanderer2097

This comment has been minimized.

Copy link

@wanderer2097 wanderer2097 commented Nov 25, 2020

Greetings Adam!

What suggestions do you have for a Java dev looking to learn JavaScript in order to get into the front-end world? Sticking to standards & avoiding frameworks is a given but I wonder if and how to invest my time to get up to speed with the fundamentals. Coming from Java, some of the features (e.g. lack of type safety, interpreted nature, objects without classes, etc.) are a little confusing. I'm just looking to get productive as fast as possible. Reading some of the other questions above I may not be the only one. Maybe an idea for the next airhacks on-demand workshop?

BTW - what is the suggested order of the Web workshops if someone is starting at ground zero (e.g. WebStandards Igniter --> WebComponents --> ???)

@wanderer2097

This comment has been minimized.

Copy link

@wanderer2097 wanderer2097 commented Nov 25, 2020

How to keep the service (boundary + control) layer DRY in an application with hundreds of entities? In your demos I typically see a REST resource & corresponding "Manager" on a 1:1 with an entity (at least a DDD "aggregate"). One way to address this could be to create a universal "Manager" using generics (including some cross cutting concerns like security) and inject it into a generic REST endpoint. The latter could then be subclassed with specific Entity type (and a corresponding URL path). I think I picked up in one of your talks (or workshops - can't remember) that you don't typically see inheritance used in the business code outside of maybe JPA entities. So are there any alternatives? Writing 100+ Managers and Resources gets old fast… Is it OK to introduce some inheritance - maybe at least for master data?

I was thinking of using some variations of the Gateway pattern from your green book but that seems difficult due to stateless nature of REST (and not quite ready to directly expose the Entity Manager to a javascript web client).

@wanderer2097

This comment has been minimized.

Copy link

@wanderer2097 wanderer2097 commented Nov 25, 2020

Within a single monolithic Jakarta EE application there exist two separate logical "modules" (single jar). Let's imagine a shipping module and a billing module. The business requirement is that as soon as a shipment is sent from the warehouse the customer must be invoiced. The shipping module should not know anything (or care) about the billing module or the invoicing process itself. It could, however, be responsible for raising an event (e.g. ShipmentSent). What would you recommend for communication between these - e.g. CDI events, JMS, outbox pattern, etc.?

Keep in mind - there could be instances where the shipment transaction succeeds (resulting in a commit in the db) but the invoicing fails (e.g. due to the customer record missing a billing address or (your favorite :-) VAT ID). In such cases there needs to be a way for the billing module (or some agent in between) to keep track of such "unprocessed" events in a queue so that they can be completed later on (i.e. when the customer master record is updated). Needless to say - the recovery mechanism will require some extra application logic/code (e.g. to reprocess periodically) but the critical point is how to keep track of this queue.

How does the answer change if the two modules are refactored later on to two separate applications?

@wanderer2097

This comment has been minimized.

Copy link

@wanderer2097 wanderer2097 commented Nov 25, 2020

How would you go about fulfilling dynamic entity projection requests from a REST client? Imagine a purchase order entity which has a lot of fields. Sometimes the client needs to read all and sometimes only a few but exactly which isn't known until runtime and is provided as query params. Also - there are associated entities (like order items). Sometimes the client wants to see them, sometimes not. Creating specific projection DTO's is therefore not an option. Need something similar to OData expand.

Using JSON-B adapters and serializers feels like a glorified DTO approach and the main pain point is there would need to be one for every class. JSON-P is good but it introduces coupling to a specific format (can't support XML then). At one point I implemented a simple object cloner running as the last step in the REST resource "GET" calls copying an entity instance to another instance of the same class but only picking and choosing the fields requested by the client and the rest was set to null (default JSONB skips nulls so this was kind of a hack). That seemed a little heavy handed though so I ended up writing a custom Message Body Writer and injecting @context UriInfo into it so that I can extract the list of fields & expand options requested by the client from the query params and perform the projection dynamically using reflection and some JPA metadata. That's probably not the best way to go about it - do you have any suggestions?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.