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;
Ïà¹ØÎĵµ£º
µÚÒ»Õ DELPHIµÄÔ×ÓÊÀ½ç
µÚ¶þÕ DELPHIÓëWIN32ʱ¿Õ
µÚÈýÕ ¶àÏß³Ì
µÚËÄÕÂ ½Ó¿Ú
µÚÎåÕÂ °ü
µÚÁùՠʼþÓëÏûÏ¢
µÚÆßÕ ×éÖ¯ÄãµÄÄ£¿é
µÚ°ËÕ ̽Ë÷Êý¾Ý¿â
µÚ¾ÅÕ ¶à²ãÌåϵ½á¹¹
µÚʮՠ²Ù×÷½çÃæÓë²Ù×÷Âß¼
µÚʮһÕÂ ÃæÏò¶ÔÏóÊý¾Ý¿â»ù´¡
¿Õ ......
±¾ÎĵÄÏßÐÔÁÁ¶È/¶Ô±È¶Èµ÷Õû·½·¨ÊÇÔÚ¡¶¸Ä½øµÄͼÏñÏßÐÔÁÁ¶Èµ÷Õû·½·¨¡·Ò»ÎÄÖÐÏßÐÔÁÁ¶Èµ÷Õû·½·¨Óë¡¶DelphiͼÏñ´¦Àí -- PhotoshopͼÏñÁÁ¶È/¶Ô±È¶Èµ÷Õû¡·ÖеĶԱȶȵ÷Õû·½·¨»ù´¡ÉÏÐγɵ쬯äÔÀíºÍÌØµã¿É²Î¼ûÕâ2ƪÎÄÕ£º
¹ý³Ì¶¨Ò壺
// ÏßÐÔµ÷ÕûÁÁ¶È£¬ValueÁÁ¶ÈÖµ
procedure ImageL ......
Python , Delphi , Loki Èý¸öµ¥´ÊÓÐȤµÄÀ´Ô´
Ðí¶à³ÌÐòÉè¼ÆÓïÑԺͿª·¢¹¤¾ßÒÔ¼°¿âµÄÃû×Ö¶¼À´Ô´ÓëÉñ»°£¬ÆÄÓÐÒâ˼£º
°¢²¨ÂÞÊÇͬʱ³öÏÖÔÚÏ£À°ºÍÂÞÂíÉñ»°ÖеİÂÁÖÅÁ˹ʮ¶þ´óÉñÖ®Ò»¡£Ëû³ýÁËÓµÓÐÌ«ÑôÉñµÄÉí·Ö£¬Í¬Ê±»¹ÓÐÔ¤ÑÔ¡¢ÒÕÊõ¡¢Ò½ÊõÖ®ÉñµÄ³ÆºÅ¡£°¢²¨ÂÞÊÇÖæË¹ºÍÀÖ¶äµÄ¶ù×Ó£¬ºÍ°¢µÙÃÛ˹ÊÇË ......
1. ²úÆ·Àà
{¡¶HeadFirstÉè¼ÆÄ£Ê½¡·¹¤³§Ä£Ê½Ö®¼òµ¥¹¤³§ }
{ ²úÆ·Àà }
{ ±àÒ빤¾ß £ºDelphi7.0 }
{ ÁªÏµ·½Ê½ £ºxshlife@163.com }
unit uProducts;
interface
type
TPizza = class(TObject)
public
procedure Prepare; virt ......
1.Ö÷ÌâÓë¹Û²ìÕß
{¡¶HeadFirstÉè¼ÆÄ£Ê½¡·Ö®¹Û²ìÕßģʽ }
{ Ö÷ÌâÓë¹Û²ìÕß }
{ ±àÒ빤¾ß £ºDelphi7.0 }
{ ÁªÏµ·½Ê½ £ºxshlife@163.com }
unit uWeatherReport;
interface
uses
Classes, SysUtils;
type
TObserver = class; { ForwardÉùÃ÷£¬´´½¨Á½¸öÏà ......