Delphi Éè¼Æģʽ£º¡¶HeadFirstÉè¼Æģʽ¡·Delphi7´úÂë
Ä£°å·½·¨Ä£Ê½¶¨ÒåÁËÒ»¸öËã·¨¹Ç¼Ü£¬ÔÊÐí×ÓÀà¶ÔËã·¨µÄij¸ö»òijЩ²½Öè½øÐÐÖØд£¨override)¡£
1.CoffeineBeverageWithHook
{¡¶HeadFirstÉè¼Æģʽ¡·Ö®Ä£°å·½·¨Ä£Ê½ }
{ ±àÒ빤¾ß: Delphi7.0 }
{ E-Mail : xshlife@163.com }
unit uCoffeineBeverageWithHook;
interface
uses
SysUtils;
type
TCoffeineBeverageWithHook = class(TObject)
protected
procedure BoilWater;
procedure Brew; virtual; abstract;
procedure PourInCup;
procedure AddCondiments; virtual; abstract;
function CustomerWantsCondiments: Boolean; virtual; { ¹³×Ó }
public
procedure PrepareRecipe; { Ä£°å·½·¨ }
end;
TCoffeeWithHook = class(TCoffeineBeverageWithHook)
private
function GetUserInput: string;
public
procedure Brew; override;
procedure AddCondiments; override;
function CustomerWantsCondiments: Boolean; override;
end;
TTeaWithHook = class(TCoffeineBeverageWithHook)
private
function GetUserInput: string;
public
procedure Brew; override;
procedure AddCondiments; override;
function CustomerWantsCondiments: Boolean; override;
end;
implementation
{ TCoffeineBeverageWithHook }
procedure TCoffeineBeverageWithHook.BoilWater;
begin
Writeln('Boiling Water');
end;
function TCoffeineBeverageWithHook.CustomerWantsCondiments: Boolean;
begin
Result := True;
end;
procedure TCoffeineBeverageWithHook.PourInCup;
begin
Writeln('Poiling into cup');
end;
procedure TCoffeineBeverageWithHook.PrepareRecipe;
begin
BoilWater;
Brew;
PourInCup;
if CustomerWantsCondiments then
AddCondiments;
end;
{ TCoffeeWithHook }
procedure TCoffeeWithHook.AddCondiments;
begin
Writeln('Add Sugar and Milk');
end;
procedure TCoffeeWithHook.Brew;
begin
Writeln('Drip Coffee Through Filter');
end;
function TCoffeeWithHook.CustomerWantsCondiments: Boolean;
var
Answer: string;
Ïà¹ØÎĵµ£º
ͼÏñµÄÖÐÖµÂ˲¨£¬¾ÍÊÇÔÚÒÔijһÏñËØΪÖÐÐĵÄn½×ÏñËؾØÕóÖУ¬ÕÒ³öR¡¢G¡¢B¸÷·ÖÁ¿µÄÖмäÖµÀ´·Ö±ðÌæ´ú¸ÃÏñËصÄRGBÖµ£¬´Ó¶ø´ïµ½¶ÔͼÏñÔëÉùÂ˲¨µÄÄ¿µÄ¡£ÕâÀïµÄÖмäÖµ²¢·ÇÏñËؾØÕóR¡¢G¡¢B¸÷·ÖÁ¿µÄµÄËãÊõƽ¾ùÖµ£¬¶øÊÇÏñËؾØÕóR¡¢G¡¢B¸÷·ÖÁ¿ÅÅÐòºóµÄÖÐλÊýÖµ¡£
ÏÂÃæÊÇDelphiͼÏñÖÐÖµÂ˲¨µÄÊµÏ ......
Python , Delphi , Loki Èý¸öµ¥´ÊÓÐȤµÄÀ´Ô´
Ðí¶à³ÌÐòÉè¼ÆÓïÑԺͿª·¢¹¤¾ßÒÔ¼°¿âµÄÃû×Ö¶¼À´Ô´ÓëÉñ»°£¬ÆÄÓÐÒâ˼£º
°¢²¨ÂÞÊÇͬʱ³öÏÖÔÚÏ£À°ºÍÂÞÂíÉñ»°ÖеİÂÁÖÅÁ˹ʮ¶þ´óÉñÖ®Ò»¡£Ëû³ýÁËÓµÓÐÌ«ÑôÉñµÄÉí·Ö£¬Í¬Ê±»¹ÓÐÔ¤ÑÔ¡¢ÒÕÊõ¡¢Ò½ÊõÖ®ÉñµÄ³ÆºÅ¡£°¢²¨ÂÞÊÇÖæ˹ºÍÀÖ¶äµÄ¶ù×Ó£¬ºÍ°¢µÙÃÛ˹ÊÇË ......
Delphi 2010Õýʽ°æÏÂÔØ(RAD Studio 2010ÏÂÔØ)
ÔÚ8ÔÂ26ÈÕÕýʽ·¢²¼ÁËRAD Studio 2010£¬¾ÍÊÇÎÒÃÇËùνµÄDelphi 2010¡£RAD Studio 2010°üº¬Delphi¡¢C++ BuilderºÍDelphi PrismµÈ¡£ RAD Studio 2010 µÄй¦ÄÜÖ÷ÒªÔÚÓÚ£ºÔöÇ¿µÄ IDEºÍ¿ÉÊÓ»¯×é¼þ¿â (VCL) ¿ò¼ÜºÍ»ù´¡µÄ±àÒëÆ÷ÒÔ¼°ÆäËû¸÷Ï¾ß£¬ÕâʹµÃÄã¹¹½¨ÄÇЩ¿çÔ½ËùÓеÄÊý¾ÝÔ´ºÍ ......
Ò»¡¢Ò»¸ö½ÐÉù½Ó¿ÚºÍ¼¸Ö»Ñ¼×Ó
1¡¢´ÓÒ»¸ö½ÐÉù½Ó¿Ú¿ªÊ¼
{¡¶HeadFirstÉè¼Æģʽ¡·Delphi´úÂë֮ģʽС½á }
{ Ò»¸ö½ÐÉù½Ó¿Ú }
{ ±àÒ빤¾ß£ºDelphi2010 for win32 }
{ E-Mail £ºxshlife@163.com }
unit uQuackable;
interface
type
IQuackable = in ......
1.Ö÷ÌâÓë¹Û²ìÕß
{¡¶HeadFirstÉè¼Æģʽ¡·Ö®¹Û²ìÕßģʽ }
{ Ö÷ÌâÓë¹Û²ìÕß }
{ ±àÒ빤¾ß £ºDelphi7.0 }
{ ÁªÏµ·½Ê½ £ºxshlife@163.com }
unit uWeatherReport;
interface
uses
Classes, SysUtils;
type
TObserver = class; { ForwardÉùÃ÷£¬´´½¨Á½¸öÏà ......