File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Architect Certification (SCEA/OCMJEA) and the fly likes Question on MDB/Service Activator in Business Layer Component or Integration Layer Component. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Architect Certification (SCEA/OCMJEA)
Bookmark "Question on MDB/Service Activator in Business Layer Component or Integration Layer Component." Watch "Question on MDB/Service Activator in Business Layer Component or Integration Layer Component." New topic
Author

Question on MDB/Service Activator in Business Layer Component or Integration Layer Component.

Madhu Maniganta
Greenhorn

Joined: Nov 27, 2010
Posts: 14
Hi,
I am following Cade style for my part 2 component diagram. I have a question about MDB in component diagram. I have an ServiceActivator/MDB (which is an Integration Layer component) calling an SLSB which is a Business Layer component, is it okay to have an <<uses>> arrow in the opposite direction than the normal flow, from Integration layer to Business layer? To add further to this the SLSB calls a DAO in the integration layer. So its MDB--->SLSB-->DAO. MDB and DAO in are the same layer.Is this acceptable?
Alternate solutions:
(a)Let MDB do the business logic and not call/have the SLSB, MDB calls the DAO.
(b)Include MDB in the same Business Layer component as SLSB, but can I move the integration layer component to Business layer?

Thanks a lot,
Madhu.
Venkat Kantamani
Greenhorn

Joined: Dec 13, 2010
Posts: 17
If you follow Cade style then you should opt for option b.

I accept that MDB is integration level component. But it varies from case to case. If you are doing some business logic inside it and it's further invoking a DAO to interact with the external system, then it's fine to place MDB in the business later and keep the DAO in the integration later. You no need to show how the MDB is invoked in the component diagram(Similar to the Cade's diagram).

I'm not as expert in the components diagram, so I don't take my words as final. I'm just trying to tell what I felt is the right way to do it. If some expert in the group comments on this, it would be better.

-Venkat
Madhu Maniganta
Greenhorn

Joined: Nov 27, 2010
Posts: 14
Thanks..will wait on more people to respond
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30136
    
150

I think your approach is fine. In the real world, I wouldn't have an MDB call a DAO directly. I'd let it stay as a pure messaging layer and delegate everything.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Madhu Maniganta
Greenhorn

Joined: Nov 27, 2010
Posts: 14
Thanks Jeanne, can I place an MDB in the Business layer of component diagram? Or should I show a call back from Integration layer? because ServiceActivator/MDB is an integration layer component...isn't it? But if I have a call back to SLSB which calls a DAO again doesn't it look messy?
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30136
    
150

Madhu,
It's a judgment call. There isn't a right/wrong answer.
Madhu Maniganta
Greenhorn

Joined: Nov 27, 2010
Posts: 14
Okay thanks a lot Jeanne! if I place this MDB as a part of business layer component, which has <<uses>> from a JSP component... Do you think that's misleading? Because MDB is invoked by container and not JSP. The reason for this question is that MDB does inventory updates logic for which I already have a component..but that component is called by JSPs..thanks a lot again
Alexandre Delalieu
Greenhorn

Joined: Oct 06, 2010
Posts: 13
Would you really call a mdb directly from a JSP on a project ?

Looks like a violation of the mvc pattern to me.
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30136
    
150

Madhu Maniganta wrote:Okay thanks a lot Jeanne! if I place this MDB as a part of business layer component, which has <<uses>> from a JSP component... Do you think that's misleading? Because MDB is invoked by container and not JSP. The reason for this question is that MDB does inventory updates logic for which I already have a component..but that component is called by JSPs..thanks a lot again

This is the first mention I see of a JSP in this thread. A JSP should not be using an MDB. A JSP is responsible for the view and should not call any Java code let alone an MDB. The JSP should not be calling any other components either for that matter.

I think you might be saying something else, so yes it would be misleading. Your statement is also misleading.
Madhu Maniganta
Greenhorn

Joined: Nov 27, 2010
Posts: 14
Sorry for the confusion guys I meant JSP component, missed the word component there. I apologize.

The below question is irrelevant to the above one.
Now I have a question about inter component talk within a layer, say a Business Layer component (say A) uses a class in another Business Layer component (say B) should I show an arrow from A---> B? or is it okay not showing it because both are from the same layer.

Thanks,
Madhu.
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30136
    
150

Madhu Maniganta wrote:Sorry for the confusion guys I meant JSP component, missed the word component there. I apologize.

That's not any clearer. What is the "JSP component"? It sounds like the JSPs.

Madhu Maniganta wrote:Now I have a question about inter component talk within a layer, say a Business Layer component (say A) uses a class in another Business Layer component (say B) should I show an arrow from A---> B? or is it okay not showing it because both are from the same layer.

Yes. You should show interactions between components.
 
 
subject: Question on MDB/Service Activator in Business Layer Component or Integration Layer Component.
 
Similar Threads
Is it necessary to use statless sessiob bean as proxy to web service?
MDB-SLSB in Component Diagrams
DAO Layer
Web-service client and Session Beans ?
does web service proxy go in Integration Tier?