views:

637

answers:

2

Just I am going through class diagram. some attributes inside the class is marked with slash "/" ex ( / -accountBalance:Dollar = 0 ).

Just i wish to clarify ,when we say derived attribute, can we mean it Enumeration or other class instance (generally a custom data type ?).

Thanks in advance.

+1  A: 

(I'm a bit unsure of your question, but here's a start...)

The slash is indicating that the attribute is not specified in this class, but came from the parent class.

That attribute might be intended to be a reference to a class instance (such as an enumeration or custom data type), but nothing about the slash or the term "derived attribute" implies that... The diagram just says it's an attribute that came from the superclass spec.

ewall
you mean inheritance here?
Yeah, that's where I was going. But Jordi Cabot is totally right on this one--I was thinking more of derived classes or types, not attributes.
ewall
+2  A: 

A slash in front of an attribute means that the attribute is derived. The value of a derived attribute is calculated from the value of other model elemetns in the diagram. For instance, the accountBalance value can be derived from the list of payments and deposits made for that account (assuming that information about payments and deposits is stored in other classes in the diagram).

The derivation rule for a derived attribute (i.e. how to compute its value) can be specified in natural language or more formally in OCL

Jordi Cabot

related questions