Attributes without type in Class Diagram

Click For Summary

Discussion Overview

The discussion revolves around the representation of attributes in UML class diagrams, specifically addressing the absence of data types for certain attributes and their visibility (public/private). Participants explore the implications of these omissions and seek clarification on standard UML practices.

Discussion Character

  • Technical explanation
  • Conceptual clarification
  • Debate/contested

Main Points Raised

  • One participant questions the data types and visibility of attributes "dataReceived" and "isPrepaid," seeking guidance on UML conventions.
  • Another participant suggests that there may be additional symbols in the UML diagram that indicate visibility, providing examples of how visibility is represented in C++ class design.
  • A third participant reiterates the standard format for UML class diagrams, emphasizing the importance of visibility indicators and the typical structure of attributes and operations.
  • A later reply clarifies that "isPrepaid" is an attribute, not an operation, and suggests that it should have a primitive data type.
  • One participant expresses a view that the omission of data types may reflect a lack of thoroughness in UML diagramming.

Areas of Agreement / Disagreement

Participants do not reach a consensus on the specific data types for the attributes in question. There are multiple perspectives on the implications of the missing information and the standards of UML diagramming.

Contextual Notes

Participants note that visibility can vary among different coding groups and organizations, indicating that there may be no universal agreement on the representation of attributes in UML.

zak100
Messages
462
Reaction score
11
Hi,
I am using a book for studying UML. It shows attributes without any data types:
dataReceived
isPrepaid
number: String
price: Money

What is the data type associated with above two i.e dataReceived & isPrepaid & what is their visibility (i.e publc /private). Some body please guide me.

Zulfi.
 
Technology news on Phys.org
Can you provide a screenshot of what you see? My guess is that there are other symbols there that you don't realize represent something. Are there what look like bullet points?

When designing classes for C++, I use these symbols:
Code:
+ dataReceived - public
- dataReceived - private
# dataReceived - protected
/ dataReceived - derived
~ dataReceived - "C" function
+^ dataReceived - public overridden
+v dataReceived - public virtual
+s dataReceived - public static

Usually, if the return type is not shown, it returns void, but considering that your isPrepaid function probably returns a bool, my assumption is that you're missing some information.
 
  • Like
Likes   Reactions: iheadset
zak100 said:
Hi,
I am using a book for studying UML. It shows attributes without any data types:
dataReceived
isPrepaid
number: String
price: Money

What is the data type associated with above two i.e dataReceived & isPrepaid & what is their visibility (i.e publc /private). Some body please guide me.

Zulfi.
UML class diagrams usually include

Class name​
visibility attribute: type //for objects
----------------------------------------------
visibility operation(arg list types): return type // for methods​

visibility varies among groups of coders, organizations etc. But public(+) and private(-) are two most basic keys every class diagram should have.
 
Hi,
Thanks for your response.
<Usually, if the return type is not shown, it returns void, but considering that your isPrepaid function probably returns a bool, my assumption is that you're missing some information>
Its an attribute not an operation. Maybe iheadset is right:
<visibility attribute: type //for objects>
It should be a primitive data type.

Zulfi.
 

Attachments

  • class diagram attribute without type.jpg
    class diagram attribute without type.jpg
    17.6 KB · Views: 595
Looks like just lazy UML diagramming to save space.
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 48 ·
2
Replies
48
Views
11K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 6 ·
Replies
6
Views
5K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 13 ·
Replies
13
Views
4K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 4 ·
Replies
4
Views
4K
Replies
2
Views
1K