티스토리 뷰
type
IDatabase = interface
function GetDatabaseName() : String;
end;
TDatabase = class(TInterfacedObject, IDatabase)
private
FDtabaseName : String;
public
procedure SetDatabaseName(ADatabaseName : String);
function GetDatabaseName() : String;
end;
{ TDatabase }
procedure TDatabase.SetDatabaseName(ADatabaseName : String);
begin
Self.FDtabaseName := ADatabaseName;
end;
function TDatabase.GetDatabaseName() : String;
begin
Result := Self.FDtabaseName;
end;
{ TForm1 }
procedure TForm1.Button1Click(Sender: TObject);
var
DatabaseList : TInterfaceList;
ADatabase : TDatabase;
InterfaceDatabase : IDatabase;
i : integer;
begin
DatabaseList := TInterfaceList.Create;
ADatabase := TDatabase.Create;
ADatabase.SetDatabaseName('Oracle');
InterfaceDatabase := ADatabase;
DatabaseList.Add(InterfaceDatabase);
ADatabase := TDatabase.Create;
ADatabase.SetDatabaseName('MsSQL');
InterfaceDatabase := ADatabase;
DatabaseList.Add(InterfaceDatabase);
for i :=0 to DatabaseList.Count-1 do begin
Memo1.Lines.Add(IDatabase(DatabaseList[i]).GetDatabaseName());
end;
end;
- Total
- Today
- Yesterday
- ubuntu
- Linux
- Delphi Tip
- SAS
- 송주경
- Xcode
- NDK
- 전예희
- ble
- 튜닝쇼 2008
- MySQL
- oracle
- android
- Mac
- Java
- Spring MVC
- koba2010
- 동경
- KOBA
- sas2009
- JavaScript
- 서울오토살롱
- ffmpeg
- 레이싱모델 익스트림 포토 페스티벌
- Spring
- flex
- BPI-M4
- 지스타2007
- Delphi
- 일본여행
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |