Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Component Diagram

 
Anil Vupputuri
Ranch Hand
Posts: 527
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is the only area where help is very limited.

Few questions to gurus,

(1) Should Component diagrams contain only components (EJB, JSP, etc) but not classes?

(2) Can we display all the Business Classes in Class diagram as Interfaces in Component diagram.

For eg., Payment class in Class diagram changes to IPayment in component diagram

(3) Can Component diagram have Classes not defined in the class diagram (such as SessionMgr, LoginMgr, ProfileMgr etc.,), these are just validation components but not business entities.

(4) ServiceLocator component cluttering the diagram. As EJB dependency relationship has to use the service locator to lookup the bean. There are few Session/Entity EJB's need a service locator then I have too many lines crossing each other in the diagram. Any idea?

(5) For checking user authenticity or user log-in before heading for critical operations (like payment), how to validate these conditions in component diagram. Say if we already have a business component (SLSB) which do these checkings then how to draw this invocation before heading for business operation everytime.
[ September 24, 2004: Message edited by: Anil Vupputuri ]
 
Ramon Gill
Ranch Hand
Posts: 344
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Anil,
I'm not a guru but I'll answer as best I can. Hopefully, some others can answer as well, as i'd be interested in other points of view.

1. yes. No classes in component diagrams (see Cade). I think the class diagram is more applicable to the Sequence diagram. Its the Sequence diagram that ties the Class & Component diagrams together (see Cade examples).

2. Personally, if you need to show an interface to an external system thats fine, but I don't think this is related to classes in the class diagram. Cade shows a number of interfaces other than the example you gave with none of them in the class diagram.

3. I think you can have 'components' that may not be obvious from the class diagram, but keep classes out.

4. Check Cades Component diagrams. He uses a Service Locator to link between Web and EJB tiers only, not between EJB components. I think this is a good choice from Cade, and doesn't add clutter.

5. Do we need to drop down to this level? I would tend to stick to higher level architectural components (i.e. the basics).

Ray
 
Parag Doshi
Ranch Hand
Posts: 317
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ramon Gill:
Anil,
I'm not a guru but I'll answer as best I can. Hopefully, some others can answer as well, as i'd be interested in other points of view.

1. yes. No classes in component diagrams (see Cade). I think the class diagram is more applicable to the Sequence diagram. Its the Sequence diagram that ties the Class & Component diagrams together (see Cade examples).

2. Personally, if you need to show an interface to an external system thats fine, but I don't think this is related to classes in the class diagram. Cade shows a number of interfaces other than the example you gave with none of them in the class diagram.

3. I think you can have 'components' that may not be obvious from the class diagram, but keep classes out.

4. Check Cades Component diagrams. He uses a Service Locator to link between Web and EJB tiers only, not between EJB components. I think this is a good choice from Cade, and doesn't add clutter.

5. Do we need to drop down to this level? I would tend to stick to higher level architectural components (i.e. the basics).

Ray



Ray,
A question on your 3rd answer. If some of my domain classes are implemented as entity beans ('component') and others as plain java classes, so, should i not show the POJOs in component diagram? What is the reasoning behind this implementation distinction? Or am I not understanding the concept?
Cade doesnt show an entity beans in his component diagram, why is it so? is it because he might not have used any entity beans?

Parag
 
Jiboo John
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Parag,

Cade has used SLSB -> DAO and not entity beans.
 
Ramon Gill
Ranch Hand
Posts: 344
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You shouldn't show classes in the component diagram, but if you do it will become too large. Cade shows DAO 'components'. When you look at the accompanying sequence diagrams, these show how the DAO components access classes.
Even if you use entity beans you can still use Cade's approach. You could add some notes to state the persistence being used.

Ray
 
Parag Doshi
Ranch Hand
Posts: 317
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ramon Gill:
You shouldn't show classes in the component diagram, but if you do it will become too large. Cade shows DAO 'components'. When you look at the accompanying sequence diagrams, these show how the DAO components access classes.
Even if you use entity beans you can still use Cade's approach. You could add some notes to state the persistence being used.

Ray


Ray,
Some of my domain objects are entity beans (implementation) and others are POJOs. Now, if I show the entity components and not show the POJOs, then I miss out on the dependency btw the entity and the POJOs. Is it alrite if that detail is lost (as it is already shown in the class diagram)?
Another question, is the association relationship in class diagram related to the dependency relationship in component diagram? Do they both mean the same thing?

Parag
 
Anil Vupputuri
Ranch Hand
Posts: 527
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ray..thanks for attempting, you're the humble guru...


1. yes. No classes in component diagrams (see Cade). I think the class diagram is more applicable to the Sequence diagram. Its the Sequence diagram that ties the Class & Component diagrams together (see Cade examples).


Yes, it's true to some extent, without classes it looks like blueprint (skeleton) of the system having only J2EE pattern related stuff. But do we need to come out with all the names of JSP/Swing components in the system, isn't this too implementation detail.
I'm leaning towards having just one JSP/Swing component for each use case in Web-tier.


3. I think you can have 'components' that may not be obvious from the class diagram, but keep classes out.



Cade doesn't even show any EntityBeans....does it mean no EB's in the example.
 
Ramon Gill
Ranch Hand
Posts: 344
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Cade does not distinguish between POJO's or Entity beans (CMP or BMP) in the class and sequence diagrams, leaving then as just classes. I suspect this is because he may have decided that this is either a design issue (further along the track), or he may have mentioned this in notes for each diagram.

I have seen threads from people who have passed who stated they used single JSP/Swing components, and then mentioned in notes all the possible views. When you think about it, you can't possibly know all the screens you may need at this high level diagram, so early in a project.

I believe its the sequence diagrams that show how the class and component diagrams fit together. Don't get hung up on a connection between class and component diagrams. Just my view though.

Ray
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic