Question

I don´t really unterstand why i should create a managed bean which is accessing the business bean. I mean i want to create a page where a product list is displayed. Therefor i have to create an entity "product", a bean where the business logic happens (list, create,...) and a managed bean where i access the business bean. In my case in the managed bean there will be the exact same methods as in the business bean. Is that correct?

Illustration:

JSF calls ManagedBean.list()
ManagedBean calls BusinessBean.list()
Was it helpful?

Solution

You might put and run everything in one black box, but it's not recommended.
The Enterprise JavaBeans are supposed to perform actions related to the database or external resources. The managed beans are responsible of interaction with your pages (View) and with those EJB (Logic). The JSF framework respects the MVC architecture which isolates the layers from each others: your entites and logic layer (Model) and your pages (View).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top