I read a lot about replacing EJBs with CDI Beans as they often offers the same functionality and so on. This made me think of where CDI beans belong to. With EJBs I knew they belong to be EJB-Container (Figure 1-7, https://docs.oracle.com/javaee/6/tutorial/doc/bnacj.html), but with CDI I can not really think of the seperation between Web- and EJB-Container. Are the CDI beans 'managed' in the Web- or EJB-Container?
I have the feeling that the borders become blurred. With EJBs I simply thougt the EJB Container kind of represents my business tier. But now the borders between business tier and presentation tier are more logically.
So if I now make more use of CDI beans where possible, is it possible and good practice to communicate events from the business tier to the presentation tier via CDI Events?
When I want to write an application with multiple application servers for load balancing, do I need the remoting capability of EJBs? Or do you use session affine load balancing for such purpose?
UPDATE:
I thought about that a bit further and I think that it is not that easy to answer. As in the link i posted, managed beans belongs to the Web container as well as to the ejb container. So I think you can place CDI scoped beans (request, session) to the web container, as the ejb container doesn't know anything about this scopes. But whats about application scoped beans?
I also noticed that this blurry borders are also caused by how the application server handles the BeanManager. In this blog https://struberg.wordpress.com/2015/02/18/cdi-in-ears/ is explained, that there are different ways how application servers handles BeanManagers. There seems to be no clear specification for this.