M. A. Riveros T. wrote:
Sure it does.
Sorry, but I disagree. What I expect from a company as large and prestigious as Oracle is a minimum of consistency: overall minimum PASS score should be equal to the sum of the section's minimum PASS scores...
jianming chen wrote:
1. Do you have such a requirement?
We do have requirement like this. Sometimes we want to create some sort of quick tool outside of the Web Application which requires access to the database. Or sometimes Swing application.
jianming chen wrote:
Yes, but DAO is an integration tier pattern. Based on the DAO pattern definition on Core J2EE Pattern, Use a Data Access Object (DAO) to abstract and encapsulate all access to the data source. The DAO manages the connection with the data source to obtain and store data.
jianming chen wrote:
Jaime Bravo wrote:
2. On the other side, SLSB is an artifact and not the service tier, itself. So without problems, an SLSB could be in integration tier.
I think the idea of injecting EntityManager into SB is kind of mixing business tier and integration tier. The boundary of each tier is not clear any more. The major benefits of EJB container are security, transaction management. So it's best for business tier. DAO layer should be able to site outside of EJB container. Probably you want to re-use DAO component in other project deployed outside of EJB container.
jianming chen wrote:
DAO pattern should provide unified interface for any kind of resources. It doesn't make much sense to wrap any other resource accessing code inside SLSB. Such as LDAP access, Web service client etc.
jianming chen wrote:
Jaime Bravo wrote:
But actually look up a dependency from inside the DAO class is not a good practice, because you're creating a dependency with the lookup mechanism and details about the same one. And this fact adds another responsability to the DAO class, that is: find its dependencies. So the class becomes less cohesive. For example if you change the JNDI name for the dependendy then....you know. So Dependency Injection pattern is the winner against the Service Locator pattern.
Before EJB container can specify other classed inside DI context, I'd rather use other DI provider to manage dependencies in DAO layer.
Krzysztof Koziol wrote:In my design I put Adapter between system and SLSB. In the Component Diagram it will be placed in the integration tier.
Jeanne Boyarsky wrote:In the sequence diagrams, I showed the session bean calling the entity manager. I named that class entity manager since it is a built in class.