This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Architect Certification (SCEA/OCMJEA) and the fly likes visibility issue for class diagram Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Certification » Architect Certification (SCEA/OCMJEA)
Bookmark "visibility issue for class diagram" Watch "visibility issue for class diagram" New topic
Author

visibility issue for class diagram

Dhiren Joshi
Ranch Hand

Joined: Dec 09, 2003
Posts: 463
Given these design guidelines.. I need expert advice from SCEA's ..
I got this info from this link ..

http://www.agilemodeling.com/style/classDiagram.htm#IdentifyResponsibilities
<<
The visibility of an operation or attribute defines the level of access that objects have to it, and the UML supports four types of visibility that are summarized in Table 1. Visibility is an important design issue, on detailed design models you should always indicate the visibility of attributes and operations, an issue that is typically not pertinent to domain or conceptual models. Visibility on an analysis/domain model will always be public (+) so there is little value in indicating this.

>>

Now the problem I have is I have already designed 90% of my diagrams with different visibility then public
Will this have any impact .. Should I change all to public visibility ..

Thanks
Dhiren
Tomi Tuomainen
Ranch Hand

Joined: Jun 13, 2004
Posts: 86
I think public (+) could be suitable, if we don't want to create bean style get/set-methods. On the other hand Cades SCEA book suggests that attributes are not necessary, the designers will add them later. So I'm thinking to model just classes without attributes or operations. Any thoughts if I'll fail for this?
Ramon Gill
Ranch Hand

Joined: May 15, 2003
Posts: 344
Tomi,
.... interesting ...I like the idea of no attributes and no operations (see Larmans book). I also think navigation should go as well even though Cade uses it.

It would be interesting to hear from people who passed to see what they did.

Ray
Dan Drillich
Ranch Hand

Joined: Jul 09, 2001
Posts: 1180
Dhiren,

The visibility indicator is specific to every attribute/operation. So, you need to look at each one of them and make the decision.
Naturally, you want as few as possible to be public.

Regards,
Dan
[ July 12, 2004: Message edited by: Dan Drillich ]

William Butler Yeats: All life is a preparation for something that probably will never happen. Unless you make it happen.
Dhiren Joshi
Ranch Hand

Joined: Dec 09, 2003
Posts: 463
Dan ,
I agree with you about different visibilites and I did have it done with different visibilites but this line makes me think it is not the right guidlines standard to show private/protected excep public in analysis /domain class diagrams
<<
Visibility on an analysis/domain model will always be public (+) so there is little value in indicating this.
>>
..Any thoughts.. .
I have attributes and some methods defined and I dont really want to redo my class diagram fully.. to remove them all out.


Thanks
Dhiren
Dan Drillich
Ranch Hand

Joined: Jul 09, 2001
Posts: 1180
Dhiren,

At the top of the page, Scott Ambler defines the typical different usages of class diagrams:

- Explore domain concepts in the form of a domain model
- Analyze requirements in the form of a conceptual/analysis model
- Depict the detailed design of object-oriented or object-based software

Later on he says: "Visibility on an analysis/domain model will always be public (+) so there is little value in indicating this."

So, the first two types will always use public visibility and only the detailed design class will use the entire set of visibilities.

I think I got it now.

Regards,
Dan
Dhiren Joshi
Ranch Hand

Joined: Dec 09, 2003
Posts: 463
Dan,
My concern .. I had done with different visibility .. It is actaully incorrect if I give all public visibility because they r not public ... ..
Any further inputs u can give .. do u think I should revert changing all to public ... according to the guidelines ..

Thanks
Dhiren
Dan Drillich
Ranch Hand

Joined: Jul 09, 2001
Posts: 1180
Dhiren,

About your class diagrams � which type of class diagrams are they? Domain, analysis or detailed design?

Regards,
Dan
Dhiren Joshi
Ranch Hand

Joined: Dec 09, 2003
Posts: 463
Dan ,
I have identified only domain objects ..
They are implementation independent ..

Thanks
Dhiren
Dan Drillich
Ranch Hand

Joined: Jul 09, 2001
Posts: 1180
If that's the case, then Scott Ambler recommends that their visibilities will be public.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: visibility issue for class diagram