Re: [UOPL-Architect] Maybe Helper Classes would help.
Status: Planning
Brought to you by:
bsstmiller
|
From: Thomas M. <tm...@bs...> - 2004-12-24 17:59:54
|
Let me see if Lazarus has this capability. Maybe we can ask for this feature in the compiler. At a certain point in the hierarchy I want us to go our own way. There is so much code out there that we can merge to create much better components, it isn't funny. Jedi has tried to do this, but they are hampered by only being able to inherit. We will be able to go in and fix and expand private areas. So keep coming with the ideas but I like most of them, especially in the base of the hierarchy of the object tree. The more I think about it, the more I like the idea of starting with the TNT stuff. I am hoping to start the tree by mid January, so if you are going to put your 2 cents in, please do it soon. I am still hoping for some 64bit input. I hope everyone has a safe and happy holiday. Richard B Winston wrote: >There is a new language feature in Delphi2005 for Win32 that might be >useful for some of the things we would like to do with UOPL: Helper >Classes. One thing you can do with them is replace an existing procedure >of a class with a new procedure from a different class that is not the >descendent of the first class. > >Although helper classes are only documented for Delphi for .NET, they work >in Delphi for Win32 too. > >See http://www.aspfree.com/c/a/.NET/The-Delphi-Language-Part-2/9/ for more >information. > >Here is an example. > >unit Unit5; > >interface > >uses > Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, >Forms, > Dialogs, StdCtrls; > >type > TFoo = class > strict protected > procedure AProc; virtual; > end; > > TFooDescendent = class(TFoo) > procedure AProc; override; > end; > > TFooHelper = class helper for TFoo > procedure AProc; > end; > >type > TForm5 = class(TForm) > Button1: TButton; > procedure Button1Click(Sender: TObject); > private > { Private declarations } > public > { Public declarations } > end; > >var > Form5: TForm5; > >implementation > >{$R *.dfm} > >{ TFoo } > >procedure TFoo.AProc; >begin > ShowMessage('TFoo'); >end; > >{ TFooHelper } > >procedure TFooHelper.AProc; >begin > ShowMessage('TFooHelper'); >end; > >{ TFooDescendent } > >procedure TFooDescendent.AProc; >begin > inherited; > ShowMessage('TFooDescendent'); >end; > > >procedure TForm5.Button1Click(Sender: TObject); >var > Foo: TFoo; > FooDescendent: TFooDescendent; >begin > FooDescendent := TFooDescendent.Create; > try > // TFooHelper.AProc and TFooDescendent.AProc get called here > // but not TFoo.AProc! > FooDescendent.AProc; > Foo := FooDescendent; > // Only TFooHelper.AProc gets called here. :-( > Foo.AProc; > finally > FooDescendent.Free; > end; >end; > >end. > >Richard B. Winston >rb...@us... >http://water.usgs.gov/nrp/gwsoftware/ >703-648-5988 >on Fridays: 301 474-2762 > > > >------------------------------------------------------- >SF email is sponsored by - The IT Product Guide >Read honest & candid reviews on hundreds of IT Products from real users. >Discover which products truly live up to the hype. Start reading now. >http://productguide.itmanagersjournal.com/ >_______________________________________________ >UOPL-architect mailing list >UOP...@li... >https://lists.sourceforge.net/lists/listinfo/uopl-architect > > > -- Thomas Miller Wash DC Delphi SIG Chairperson Delphi Client/Server Certified Developer BSS Accounting & Distribution Software BSS Enterprise Accounting FrameWork http://www.bss-software.com http://www.cpcug.org/user/delphi/index.html https://sourceforge.net/projects/uopl/ http://sourceforge.net/projects/dbexpressplus |