• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Part 2 doubts

 
Aditya Kumar
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am working on the assignment right now, and I had a few doubts which I hope the people here can help me with.

The current flow of my application is:
JSF->Managed Bean->SLSB->DAO->EntityManager

I am considering EJB3 framework. My first doubt is - I have seen a few blogs where it is said that the DAO for Entity bean should be implemented via a Stateless session bean. In my scenario, I have visualized the business logic in the SLSB and that is going to access the DAO. So if the DAO is a SLSB too, would this make sense at all? Is there anything inherently wrong with my approach?

The other doubt I have is that I am considering a third-party caching mechanism (Ehcache) to be used in my system. I know for sure that it should be in my component diagram. Do I need to show that in my sequence diagram? If yes, then will I need to show that in my class diagram too?

I truly appreciate your replies.

Thank you,
aditya

 
Amritendu De
author
Ranch Hand
Posts: 188
11
Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I feel its okay to use Stateless Session Bean as DAO. I would rather go with a Oracle solution of Cache instead of using EHCache. Perhaps a Singleton Session Bean as cache.
 
Aditya Kumar
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you, Amritendu, for your reply. Using the Stateless Session bean as DAO will lead to a flow like: JSF->Managed Bean->SLSB1->DAO(SLSB2)->EntityManager

SLSB1 is the stateless session bean that houses my business logic and then the SLSB2 will be the DAO. That should be alright?

About the Ehcache - I think I should have mentioned that it is an entirely different context. I have an external datasource that is exposed via a Web Service. It is to avoid the call to that web service (which will be an expensive call I know) I am trying to cache the binary data using Ehcache. That sounds ok?

Thank you again,
Aditya
 
Amritendu De
author
Ranch Hand
Posts: 188
11
Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes the flow JSF->Managed Bean->SLSB1->DAO(SLSB2)->EntityManager is correct.

My main concern about using a non-Oracle solution is that the examiner may not be aware of it. Please document the usage in the assumptions section so that the examiner knows what you are trying to do.
 
Aditya Kumar
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Amritendu,

I do understand your concern and will consider it. In my opinion, Ehcache is a well known Java based caching framework so personally, I do not think it should be a problem. However, if someone here thinks otherwise, please do let me know.

My question about that remains unanswered though - since it is a third party component, do I need to show it invoked in the sequence diagram? If yes, do I need to show it in the class diagram as well? My guess, right now, is that it should be be in the component and sequence diagrams (and in the sequence diagram it can be mentioned that it is a third party component - not to be implemented). Any comment, anyone?

Thank you Amritendu for your reply,
Aditya
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic