Ask questions and see you at October, 1st, 6.PM. CET: http://www.ustream.tv/channel/adambien
Also checkout recent episode:
Ask questions and see you at October, 1st, 6.PM. CET: http://www.ustream.tv/channel/adambien
Also checkout recent episode:
Hello Adam,
thank you for doing the airhacks.tv, I have two questions.
Thank you,
Antonin
Hi Adam,
I have a question about testing/mocking. I created a small and simple project for this: https://github.com/omega09/aTester
A few things to note about it: 1. It's an Eclipse project so it has Eclipse files you can ignore. 2. There are classes in the entities package which are not annotated with JPA because it's not important here. 3. The business logic doesn't make much sense but it's an example. 4. I added a Mockito dependency but you don't have to use it.
I would like you to show how you would write a test for the ActionExecutor.doAction
method. I already created a class for this in the test source folder. The test can be whatever you want, I just want to see things like when you use new
, when you mock, how you set the injections, how you set up the overall test (populate pre-existing relevant fields), choose a runner, etc.
On the same topic, how relevant is your vid A Note On Java EE Testing today?
Thank you and enjoy the homework assignment :)
Another question if you have time, if not I can ask next month.
JavaEE 8 added SSE in JAX-RS 2.1. SseEventSource has reconnection support which tries to resend all missed events, but says
Note however, that this is a best-effort mechanism which does not provide any guaranty that all events would be delivered without a loss. You should therefore not rely on receiving every single event and design your client application code accordingly.
If I want to make sure that all the events were sent, and if not - to send those that weren't, how would you recommend to do that?
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
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?
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
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.
Hello Adam,
Not sure if you got my question on twitter, so I'll ask it here as well:
Usually you tend to work with in memory models in your demos. I'm interested if You could show us some examples on how you typically handle Database operations via JPA? What best practices do you recommend for seeding / bootstrapping databases and models? Do you prefer Flyway, or Liquibase (maybe something else)? I'm mainly interested in your approach since you are an active advocate for the platform. I'm hoping for a demo ;-)!
Thank you,
Norbert