Nomenclature/fr: what changed
Revision 0 to 1. Removed lines have a minus sign; added lines have a plus sign.
Title: Nomenclature/fr
| Old | New | Line | |
|---|---|---|---|
| 1 | + | - les propriétés ne devraient pas commencer par un verbe, mais avec un nom | |
| 2 | + | - les méthodes devraient commencer par un verbe | |
| 3 | + | - Les noms de méthode « GetFoo » sont réservée aux accesseurs en lecture de propriété "Foo" | |
| 4 | + | - Les noms de méthode « SetFoo » sont réservée aux accesseurs en écriture de propriété "Foo" | |
| 5 | + | ||
| 6 | + | ``` pascal | |
| 7 | + | property OnFoo: TNotifyEvent read GetFoo write SetFoo; | |
| 8 | + | ``` | |
| 9 | + | ||
| 10 | + | - Les noms de méthode "DoFoo" sont réservées à l'appel des evénements "OnFoo" | |
| 11 | + | ||
| 12 | + | ``` pascal | |
| 13 | + | procedure TForm1.DoFoo; | |
| 14 | + | begin | |
| 15 | + | if Assigned(FOnFoo) then | |
| 16 | + | FOnFoo(Nil); | |
| 17 | + | end; | |
| 18 | + | ``` | |
| 19 | + | ||
| 20 | + | - Suggestion: employer "UpdateFoo" au lieu de "DoSetFoo" pour mettre à jour certains membres ou pour rendre une assertion valide | |
| 21 | + | - Les propriétés d'événement devraient être nommées On.... en commençant par un adjectif, ensuite un verbe, puis un nom (d'autres sont facultatifs): comme OnFilterRecord, OnPostError, OnDblClick (adjectif au verbe d'abord) | |
| 22 | + | - Les notifications pour les descendants de TControl devraient être nommées CNxxx | |
| 23 | + | ||
| 24 | + | --- | |
| 25 | + | *From the Free Pascal wiki, page "Nomenclature/fr", as it stood on 2020-02-21 after a change by Trev, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).* |
