Difference between revisions of "Programming with Objects and Classes/fr"

From Free Pascal wiki
Jump to navigationJump to search
Line 14: Line 14:
 
Les utilisateurs familiers avec l'ancienne implémentation de l'OOP de Turbo Pascal peuvent initialement souhaitez sauter la section sur les classes puisque l'implémentation des objets est basée sur l'ancien dialecte de Turbo Pascal.  La section sur les '''Classes''' devrait être familière pour les utilisateurs de Delphi car elle est fondée sur la syntaxe Delphi.  Soyez conscient que certaines des descriptions dans la section '''Classes''' peuvent se rapporter à des concepts de la section '''Objets'''.  Pour les développeurs Macintosh familiarisés avec les différents dialectes en pascal objet d'Apple, THINK et MPW, ni le dialecte des classes ni celui des objets de FPC ne fournissent une voie de migration directe. À partir de Mars 2009, il y a des discussions sur la Liste de diffusion du Pascal pour Mac dans le but de  potentiellement fournir quelque soutien du compilateur (nouvelle syntaxe) pour accéder au framework en langage objet C/Cocoa d'Apple.
 
Les utilisateurs familiers avec l'ancienne implémentation de l'OOP de Turbo Pascal peuvent initialement souhaitez sauter la section sur les classes puisque l'implémentation des objets est basée sur l'ancien dialecte de Turbo Pascal.  La section sur les '''Classes''' devrait être familière pour les utilisateurs de Delphi car elle est fondée sur la syntaxe Delphi.  Soyez conscient que certaines des descriptions dans la section '''Classes''' peuvent se rapporter à des concepts de la section '''Objets'''.  Pour les développeurs Macintosh familiarisés avec les différents dialectes en pascal objet d'Apple, THINK et MPW, ni le dialecte des classes ni celui des objets de FPC ne fournissent une voie de migration directe. À partir de Mars 2009, il y a des discussions sur la Liste de diffusion du Pascal pour Mac dans le but de  potentiellement fournir quelque soutien du compilateur (nouvelle syntaxe) pour accéder au framework en langage objet C/Cocoa d'Apple.
  
== General Concepts ==
+
== Notions générales ==
  
OOP provides different ways to manage and encapsulate data and to manage program flow compared with other available programming language features and constructs.  OOP often lends itself to modeling certain applications such as Graphic User Interfaces (GUI's) and physical systems in a more natural feeling manner.  However OOP is not appropriate for all applications.  Program control is not as explicit as the more basic Pascal procedural constructs.  To obtain the most benefit from OOP, understanding of large class libraries is often required which can entail a steep learning curve.  Maintaining large OOP application code has its advantages and disadvantages compared to maintaining strictly procedural code.    There are many sources for learning OO analysis, design and programming techniques which are beyond the scope of this guide.   
+
L'OOP propose différentes façons de gérer et d'encapsuler et de gérer les flux de programmes par rapport à d'autres caractéristiques et constructions de langage de programmation .  OOP often lends itself to modeling certain applications such as Graphic User Interfaces (GUI's) and physical systems in a more natural feeling manner.  However OOP is not appropriate for all applications.  Program control is not as explicit as the more basic Pascal procedural constructs.  To obtain the most benefit from OOP, understanding of large class libraries is often required which can entail a steep learning curve.  Maintaining large OOP application code has its advantages and disadvantages compared to maintaining strictly procedural code.    There are many sources for learning OO analysis, design and programming techniques which are beyond the scope of this guide.   
  
 
There are numerous programming languages which incorporate OOP features as extensions or the basis of their language.  As such, there are many different terms for describing OO concepts.  Even within FPC, some of the terminology overlaps.  In general, OOP usually consists of the concept of a programming object (or information unit) which explicitly combines and encapsulates a related set of data and procedures which act on the data.  This data is usually persistent during program execution but with mechanisms to reduce some of the problems inherent in declaring global variables.  In addition, OOP languages enable objects to be incrementally modified and/or extended based on previously defined objects.  This feature is usually referred to by the terms ''inheritance'' and ''polymorphism''.    Many OOP languages use  the terms ''method'' or ''message'' referring to procedures which belong to an object.  Much of the power of OOP is realized by late (run time) dynamic binding of methods rather than compile binding.  This dynamic binding of methods is similar to using procedural variables and procedural parameters but with greater syntactic cohesion, encapsulation with the data it is related to and also inheritance of behavior of previously defined methods.  The following wiki pages provide a starting point for discovering more about analysis, design and programming in an object orient manner.
 
There are numerous programming languages which incorporate OOP features as extensions or the basis of their language.  As such, there are many different terms for describing OO concepts.  Even within FPC, some of the terminology overlaps.  In general, OOP usually consists of the concept of a programming object (or information unit) which explicitly combines and encapsulates a related set of data and procedures which act on the data.  This data is usually persistent during program execution but with mechanisms to reduce some of the problems inherent in declaring global variables.  In addition, OOP languages enable objects to be incrementally modified and/or extended based on previously defined objects.  This feature is usually referred to by the terms ''inheritance'' and ''polymorphism''.    Many OOP languages use  the terms ''method'' or ''message'' referring to procedures which belong to an object.  Much of the power of OOP is realized by late (run time) dynamic binding of methods rather than compile binding.  This dynamic binding of methods is similar to using procedural variables and procedural parameters but with greater syntactic cohesion, encapsulation with the data it is related to and also inheritance of behavior of previously defined methods.  The following wiki pages provide a starting point for discovering more about analysis, design and programming in an object orient manner.

Revision as of 17:02, 28 June 2009

English (en) français (fr) русский (ru)

vue d'ensemble

FPC inclut plusieurs extensions de la langage à sa syntaxe Pascal "standard" pour supporter la programmation orientée objet.

Ces extensions sont décrites dans les chapitres indiqués du guide de référence du langage FPC: http://www.freepascal.org/docs.var. Des liens vers les pages de tutoriel pour chaque concept sont de même inclus ci-dessus. Le Guide de référence du langage comprend des diagrammes sur la syntaxe et d'autres détails ne figurant pas dans ce tutoriel d'introduction. Parmi les quatre caractéristiques du langage mentionnées ci-dessus, Objets et Classes forment la base de la programmation orientée objet (OOP) dans FPC et Lazarus. Pour les nouveaux avec l'OOP, le paragraphe Objets comprend plus d'introduction sur les concepts et le paragraphe Classes minimise la répétition en mettant l'accent sur les similitudes et les différences avec la syntaxe Objets. En général, l'implémentation Classes semble être plus largement utilisée, y compris par les développeurs Delphi et Lazarus. Souvent, le mot "objets" est utilisé pour se référer à ce qui est en fait une "classe" dans le dialecte Classes de l'OOP dans FPC. Ces documents seront libellés de telle manière à réduire au minimum toute confusion de terminologie, mais en dehors de ce document, souvent, le terme "objet" se réfère à des objets créés à partir d'une Classe. En fait, la bibliothèque d'exécution de FPC (RTL) comprend une bibliothèque de classes avec une classe de base appelée TObject.

Les utilisateurs familiers avec l'ancienne implémentation de l'OOP de Turbo Pascal peuvent initialement souhaitez sauter la section sur les classes puisque l'implémentation des objets est basée sur l'ancien dialecte de Turbo Pascal. La section sur les Classes devrait être familière pour les utilisateurs de Delphi car elle est fondée sur la syntaxe Delphi. Soyez conscient que certaines des descriptions dans la section Classes peuvent se rapporter à des concepts de la section Objets. Pour les développeurs Macintosh familiarisés avec les différents dialectes en pascal objet d'Apple, THINK et MPW, ni le dialecte des classes ni celui des objets de FPC ne fournissent une voie de migration directe. À partir de Mars 2009, il y a des discussions sur la Liste de diffusion du Pascal pour Mac dans le but de potentiellement fournir quelque soutien du compilateur (nouvelle syntaxe) pour accéder au framework en langage objet C/Cocoa d'Apple.

Notions générales

L'OOP propose différentes façons de gérer et d'encapsuler et de gérer les flux de programmes par rapport à d'autres caractéristiques et constructions de langage de programmation . OOP often lends itself to modeling certain applications such as Graphic User Interfaces (GUI's) and physical systems in a more natural feeling manner. However OOP is not appropriate for all applications. Program control is not as explicit as the more basic Pascal procedural constructs. To obtain the most benefit from OOP, understanding of large class libraries is often required which can entail a steep learning curve. Maintaining large OOP application code has its advantages and disadvantages compared to maintaining strictly procedural code. There are many sources for learning OO analysis, design and programming techniques which are beyond the scope of this guide.

There are numerous programming languages which incorporate OOP features as extensions or the basis of their language. As such, there are many different terms for describing OO concepts. Even within FPC, some of the terminology overlaps. In general, OOP usually consists of the concept of a programming object (or information unit) which explicitly combines and encapsulates a related set of data and procedures which act on the data. This data is usually persistent during program execution but with mechanisms to reduce some of the problems inherent in declaring global variables. In addition, OOP languages enable objects to be incrementally modified and/or extended based on previously defined objects. This feature is usually referred to by the terms inheritance and polymorphism. Many OOP languages use the terms method or message referring to procedures which belong to an object. Much of the power of OOP is realized by late (run time) dynamic binding of methods rather than compile binding. This dynamic binding of methods is similar to using procedural variables and procedural parameters but with greater syntactic cohesion, encapsulation with the data it is related to and also inheritance of behavior of previously defined methods. The following wiki pages provide a starting point for discovering more about analysis, design and programming in an object orient manner.

http://en.wikipedia.org/wiki/Object-oriented_programming

http://en.wikipedia.org/wiki/OOAD

http://en.wikipedia.org/wiki/Object_oriented_design