Home » Modeling » UML2 » Semantics of Association and Aggregation/Composition(Semantics)
Semantics of Association and Aggregation/Composition [message #517759] |
Mon, 01 March 2010 23:09 |
amir Messages: 4 Registered: March 2010 |
Junior Member |
|
|
Hi All
My question is very trivial and at the same time very technical.
Suppose, we have a system, where there are 5 Universities. Each university is composed (Composition) of 10 departments. And each department has 20 faculty members (Composition) and 10 courses (Composition). Also, we have an association of "teaching" between faculty members and courses. Now the question is, 1) Considering the type of aggregation is composition and faculty members and courses strictly belong to one and only one department, Does this mean that faculties must teach courses strictly offered by the same department or they could take courses from other departments without conceptually belonging to/ working for them? Wouldn't make sense if we had shared aggregations instead of compositions in case of the relationship between department and faculty, making it possible for one faculty to work in other departments and then taking courses offered by other departments? 2) taking the original design using compositions, Is it possible to have one faculty to take courses from other universities, without conceptually working for it? Note that this hierarchical composition could be extended. 3) how is it going to be implemented code generation-wise, considering one particular department owns instances of faculty and courses, and at the same time handling the association between their instances?
This is just an example, so don't restrict yourself to this example.
With Regards
|
|
|
Re: Semantics of Association and Aggregation/Composition [message #517765 is a reply to message #517759] |
Mon, 01 March 2010 23:22 |
Ed Merks Messages: 33142 Registered: July 2009 |
Senior Member |
|
|
Amir,
Comments below.
amir wrote:
> Hi All
>
> My question is very trivial and at the same time very technical.
>
> Suppose, we have a system, where there are 5 Universities. Each
> university is composed (Composition) of 10 departments. And each
> department has 20 faculty members (Composition) and 10 courses
> (Composition). Also, we have an association of "teaching" between
> faculty members and courses. Now the question is, 1) Considering the
> type of aggregation is composition and faculty members and courses
> strictly belong to one and only one department, Does this mean that
> faculties must teach courses strictly offered by the same department
> or they could take
You mean teach?
> courses from other departments without conceptually belonging to/
> working for them?
Given you said teaching is an (arbitrary) association, any faculty
member could teach any course regardless of the department that contains
the faculty member or the course.
> Wouldn't make sense if we had shared aggregations instead of
> compositions in case of the relationship between department and
> faculty, making it possible for one faculty to work in other
> departments and then taking courses offered by other departments?
You again mention "taking courses," but you've not defined that concept.
Only the concept of teaching. The concept of "work in" has also not
been defined.
> 2) taking the original design using compositions, Is it possible to
> have one faculty to take courses from other universities, without
> conceptually working for it?
Taking and working for are not defined yet.
> Note that this hierarchical composition could be extended. 3) how is
> it going to be implemented code generation-wise, considering one
> particular department owns instances of faculty and courses, and at
> the same time handling the association between their instances?
You're question is way too vague.
>
> This is just an example, so don't restrict yourself to this example.
Where are you going with this line of reasoning and questioning?
>
> With Regards
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
| |
Re: Semantics of Association and Aggregation/Composition [message #517851 is a reply to message #517765] |
Tue, 02 March 2010 10:51 |
amir Messages: 4 Registered: March 2010 |
Junior Member |
|
|
What I'm trying to say is if we had a class structure like that, what would the multiplicity constraints be on the association defined between the classes Faculty and Course? AND the association is mandatory and it makes sense considering each faculty has to teach at least one course and each course has to be taught by at least one faculty member.
Let me rephrase my question. If we had a mandatory association defined between two classes that have a common composite class somewhere in the class structure, should the multiplicity constraints be defined with respect to the common composite class, or the maximum and minimum multiplicity number is defined based on the overall number of existing objects of the classes at that level.
As in our example, there are 5X10X20 instances of faculty members created (they could belong to different departments or universities) and 5X10X10 instances of courses created, so Now the question is should the maximum multiplicity possible defined over the association be 1000 and 500, where one faculty could teach as many as 500 courses and one course be taught by 1000 faculty members. I know this does not make sense, but the question is, is this combination possible from semantic point of view.
btw, by taking courses, I meant teaching. And working is the relationship between department and faculty and offering is the relationship between dept and courses.
And this has got nothing to my H/W, dude, I'm just trying to figure out how to go about writing a reasoner for UML class diagram.
cheers
|
|
|
Re: Semantics of Association and Aggregation/Composition [message #517867 is a reply to message #517851] |
Tue, 02 March 2010 11:43 |
Ed Merks Messages: 33142 Registered: July 2009 |
Senior Member |
|
|
Amir,
Comments below.
amir wrote:
> What I'm trying to say is if we had a class structure like that, what
> would the multiplicity constraints be on the association defined
> between the classes Faculty and Course?
Multiplicity constraints are exactly as you specify them. They don't
depend on class structure.
> AND the association is mandatory and it makes sense considering each
> faculty has to teach at least one course and each course has to be
> taught by at least one faculty member.
At my university, not all faculty members taught courses in any given
semester, but certainly every course had an instructor.
>
> Let me rephrase my question. If we had a mandatory association defined
> between two classes
You're meaning a lower bound of > 0...
> that have a common composite class somewhere in the class structure
This is way too vague.
> , should the multiplicity constraints be defined with respect to the
> common composite class, or the maximum and minimum multiplicity number
> is defined based on the overall number of existing objects of the
> classes at that level.
It should be based on the number of instances that validly can or must
appear in the property.
>
> As in our example, there are 5X10X20 instances of faculty members
> created (they could belong to different departments or universities)
> and 5X10X10 instances of courses created, so Now the question is
> should the maximum multiplicity possible defined over the association
> be 1000 and 500, where one faculty could teach as many as 500 courses
> and one course be taught by 1000 faculty members.
You don't put constraints based on the maximum number of instances that
can exist in the universe. You put constraints in place based on what
reality you're modeling. You might require all faculty members to teach
at least one course all the time. You most certainly would expect each
course to have at least one instructor. You might want to put upper
limits on the number of courses a faculty member can teach, so they
don't die from too much work. You might also limit the number of
instructors that can teach a given course, so the room doesn't overfill
with instructors leaving no space for actual students. But in both
cases, such upper limits are a bit arbitrary.
> I know this does not make sense, but the question is, is this
> combination possible from semantic point of view.
>
> btw, by taking courses, I meant teaching. And working is the
> relationship between department and faculty and offering is the
> relationship between dept and courses.
>
> And this has got nothing to my H/W, dude, I'm just trying to figure
> out how to go about writing a reasoner for UML class diagram.
>
> cheers
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
| | |
Re: Semantics of Association and Aggregation/Composition [message #628282 is a reply to message #517765] |
Tue, 02 March 2010 10:51 |
amir Messages: 4 Registered: March 2010 |
Junior Member |
|
|
What I'm trying to say is if we had a class structure like that, what would the multiplicity constraints be on the association defined between the classes Faculty and Course? AND the association is mandatory and it makes sense considering each faculty has to teach at least one course and each course has to be taught by at least one faculty member.
Let me rephrase my question. If we had a mandatory association defined between two classes that have a common composite class somewhere in the class structure, should the multiplicity constraints be defined with respect to the common composite class, or the maximum and minimum multiplicity number is defined based on the overall number of existing objects of the classes at that level.
As in our example, there are 5X10X20 instances of faculty members created (they could belong to different departments or universities) and 5X10X10 instances of courses created, so Now the question is should the maximum multiplicity possible defined over the association be 1000 and 500, where one faculty could teach as many as 500 courses and one course be taught by 1000 faculty members. I know this does not make sense, but the question is, is this combination possible from semantic point of view.
btw, by taking courses, I meant teaching. And working is the relationship between department and faculty and offering is the relationship between dept and courses.
And this has got nothing to my H/W, dude, I'm just trying to figure out how to go about writing a reasoner for UML class diagram.
cheers
|
|
|
Re: Semantics of Association and Aggregation/Composition [message #628283 is a reply to message #628282] |
Tue, 02 March 2010 11:43 |
Ed Merks Messages: 33142 Registered: July 2009 |
Senior Member |
|
|
Amir,
Comments below.
amir wrote:
> What I'm trying to say is if we had a class structure like that, what
> would the multiplicity constraints be on the association defined
> between the classes Faculty and Course?
Multiplicity constraints are exactly as you specify them. They don't
depend on class structure.
> AND the association is mandatory and it makes sense considering each
> faculty has to teach at least one course and each course has to be
> taught by at least one faculty member.
At my university, not all faculty members taught courses in any given
semester, but certainly every course had an instructor.
>
> Let me rephrase my question. If we had a mandatory association defined
> between two classes
You're meaning a lower bound of > 0...
> that have a common composite class somewhere in the class structure
This is way too vague.
> , should the multiplicity constraints be defined with respect to the
> common composite class, or the maximum and minimum multiplicity number
> is defined based on the overall number of existing objects of the
> classes at that level.
It should be based on the number of instances that validly can or must
appear in the property.
>
> As in our example, there are 5X10X20 instances of faculty members
> created (they could belong to different departments or universities)
> and 5X10X10 instances of courses created, so Now the question is
> should the maximum multiplicity possible defined over the association
> be 1000 and 500, where one faculty could teach as many as 500 courses
> and one course be taught by 1000 faculty members.
You don't put constraints based on the maximum number of instances that
can exist in the universe. You put constraints in place based on what
reality you're modeling. You might require all faculty members to teach
at least one course all the time. You most certainly would expect each
course to have at least one instructor. You might want to put upper
limits on the number of courses a faculty member can teach, so they
don't die from too much work. You might also limit the number of
instructors that can teach a given course, so the room doesn't overfill
with instructors leaving no space for actual students. But in both
cases, such upper limits are a bit arbitrary.
> I know this does not make sense, but the question is, is this
> combination possible from semantic point of view.
>
> btw, by taking courses, I meant teaching. And working is the
> relationship between department and faculty and offering is the
> relationship between dept and courses.
>
> And this has got nothing to my H/W, dude, I'm just trying to figure
> out how to go about writing a reasoner for UML class diagram.
>
> cheers
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
| |
Goto Forum:
Current Time: Fri Apr 26 19:35:12 GMT 2024
Powered by FUDForum. Page generated in 0.03603 seconds
|