I just came into a new job, I started working with a very old application, we have no architect and any of the developers really cares or understand much about doing things right. I have zero experience on JSF and EJB and I would dare yo say that this app architecture is not very well planned.
We have like four main layer, and I say "like four" because most of the time the developer put business logic in the presentation or DAO layers, and the design is made thinking in business process instead of entities, so there's a lot of duplicated code.
1) JSF managed beans
This clases are defined with @ManagedBean and @ViewScoped. Most of the times all the business logic is inhere.
2) Managers EJB (?)
These classes are defined as @Stateless and with @Resource pointing to a global SessionContext
3) Services, also EJB
This classes are defined as @RequestScoped, according to what I been told, business logic should be here.
4) DAOs Layer
Normal data layer.
Now the questions....
Layers 2 and 3 should be only one right?
Having the first layer defined as ViesScoped, the second one as Stateless and the third one as RequestScoped, is a normal practice? Is EJB identifying the request properly even if I have the first layer as ViewScoped?