Johan Larsson wrote:
I am the author of EFLIB, a free object-oriented extension for Object-Pascal which currently is evolving but will be released in a brand new version soon. Our software gets more and more mature for every day. We now want to make EFLIB a standard template library for both of your languages: GNU Pascal and FPK Pascal, and we want to support CORBA, X11, Windows NT and even Motif. Also, we want to keep the project close to the state of art in computer science. We want to incorporate only modern algorithms, modern solutions and - most importantly - only modern approaches to software reuse: the design patterns.
EFLIB is free software (http://www.csd.uu.se/projects/EFLIB/Support/FAQ/). We believe that a free mind "is-a" creative mind. However, EFLIB will also be wrapped and sold in a commercial CDROM kit. We believe that free software can indeed be commercial software as well (as do Richard Stallman for that matter). To warrant the freedom of distribution and use, we use a GNU LGPL-compatible license agreement (currently being completed by a Swedish lawyer).
I appreciate that it will be free software. However, due to the recent creation of the NPL, MPL and other more or less compatible free licenses, I'm a bit wary that it will really be a GPC compatible license. I looked at the license mentioned above, but I'm not a lawyer :-), therefore I'd like to see an official statement confirming the possibility to combine it with GPL/LGPL licensed software (i.e. to use and distribute without conflicting with either of the licenses). I hope this will be possible.
We think EFLIB will prove to be a great value for the future of Object-Pascal. We believe that the next step of programming will be an increased level of abstraction due to the introduction of design patterns and other higher-level entities of software design. We also believe in modelling and tool support for software design. We want to combine all of these things in EFLIB. We are also considering integrating modern technologies such as CORBA and Motif support. The trend goes to language and platform independence and universal modelling and reuse, and that's exactly what EFLIB is all about.
GPC is also about platform idependence and easy to integrate with other languages, so this could be a good combination. :-)
I am, as the project leader of EFLIB, confident that EFLIB will fit actual needs as an official standardized class library for FPK Pascal and GNU Pascal, and partially for Borland Delphi 3. However, to reach this goal I will need collaboration from all of you. Many people have already reacted positively to EFLIB in the FPK and GNU domain. First of all, we need developers who can help us with the actual coding and testing, and give us response to the specifications. We need experienced CORBA / ORB / DCOM developers. We need experts on design patterns and reuse, and experienced developers in X11, Motif and Windows NT. We also need some changes in the GNU and FPK Pascal standards: full support for properties, class model and exception handling. It could well be time for a precise standard to settle between GNU and FPK.
These things are actually planned for GPC:
- Properties: I have them listed in my To-Do-list (http://fjf.gnu.de/gpc-todo_toc.html), but I personally don't know too much about them. Are they a Delphi extension? If so, are there any documents available to describe them, or otherwise, could some Delphi user put together a list of features required that could be used as a "standard" that GPC, and perhaps FPK, can implement?
- Classes: At http://pascal-central.com/OOE-stds.html, there is a draft for an ANSI Object Pascal standard. AFAIH, Delphi's implementation is quite close to this standard. One of the plans for GPC is to implement this standard draft without dropping the BP object model that is already implemented, in the hope that there won't be great conflicts between the two.
- Exception handling: I myself would like to use it (for OOP as well as non-OOP programs), so I'd be willing to put some effort into implementing it when I have the time (later this year, hopefully). However, as with properties, I'm lacking a (pseudo-)standard. I do know the Java exception handling, and I think it's not too bad and could be implemented similarly in Pascal. OTOH, I read that the latest GCC version (on which GPC is based) has introduced exception handling, so it might be easier to implement this if we can reuse that code. OTTH, if there already is an implementation in a Pascal dialect (Delphi?), and it's suitable, it would be a good idea to be compatible to this. So again, could someone make a list of required features (perhaps with some sample code)?
From: Frank Heckenbach heckenb@mi.uni-erlangen.de Date: Thu, 7 May 1998 13:23:02 +0200 To: gpc@hut.fi, jola@csd.uu.se Subject: Re: Reformatted: EFLIB as class library for Object-Pascal (fwd)
[...]
- Properties: I have them listed in my To-Do-list (http://fjf.gnu.de/gpc-todo_toc.html), but I personally don't know too much about them.
I know a bit about them ;)
Are they a Delphi extension?
Yes.
If so, are there any documents available to describe them,
I suppose the Delphi help files would document them - but I don't know of any other documentation. I believe that there are copies of the Delphi VCL help file on Borland's homepage (ps: Borland is now called "Inprise").
or otherwise, could some Delphi user put together a list of features required that could be used as a "standard" that GPC, and perhaps FPK, can implement?
AFAICS, properties are special things which pretend to be fields, but which are actually methods. You can make them read/write or readonly, etc. It is best explained by example, because I am not sure that I am very good at explaining the concept. This is an example;
Type foo = Class(TClass)
private {by Delphi convention, fields to be used in properties are private and should not be accessed directly, but this is not necessary} fName:string; fNum:integer;
Public Constructor Create;override; Destructor Destroy;override;
{the next 4 methods service the properties and are not normally called directly - the compiler handles calls to them when properties are accessed} Procedure SetName(aName:string); Function Getname:string; Procedure SetNum(Num:integer); Function GetNum:integer;
Published {can be published or public; if published it will show in the GUI designer} Property FileName: string read Getname write SetName; Property FileNumber:integer read GetNum write SetNum; end;
Constructor foo.Create; begin Inherited Create; fName:=''; fNum := 0; end;
Destructor foo.Destroy; begin Inherited Destroy; end;
Procedure foo.SetName(aName:string); begin fName:=aName; end;
Function foo.Getname:string; begin Result := fName; end;
Procedure foo.SetNum(Num:integer); begin fNum := Num; end;
Function foo.GetNum:integer; begin Result := fNum; end;
Var bar:foo; x:integer; Begin bar := foo.Create; With bar do begin FileName := 'Chief'; {write access - compiler calls SetName} FileNum := 200; end; {write access - compiler calls SetNum} {blah ...; blah ....;} Writeln(FileName); {read access - compiler calls GetName} x := FileNum; {read access - compiler calls GetNum} Free; {inherited method - calls destructor Destroy} End.
I hope this simple (and untested) example gives you the idea of hat you need to implement.
- Classes: At http://pascal-central.com/OOE-stds.html, there is a draft for an ANSI Object Pascal standard. AFAIH, Delphi's implementation is quite close to this standard. One of the plans for GPC is to implement this standard draft without dropping the BP object model that is already implemented, in the hope that there won't be great conflicts between the two.
That would be the best approach. It is the approach that Delphi takes.
- Exception handling: I myself would like to use it (for OOP as well as non-OOP programs), so I'd be willing to put some effort into implementing it when I have the time (later this year, hopefully). However, as with properties, I'm lacking a (pseudo-)standard. I do know the Java exception handling, and I think it's not too bad and could be implemented similarly in Pascal. OTOH, I read that the latest GCC version (on which GPC is based) has introduced exception handling, so it might be easier to implement this if we can reuse that code. OTTH, if there already is an implementation in a Pascal dialect (Delphi?), and it's suitable, it would be a good idea to be compatible to this. So again, could someone make a list of required features (perhaps with some sample code)?
Delphi has exceptions (implemented in exception Classes). However, I do not use them. I prefer to use the good old "Ioresult"
Best regards, The Chief -------- Dr. Abimbola A. Olowofoyeku (The African Chief) Email: laa12@keele.ac.uk Homepage: http://ourworld.compuserve.com/homepages/African_Chief/ Author of: Chief's Installer Pro 4.25 for Win16 and Win32: ftp://ftp.simtel.net/pub/simtelnet/win3/install/chief425.zip
Not exactly.....
Properties ARE variables but when included within an object they are called properties.
The keyword private is used to support the concept of encapsulation.
The methods (procedures/functions) are also part of the object. They are used to access properties because of encapsulation as mentioned earlier.
Cheers!
Antoine ----------------------------------- "Beware Mortals! For the Shadow of God is nigh..."
Dr A Olowofoyeku (The African Chief) wrote:
From: Frank Heckenbach heckenb@mi.uni-erlangen.de Date: Thu, 7 May 1998 13:23:02 +0200 To: gpc@hut.fi, jola@csd.uu.se Subject: Re: Reformatted: EFLIB as class library for Object-Pascal (fwd)
[...]
- Properties: I have them listed in my To-Do-list (http://fjf.gnu.de/gpc-todo_toc.html), but I personally don't know too much about them.
I know a bit about them ;)
Are they a Delphi extension?
Yes.
If so, are there any documents available to describe them,
I suppose the Delphi help files would document them - but I don't know of any other documentation. I believe that there are copies of the Delphi VCL help file on Borland's homepage (ps: Borland is now called "Inprise").
or otherwise, could some Delphi user put together a list of features required that could be used as a "standard" that GPC, and perhaps FPK, can implement?
AFAICS, properties are special things which pretend to be fields, but which are actually methods. You can make them read/write or readonly, etc. It is best explained by example, because I am not sure that I am very good at explaining the concept. This is an example;
Type foo = Class(TClass)
private {by Delphi convention, fields to be used in properties are private and should not be accessed directly, but this is not necessary} fName:string; fNum:integer;
Public Constructor Create;override; Destructor Destroy;override;
{the next 4 methods service the properties and are not normally called directly - the compiler handles calls to them when properties are accessed} Procedure SetName(aName:string); Function Getname:string; Procedure SetNum(Num:integer); Function GetNum:integer;
Published {can be published or public; if published it will show in the GUI designer} Property FileName: string read Getname write SetName; Property FileNumber:integer read GetNum write SetNum; end;
Constructor foo.Create; begin Inherited Create; fName:=''; fNum := 0; end;
Destructor foo.Destroy; begin Inherited Destroy; end;
Procedure foo.SetName(aName:string); begin fName:=aName; end;
Function foo.Getname:string; begin Result := fName; end;
Procedure foo.SetNum(Num:integer); begin fNum := Num; end;
Function foo.GetNum:integer; begin Result := fNum; end;
Var bar:foo; x:integer; Begin bar := foo.Create; With bar do begin FileName := 'Chief'; {write access - compiler calls SetName} FileNum := 200; end; {write access - compiler calls SetNum} {blah ...; blah ....;} Writeln(FileName); {read access - compiler calls GetName} x := FileNum; {read access - compiler calls GetNum} Free; {inherited method - calls destructor Destroy} End.
I hope this simple (and untested) example gives you the idea of hat you need to implement.
- Classes: At http://pascal-central.com/OOE-stds.html, there is a draft for an ANSI Object Pascal standard. AFAIH, Delphi's implementation is quite close to this standard. One of the plans for GPC is to implement this standard draft without dropping the BP object model that is already implemented, in the hope that there won't be great conflicts between the two.
That would be the best approach. It is the approach that Delphi takes.
- Exception handling: I myself would like to use it (for OOP as well as non-OOP programs), so I'd be willing to put some effort into implementing it when I have the time (later this year, hopefully). However, as with properties, I'm lacking a (pseudo-)standard. I do know the Java exception handling, and I think it's not too bad and could be implemented similarly in Pascal. OTOH, I read that the latest GCC version (on which GPC is based) has introduced exception handling, so it might be easier to implement this if we can reuse that code. OTTH, if there already is an implementation in a Pascal dialect (Delphi?), and it's suitable, it would be a good idea to be compatible to this. So again, could someone make a list of required features (perhaps with some sample code)?
Delphi has exceptions (implemented in exception Classes). However, I do not use them. I prefer to use the good old "Ioresult"
Best regards, The Chief
Dr. Abimbola A. Olowofoyeku (The African Chief) Email: laa12@keele.ac.uk Homepage: http://ourworld.compuserve.com/homepages/African_Chief/ Author of: Chief's Installer Pro 4.25 for Win16 and Win32: ftp://ftp.simtel.net/pub/simtelnet/win3/install/chief425.zip
According to Antoine Borg:
Not exactly.....
Properties ARE variables but when included within an object they are called properties.
The keyword private is used to support the concept of encapsulation.
The methods (procedures/functions) are also part of the object. They are used to access properties because of encapsulation as mentioned earlier.
I think here is some misunderstanding:
* In OOP terminology, data fields of objects are often called "properties", and procedures/functions of the object are called "methods", as Antoine pointed out.
* Delphi provides something more specific which they call "properties": something which pretends to be a data field but is in fact a pair of methods. This is what The Chief described.
Hope this clears things up,
Peter