面向过程的门面模式
{*******************************************************}
{ }
{ 业务逻辑一 }
{ }
{ 版权所有 (C) 2008 陈新光 }
{ }
{*******************************************************}
unit Hello1;
interface
uses
Dialogs;
procedure SayHello;
implementation
procedure SayHello;
begin
ShowMessage('hello one');
end;
end.
{*******************************************************}
{ }
{ 业务逻辑二 }
{ }
{ 版权所有 (C) 2008 咏南工作室 }
{ }
{*******************************************************}
unit Hello2;
interface
uses
Dialogs;
procedure SayHello2;
implementation
procedure SayHello2;
begin
ShowMessage('hello two');
end;
end.
{*******************************************************}
{ }
{ 接口 }
{ }
{ 版权所有 (C) 2008 咏南工作室 }
{ }
{*******************************************************}
unit InterFace1;
interface
uses
Hello1,Hello2;
procedure Say1;
procedure Say2;
implementation
procedure Say1;
begin
SayHello;
end;
procedure Say2;
begin
SayHello2;
end;
end.
{*******************************************************}
{ }
{ 主程序 }
{ }
{ 版权所有 (C) 2008 咏南工作室 }
{ }
{*******************************************************}
unit Main;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs,StdCtrls,
InterFace1;//接口
type
TForm1 = class(TForm)
btn1: TButton;
btn2: TButton;
procedure btn1Click(Sender: TObject);
procedure btn2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.btn1Click(Sender: TObject);
begin
Say1;
end;
procedure TForm1.btn2Click(Sender: TObject);
begin
Say2;
end;
end.
{ }
{ 业务逻辑一 }
{ }
{ 版权所有 (C) 2008 陈新光 }
{ }
{*******************************************************}
unit Hello1;
interface
uses
Dialogs;
procedure SayHello;
implementation
procedure SayHello;
begin
ShowMessage('hello one');
end;
end.
{*******************************************************}
{ }
{ 业务逻辑二 }
{ }
{ 版权所有 (C) 2008 咏南工作室 }
{ }
{*******************************************************}
unit Hello2;
interface
uses
Dialogs;
procedure SayHello2;
implementation
procedure SayHello2;
begin
ShowMessage('hello two');
end;
end.
{*******************************************************}
{ }
{ 接口 }
{ }
{ 版权所有 (C) 2008 咏南工作室 }
{ }
{*******************************************************}
unit InterFace1;
interface
uses
Hello1,Hello2;
procedure Say1;
procedure Say2;
implementation
procedure Say1;
begin
SayHello;
end;
procedure Say2;
begin
SayHello2;
end;
end.
{*******************************************************}
{ }
{ 主程序 }
{ }
{ 版权所有 (C) 2008 咏南工作室 }
{ }
{*******************************************************}
unit Main;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs,StdCtrls,
InterFace1;//接口
type
TForm1 = class(TForm)
btn1: TButton;
btn2: TButton;
procedure btn1Click(Sender: TObject);
procedure btn2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.btn1Click(Sender: TObject);
begin
Say1;
end;
procedure TForm1.btn2Click(Sender: TObject);
begin
Say2;
end;
end.
本文来自博客园,作者:{咏南中间件},转载请注明原文链接:https://www.cnblogs.com/hnxxcxg/archive/2008/03/14/2941060.html