aspose file tools*
The moose likes Architect Certification (SCEA/OCMJEA) and the fly likes Class/Sequence diagram questions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Architect Certification (SCEA/OCMJEA)
Bookmark "Class/Sequence diagram questions" Watch "Class/Sequence diagram questions" New topic
Author

Class/Sequence diagram questions

Zm Mohammed
Greenhorn

Joined: Jul 01, 2009
Posts: 14
Hi friends,

I have a Stateless Session Bean which is acting as a Web Service client and I am using EJB Timer Service to invoke the Web Service at regular intervals.

1) Do I need to show the EJB TimerService in the Sequence diagram to show that the Web Service is invoked at regular intervals or can I just mention it in the notes?

2) I have read discussions which ask to show all classes in Sequence diagrams in the Class diagram. If my above mentioned SLSB is just invoking an external system and not interacting with any other classes, how do I show it in the Class Diagram?

Thanks in advance!
san kumar parihar
Ranch Hand

Joined: Dec 05, 2010
Posts: 30
In my opinion:

1) Both. You may use Loop Fragment with [0,*] iterations and add notes. I have not seen any notation in sequence diagram (is there any?) to denote activities that occur periodically so you need to mention that in notes
2) I have similar situation and I am inclined towards using an isolated class digram (on side of main class diagram). Fortuantely I have more to depict that what you have
Nilessh Ganu
Ranch Hand

Joined: Dec 22, 2009
Posts: 100
Zm Mohammed wrote:Hi friends,

I have a Stateless Session Bean which is acting as a Web Service client and I am using EJB Timer Service to invoke the Web Service at regular intervals.

1) Do I need to show the EJB TimerService in the Sequence diagram to show that the Web Service is invoked at regular intervals or can I just mention it in the notes?

2) I have read discussions which ask to show all classes in Sequence diagrams in the Class diagram. If my above mentioned SLSB is just invoking an external system and not interacting with any other classes, how do I show it in the Class Diagram?

Thanks in advance!


Hi,
I am also planning to use EJB TimerService. Did you thought off the option of assuming an asynchronous WS ?
Once the WS has the data generated, we will get it right a way, something like this.


Nilesh
SCJP SCWCD OCMJEA
Raja Pal
Ranch Hand

Joined: Jul 12, 2004
Posts: 92
If the event of the timing interval is to be depicted use the UML Diagram - "Activity Diagram" - which can best represent this! Sequence only shows the timing order of method calls not the trigger/time event of the method call. However you can use the sequence diagram with the timer(int inerval) method invocation depicted on the service instance.


Java Pal - Your friend in technology and innovation...India.
Raja Pal
Ranch Hand

Joined: Jul 12, 2004
Posts: 92
Sorry missed you question 2 in my post.
If the classes implementing your functionality here are outside your scope, simple depict their component interface in the class diagram nd use the component diagram to elaborate the implementation details.
Zm Mohammed
Greenhorn

Joined: Jul 01, 2009
Posts: 14
Thanks for replying guys. After checking everyday I actually lost hope that someone is going to reply to this. Its good to see other people in the same boat, it boosts confidence.
san kumar parihar wrote:In my opinion:
1) Both. You may use Loop Fragment with [0,*] iterations and add notes. I have not seen any notation in sequence diagram (is there any?) to denote activities that occur periodically so you need to mention that in notes
2) I have similar situation and I am inclined towards using an isolated class digram (on side of main class diagram). Fortuantely I have more to depict that what you have

San Kumar,
I have to depict that the SLSB (WS client) invokes the Webservice once every month. In my opinion, loops in Sequence diagrams are used for "Number of Elements" and not for "Number of Days" . Like "Loop for each particular element" may be right but can we also use the loop in the sequence diagram for "Loop for each month"? Correct me if I am wrong.
Raja Pal wrote:
If the event of the timing interval is to be depicted use the UML Diagram - "Activity Diagram" - which can best represent this! Sequence only shows the timing order of method calls not the trigger/time event of the method call. However you can use the sequence diagram with the timer(int inerval) method invocation depicted on the service instance.

Raja,
I am reluctant to show the Activity Diagram. Can you please elaborate on the "timer method invocation depicted on the service instance"?
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Class/Sequence diagram questions