<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="https://frp.sage.fr/wiki1000/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="fr">
		<id>https://frp.sage.fr/wiki1000/index.php?action=history&amp;feed=atom&amp;title=R%C3%B4les_d%27association</id>
		<title>Rôles d'association - Historique des versions</title>
		<link rel="self" type="application/atom+xml" href="https://frp.sage.fr/wiki1000/index.php?action=history&amp;feed=atom&amp;title=R%C3%B4les_d%27association"/>
		<link rel="alternate" type="text/html" href="https://frp.sage.fr/wiki1000/index.php?title=R%C3%B4les_d%27association&amp;action=history"/>
		<updated>2026-05-02T05:32:50Z</updated>
		<subtitle>Historique pour cette page sur le wiki</subtitle>
		<generator>MediaWiki 1.18.6</generator>

	<entry>
		<id>https://frp.sage.fr/wiki1000/index.php?title=R%C3%B4les_d%27association&amp;diff=2204&amp;oldid=prev</id>
		<title>Syfre : Nouvelle page : ===Introduction=== Un rôle d'association est une association bidirectionnelle entre deux clases de multiplicité 0..* dans un sens et 0..* dans l'autre.  {{#images:role-association....</title>
		<link rel="alternate" type="text/html" href="https://frp.sage.fr/wiki1000/index.php?title=R%C3%B4les_d%27association&amp;diff=2204&amp;oldid=prev"/>
				<updated>2009-08-24T16:09:00Z</updated>
		
		<summary type="html">&lt;p&gt;Nouvelle page : ===Introduction=== Un rôle d&amp;#039;association est une association bidirectionnelle entre deux clases de multiplicité 0..* dans un sens et 0..* dans l&amp;#039;autre.  {{#images:role-association....&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Nouvelle page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;===Introduction===&lt;br /&gt;
Un rôle d'association est une association bidirectionnelle entre deux clases de multiplicité 0..* dans un sens et 0..* dans l'autre.&lt;br /&gt;
&lt;br /&gt;
{{#images:role-association.png|dsm/roles}}&lt;br /&gt;
&lt;br /&gt;
Un rôle d'association utilise une classe d'association pour maintenir les couples d'objets associés.&lt;br /&gt;
&lt;br /&gt;
===Utilisation===&lt;br /&gt;
*Accès&lt;br /&gt;
&lt;br /&gt;
Les rôles d'associations ont une propriété [[Refs (role)|Refs[index]]] permettant d'accéder aux objets associés :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang='delphi'&amp;gt;&lt;br /&gt;
var idx:Integer;&lt;br /&gt;
begin&lt;br /&gt;
  for idx:=0 to instA.ClassBList.Count-1 do&lt;br /&gt;
   begin&lt;br /&gt;
     instB := instA.ClassBList.Refs[idx];&lt;br /&gt;
     ...&lt;br /&gt;
   end;&lt;br /&gt;
end;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ils disposent aussi d'une propriété par défaut en lecture seule :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang='delphi'&amp;gt;&lt;br /&gt;
var idx:Integer;&lt;br /&gt;
begin&lt;br /&gt;
  for idx:=0 to instA.ClassBList.Count-1 do&lt;br /&gt;
   begin&lt;br /&gt;
     instB := instA.ClassBList[idx];&lt;br /&gt;
     ...&lt;br /&gt;
   end;&lt;br /&gt;
end;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
L'accès aux objets de la classe d'association se fait à travers une fonction [[AssInstance (role)|AssInstance]] dont le paramètre est '''l'identifiant de l'objet associé''' :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang='delphi'&amp;gt;&lt;br /&gt;
var idx:Integer;&lt;br /&gt;
begin&lt;br /&gt;
  for idx:=0 to instA.ClassBList.Count-1 do&lt;br /&gt;
   begin&lt;br /&gt;
     instAB := instA.ClassBList.AssInstance(instB.ClassBList[idx].InstanceOID);&lt;br /&gt;
     ...&lt;br /&gt;
   end;&lt;br /&gt;
end;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Ajout d'objets dans l'associaton&lt;br /&gt;
Différentes manièrs d'ajouter un objet à un rôle liste :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang='delphi'&amp;gt;&lt;br /&gt;
begin&lt;br /&gt;
  instA.ClassBList.AdDRef(instA);&lt;br /&gt;
  instA.ClassBList.AddOID(instA.InstanceOID);&lt;br /&gt;
  ...&lt;br /&gt;
end;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Footer|Rôles (tech)}}&lt;br /&gt;
[[category:Rôles]]&lt;/div&gt;</summary>
		<author><name>Syfre</name></author>	</entry>

	</feed>