Is the following format wrong if I add a pointer to an object of a class, as data attribute of class in Class diagram in UML?
相关问题
- Do the Java Integer and Double objects have unnece
- What uses more memory in c++? An 2 ints or 2 funct
- How Does WebSphere Choose the Classloading Order i
- System sequence diagram - Can system request input
- How do I create a multidimensional array of object
相关文章
- Poor Use Case of Object.assign() - Simple Example
- NameError: name 'self' is not defined, eve
- Where is the object browser in visual studio C# 20
- Implementation Strategies for Object Orientation
- An object reference is required for the non-static
- .NET - how to make a class such that only one othe
- Issue creating ImmutableMap with Class<?> as
- How to return new instance of subclass while initi
I think you may be mis-understanding classes, objects and attributes. Apologies if it's me doing the mis-understanding. So. Here's the short answer:
So, assuming that's right, what you have is correct - except for the underlining.
Underlining an attribute or operation says it sits at the class level - not the instance level. It's the equivalent of
static
in java. Think of declaring constants in class scope, or constructors.If I understand your model that's not what you want. You want each instance of Agent to hold (a pointer to) its own instances of Ability, Move and See. You don't want all the Agent objects to share the same 3 instances. Assuming so, you don't need the underline.
Hope I understood and that helps.