Skip to content

Instantly share code, notes, and snippets.

@AdamBien
Last active October 1, 2018 15:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AdamBien/fb7518c9d077c9f8b8dcf771a5b8b196 to your computer and use it in GitHub Desktop.
Save AdamBien/fb7518c9d077c9f8b8dcf771a5b8b196 to your computer and use it in GitHub Desktop.
55thAirhacksQ&A.md
@jarryDk
Copy link

jarryDk commented Oct 1, 2018

Dear Adam

avdiu asked "What are your thoughts on Java 9, 10?" - I like to hear about Java 11 and why stop there - that about Java 12 especially JEP 335: Deprecate the Nashorn JavaScript Engine

Thank you,

Michael

@franden
Copy link

franden commented Oct 1, 2018

Hi Adam,

Thank you for your great job (blog, podcast, sessions...). I have a question to your recent post: http://adambien.blog/roller/abien/entry/what_is_dependent_scope

In an ECB/BCE application, the boundary is annotated with @Stateless and all other control instances come as vanilla POJOs without any annotations. They are dependent-objects

that would mean that the complete "web application" would have the same scope like the stateless bean and because the EJBs are pooled resources, all injected CDI beans would be injected and created only once per EJB. This approach can lead to unexpected behavior if you use CDI for instance variable injection because they will not be "reinjected" in this case e.g:

@Stateless
public class SomeRandomService
{
    @Inject
    @ConfigProperty(name = "endpoint.poll.interval")
    private Integer pollInterval;

    @Inject
    @ConfigProperty(name = "endpoint.poll.servername")
    private String pollUrl;

    ...
 }

In such case "pollInterval" and "pollUrl" are injected only once a EJB is created. If the configuration is changed afterwards, already created EJBs SomeRandomService will still use the old values.

To avoid such side effects, all our beans are ether annotated with @RequestScoped (especially on boundary package) or inject objects with getter to retrieve current state.

How do you deal with such problems? Are your really not using @RequestScoped bean in your ECB applications?

@t-shaguy
Copy link

t-shaguy commented Oct 1, 2018

Hello Adam, a big thanks to this awesome gift of invaluable education. Please in trying to deal with the concerns of multiple integrations are ESBs the way to go in an enterprise environment ? Many thanks

@huxendupsel
Copy link

Hello Adam,
short question about the CDI/EJB coexistence inside JEE. Over the last specifications of JEE CDI became more and more powerful. Nowadays you even have the transaction handling on board. So, what do you think about CDI, is it capable of replacing EJBs? Would you recommend the use of CDI over EJBs so you will not have to handle mixed forms, where you have to deal with eventual incompatible context scopes, or is it worth to stick on EJBs to do the job they where designed for?
Thanks a lot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment