Java EE 6 - SEAM + EJB integration / 3 tier architecture
-
11-06-2021 - |
Question
I've been using JSF 2.1 & EJB 3.1. So far, my aplication have such flow:
- Facelets template
- @ManagedBean connected to .xhtml page
- @Stateless EJB bean that uses EntityManager to get entities from DB etc
- EJB bean is injected to @ManagedBean via @EJB
So basically for 1 entity class I have 2 classes and 1 xhtml page.
Now, I'm starting new project with SEAM 3 (solder, faces, security and validation modules). How can I simplify application flow? Can I use EntityManager inside JSF bean and get all EJB functions, like transactions etc? How can I organise my project (entity classes, bean classes, service classes)? Thanks for help!
Solution
How can I simplify application flow?
From what you are wrote i don't thinks that you have some complicated architecture.
Can I use EntityManager inside JSF bean and get all EJB functions, like transactions etc?
If this is possible why should you do that?
How can I organise my project (entity classes, bean classes, service classes)?
I would say that your application organisation should not be changed.