Attributes without type in Class Diagram

  • Thread starter zak100
  • Start date
  • #1
zak100
Gold Member
435
10

Main Question or Discussion Point

Hi,
I am using a book for studying UML. It shows attributes with out 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.
 

Answers and Replies

  • #2
1,516
617
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.
 
  • #3
3
0
Hi,
I am using a book for studying UML. It shows attributes with out 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.
 
  • #4
zak100
Gold Member
435
10
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

  • #5
1,516
617
Looks like just lazy UML diagramming to save space.
 

Related Threads on Attributes without type in Class Diagram

Replies
6
Views
6K
Replies
8
Views
658
Replies
12
Views
743
Replies
2
Views
760
  • Last Post
Replies
3
Views
2K
Replies
5
Views
842
Replies
2
Views
2K
Replies
3
Views
671
Replies
1
Views
1K
  • Last Post
Replies
4
Views
3K
Top