Attributes without type in Class Diagram

  • Thread starter zak100
  • Start date
  • #1
462
11
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,524
625
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
462
11
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
    21.3 KB · Views: 398
  • #5
1,524
625
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
894
Replies
12
Views
871
  • Last Post
Replies
3
Views
3K
Replies
5
Views
982
Replies
2
Views
2K
Replies
1
Views
1K
Top