Skip to main content
edited tags
Link
Christophe
  • 82.2k
  • 11
  • 136
  • 202
re-word into more native English
Source Link
lennon310
  • 3.2k
  • 7
  • 18
  • 35

I was creating a class model using inheritance, and have a situation I don't know how to represent.

For this question I built an example diagram in which I have a class Person with some attributes.

I also have a class Class1 that needs to use objects of a new class with Person's attributes plus "sex"sex and "birthDate"birthDate attributes, so I create a Person2 class which inherits from Person.

But I also have another class Class2 which needs to use objects with only the Person attributes, not Person2. I can't use an association relationship because Person is an abstract class.

How should I handle this situation?

Example UML diagram labelling the relationship in question

I was creating a class model using inheritance, and have a situation I don't know how to represent.

For this question I built an example diagram in which I have a class Person with some attributes.

I also have a class Class1 that needs to use objects of a new class with Person's attributes plus "sex" and "birthDate" attributes, so I create a Person2 class which inherits from Person.

But I also have another class Class2 which needs to use objects with only the Person attributes, not Person2. I can't use an association relationship because Person is an abstract class.

How should I handle this situation?

Example UML diagram labelling the relationship in question

I was creating a class model using inheritance, and have a situation I don't know how to represent.

For this question I built an example diagram in which I have a class Person with some attributes.

I also have a class Class1 that needs to use objects of a new class with Person's attributes plus sex and birthDate attributes, so I create a Person2 class which inherits from Person.

But I also have another class Class2 which needs to use objects with only the Person attributes, not Person2. I can't use an association relationship because Person is an abstract class.

How should I handle this situation?

Example UML diagram labelling the relationship in question

Doubt with inherint Inheritance and association relationships in UML

I was doingcreating a class model using inheritance, and I find that whathave a situation I need make an inheritancedon't know how to represent. 

For this question I build abuilt an example diagram in which I'veI have a Person class Person with some attributes and I've other.

I also have a class Class1Class1 that needs to use objects fromof a new class with same Person'sPerson's attributes plus the "sex" and "brithDate""birthDate" attributes, so I create a Person2Person2 class which inherits from PersonPerson. 

But for otherI also have another class Class2 I needClass2 which needs to use objects with only the same Person'sPerson attributes but, not Person2. I can't douse an association relationship because Person it's aPerson is an abstract class. 

How should I handle this situation is managed?

Diagram enter image description hereExample UML diagram labelling the relationship in question

Doubt with inherint in UML

I was doing a class model and I find that what I need make an inheritance. For this question I build a example diagram in which I've a Person class with some attributes and I've other class Class1 that needs to use objects from a class with same Person's attributes plus the "sex" and "brithDate" attributes, so I create a Person2 class which inherits from Person. But for other class Class2 I need to use objects with only the same Person's attributes but I can't do an association relationship because Person it's a abstract class. How this situation is managed?

Diagram enter image description here

Inheritance and association relationships in UML

I was creating a class model using inheritance, and have a situation I don't know how to represent. 

For this question I built an example diagram in which I have a class Person with some attributes.

I also have a class Class1 that needs to use objects of a new class with Person's attributes plus "sex" and "birthDate" attributes, so I create a Person2 class which inherits from Person. 

But I also have another class Class2 which needs to use objects with only the Person attributes, not Person2. I can't use an association relationship because Person is an abstract class. 

How should I handle this situation?

Example UML diagram labelling the relationship in question

Source Link
Caeta
  • 177
  • 8
Loading