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?
(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,
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.
Looks like a violation of the mvc pattern to me.
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.
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.
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.