Hi Tibor,
Originally posted by Tibor Hegyi:
I have read through a couple of hudreds of threads in this forum to gain consistent understanding on approaches to creating diagrams for Part II.
Unfortunately, I could not resolve the ambiguties I found.
... you ar not the only one feeling that way. You will not be able to find "the one" stile because OOA/OOD/UML does not propose "the one".
1. What exactly should be drawn in the class diagram? I have drawn my extended, slightly changed BDM with some controller classes
a'la Cade.
2. What about classes not directly related to the business case but rather to the implementation details? I mean classes like
Command or Factory? Shall these go into the Component Diagram? If so, in form of classes or of components?
I decided to follow the practical AND well argued guidlines in
CT Arrington: "Enterprise
Java with UML", OMG Press, ISBN: 0-471-38680-4.
In my assignment (like in praxi) I first give a raw class diagram (business related plus Service Locator ...) a la Cade. It is also the way some project leaders prefere. But because I know that on real projects this will never be sufficient for the next crew that has to design in detail and to implement, I also include a refined class diagram showing the technical classes like your "Command or Factory" too. And i show the (preferably few!) dependencies between them, because this enables a good component diagram.
3. Which diagram is the sequence diagram built on? Some on this forum said it should be built on the Class Diagram showing
messages sent between classes. Some said (along with Cade) it should be built on Components showing interaction of components.
I decided to draw
- different raw deployment diagrams
. for getting an overview of the system and
. to understand the spec
- a refining Business Domain Model
. fixing all the gaps and bugs in the given one,
. well documenting my assumptions made
- a raw class diagram a la Cade
. (not important in my opinion, but
. testers might disagree and
. I do not want to loose points for that)
- then the interaction diagrams
. (not sure yet wether sequence or activity)
. because they could affect my detailed class diagram,
- the detailed class diagram
. including all classes of the
. interaction diagrams and
. all technical classes too
- the component diagram
- the final deployment diagram that
. also verifies the component diagram
This is a lot of work, but for me this way is even faster than allways being unsure about the "deliverables" / "results that MUST be delivered". And it is the honest, team oriented way.
I tend to think ... the sequence diagram should be based on the Component Diagram
As far as I know a Sequence Diagram should not be correlated to the Component Diagram nor to the Class Diagram nor to one Usecase but it should be related to one of the possible scenarios (main flow or alternatives) of a Usecase.
4. ... does each component have to have a corresponding class in the Class Diagram?
It must at least have one corresponding class, but according to M.Hitz "UML@Work" (in German), p.164, a component
1) is a physical, plugable, replacable part like a .java, .rel, .exe, .dll, .class,
2) has been produced within the implemented system,
3) can correspond to one or several classes modeled in the progress of requirements gathering, analysis or design.
4) Or according to P.Allen: "J2EE - SCEA...", p. 106, also "Java deployable components - JAR (Java Archive) files" or .ear.
5) And "you can think of this diagram as a kind of compile, JAR, and deploy description."
I know that this does not answer your question directly. From deploying I know that for deploying a component like an EJB all the .class needed by the EJB eighther must be packaged into the JAR file of the EJB or those common or shared .class files must be packaged in a separate JAR and must be made commonly available to the others. Is this thinking in deployment needs wrong for deciding what a component is? Is the JAR the component, or is the ejb.class?
Significantly in literature i did not find even one realistic component diagrams including a valuable description. In my 8 books directly related to J2EE and/or UML (not
Patterns, JMS, EJB,
Servlet, ...) only 4 (50%) know the phrase "component diagram" at all, but Sun gives 44% of the points for the component diagram. On the other hand Sun itself does as good as nothing to enlighten this phrase. C.Cade offers a pritty uncommented component diagram I would not dare to include in my assignment, and P.Allen on p.93 + 106 just writes 4 + 11 lines about Component [diagram] and then just shows an example consisting of one TradingApplication component, one J2EEApplicationServer node/component/object?? and one TradingSessionBeans subsystem, wihtout any comments at all. The need of component diagrams just a selling argument for Sun courses?
In C.Larman: "Applying UML and Patterns", p. 605 also "a browser" is a component - in contrary to "has been produced within the implemented system" stated by M.Hitz. And then: "... or a JAR file (such as for an Enterprise Java Bean)". And:
"UML components are usually shown within depoyment diagrams, rather than on their own." No example too.
* * *
Not even one commented, valuable Component Diagram, and 44% ....
I think I will treat as a component each:
- at least one shared JAR of server related classes,
- at least one shared common JAR (for server and client),
- each JAR of each EJB,
- the ServiceLocator,
- the BusinessDelegates (depends on ServiceLocator)
- each Factory
- each WebCommand/Command pair
- each
JSP or Servlet,
- the Java-client in total,
most of them having a dependency arrow to at least one shared JAR file.
Thomas.
[ February 27, 2004: Message edited by: Thomas Taeger ]