• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

assoication class .....

 
Ranch Hand
Posts: 263
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
could some one throw some light on the association class .
Company -> Employee
1 1..*
employment
i could understand that when some class describes the assoication between two classes , it is called as the assoication class .

any other useful definition will be most welcome .
taking the above example , will the following true.
1) the employee class will be having some method like getEmployment()
AND
the employer will be having any method like getEmplymentDetails ( Employee employee)
i mean , will we be having two dependencies , because of the methods above
2) will it be like a mapper class , say for example map the SSN(from Employee) and the companyId (Employer)
3) who will be holding the association , if there will be no direct association between the participating classses in the association

in the above example , if say both Employee as well as Employer will not have a direct reference , then who will contain this association
warm regards,
Athi
[ May 03, 2002: Message edited by: athi agathi ]
 
Ranch Hand
Posts: 2120
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I�m just learning UML and OOA/D.
In UML Distilled by Martin Fowler it is said that "there can be only an instance of the association class for any given pair of objects" of the classes in the association.
These are two implementation approaches (IMHO) :a) Having an array such as Object[n][3]. The first column, in a given row, is an instance of Company. The second is an instance of Employee, and the last the association class object related with them.
b) Making in the Employment class attributes for the Company and Employee instances, for which the Employment instance provides information.
 
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
The Association classes can be define as
"Assocations represent structural relationsip between objects of different classes
"When classes are connected thogether conceptually, that conncetion is called an association."
You visualize association class the same way you show a regular class, and you use dotted line to connect it to the assocation line."
" An association can hae attribute and operations just like a class."

Notations
1 =has only one
1..*=has one or more
0..1 =has zero or one
* = has zero,one,or more
 
What does a metric clock look like? I bet it is nothing like this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic