aspose file tools*
The moose likes Architect Certification (SCEA/OCMJEA) and the fly likes sequence diagrams for web and java client ? 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 "sequence diagrams for web and java client ?" Watch "sequence diagrams for web and java client ?" New topic
Author

sequence diagrams for web and java client ?

tony clare
Ranch Hand

Joined: Apr 19, 2006
Posts: 31
I'm working on the assignment part 2 and have a question for the sequence diagrams. do I need to create two sequence diagrams one for web users and the other for swing users ? here, the swing users are travel agents. thanks
Thomas Taeger
Ranch Hand

Joined: Dec 16, 2002
Posts: 311
Hello Tony,
Originally posted by tony clare:
do I need to create two sequence diagrams one for web users and the other for swing users ?

Are the sequence diagrams for both totaly equal? Then one diagram could be sufficient, used by a double-roled "...OrAgent" actor.

However, I divided them, i.e. constructed two nearly trivial 10 second diagrams for both and generalized as much as possible common behaviour to a third common sequence diagram. This is automaticaly a great preparation for the component diagram(s) that many get in trouble with later.

In UML 2.0 you can reference the third one using the ref keyword (you may want to use the Search link of this forum for details).

Thomas


www.classic-and-class.com - www.evalulearn.com
Interfaces are the glue of OO.
Laxmi Raghu
Ranch Hand

Joined: Feb 16, 2005
Posts: 218
I suggest you include sequence diagrams for both swing and application client. I scored very low and i feel one of the reason is i never showed swing clients in my sequence diagrams.
tony clare
Ranch Hand

Joined: Apr 19, 2006
Posts: 31
quote:
----------------------------------------------
Are the sequence diagrams for both totaly equal? Then one diagram could be sufficient, used by a double-roled "...OrAgent" actor.
----------------------------------------------
Not 100% equal since the sequence for web users includes the servlets in web tier, and the sequence for Swing users doesn't includes the servlets.
Saritha Penumudi
Ranch Hand

Joined: Aug 18, 2003
Posts: 147
If both the Web and Swing components are using same business logic why cant we have a generic Actor called UI, which initiates business logic and shows flow from there. by this I guess we think in terms of genralizing the business functionality and put more effort in code reuse.

We can draw seperate sequence diagrams for Swing and Web application.
In these diagram for the business part logic we would refer to the above sequence diagrams.

Do you see any downfall for this approach?
Thomas Taeger
Ranch Hand

Joined: Dec 16, 2002
Posts: 311
Originally posted by Saritha ventrapragada:
If both the Web and Swing components are using same business logic why cant we have a generic Actor called UI, ...

Even if we had such a "generic Actor called UI" or "double-roled '...OrAgent' actor": As Tony Clare noted the sequence diagrams for both are "not 100% equal since the sequence for web users includes the servlets in web tier, and the sequence for Swing users doesn't includes the servlets." - and other controllers for the Swing GUI.


Originally posted by Saritha ventrapragada:
... generic Actor called UI, which initiates business logic

An actor should not (at least not directly) initiate any business logic, not for technical but for design pattern reasons. The needed conjunction is a web-server-side frontcontroller/helper and a client-side GUI/Swing controller/model.

These then can re-use the same common logic proposed by you.


Originally posted by Saritha ventrapragada:
We can draw seperate sequence diagrams for Swing and Web application.
In these diagram for the business part logic we would refer to the above sequence diagrams.

If you mean Swing and Web sequence diagrams referencing the same common logic sequence diagram: Yes.

And this common logic sequence diagram then can refer to a common app server logic sequence diagram.

Thomas
tony clare
Ranch Hand

Joined: Apr 19, 2006
Posts: 31
by using reference, I understand there are 3 sequence diagrams for each use case: web client, swing client and a common shared EBJ tier. Right ?
Saritha Penumudi
Ranch Hand

Joined: Aug 18, 2003
Posts: 147
Originally posted by Thomas Taeger:

An actor should not (at least not directly) initiate any business logic, not for technical but for design pattern reasons. The needed conjunction is a web-server-side frontcontroller/helper and a client-side GUI/Swing controller/model.


I am sorry. What are the design pattern reasons that will not recommend doing something like this.

I am thinking of n tier application.

[WebUI]/[Swing UI] ---- Front Controller(POJO that initiates business logic) ---- business classes --- DAO classes

Sequence diagrams:
1. have a sequence diagram that shows logic from Front controller till DAO.
2. Sequence diagram that show web UI flow (which includes actors (can be users/other application), servlets)
3. Sequence diagram that show flow for Swing UI (which includes controllers and models)
tony clare
Ranch Hand

Joined: Apr 19, 2006
Posts: 31
The common architecture are:
[WebUI] ---- Front Controller ---- business classes --- DAO classes
[Swing UI]------------------------------^

But you dont' want to lose Front Controller logic in the sequence diagram by drawing a single diagram including [a common UI] --- business --- DAO only.
Saritha Penumudi
Ranch Hand

Joined: Aug 18, 2003
Posts: 147
I am sorry I should not be using terms loosely.

Actually I was thinking of one more layer of POJO classes (like facade classes) between UI components and business classes that would get requests from either WEB UI or Swing UI. The logic from there will be same for both Web and Swing UI requests, which can be shown in one sequence diagram.

These classes will have logic for JNDI look up and so on..
Thomas Taeger
Ranch Hand

Joined: Dec 16, 2002
Posts: 311
Originally posted by tony clare:
by using reference, I understand there are 3 sequence diagrams for each use case: web client, swing client and a common shared EBJ tier. Right ?

I see a fourth between the two client types and the "common shared EBJ tier": A sequence diagram generalizing common behaviour of the two client sequence diagrams and then referencing the app server sequence diagram ("common shared EBJ tier"). It is not a must, ok, but it reduces redundant parts of the client sequence diagrams, like fetching values from the model/helper, looking up the EJB, delegating business methods to the app server, ...

Thomas
[ June 28, 2006: Message edited by: Thomas Taeger ]
Thomas Taeger
Ranch Hand

Joined: Dec 16, 2002
Posts: 311
Originally posted by Saritha ventrapragada:
Actually I was thinking of one more layer of POJO classes (like facade classes) ...

Ok. That is what I would call the Session Facade pattern between, regardless of wether POJO or Session EJB implementation.

Thomas
Saritha Penumudi
Ranch Hand

Joined: Aug 18, 2003
Posts: 147
Great...
We all are on same page now..
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: sequence diagrams for web and java client ?