I remember that RiaCn has some time to post 23 GOF design patterns. In fact, I have already put these 23 basic modes, such as MVC, etc., I have written it once with ActionScript, 嘿嘿. There are also some of the Thor of the extension array class with the data structure related to the data structure. Some slowly slowly.
Pre {Font-Family: "Courier New", Courier, Arial; font-size: 12px;}
. galan {color: # 000000;
. readyword {color: # 993300;
.IDENTIFIER {color: # 000087;
.properties {color: # 000087;
{Color: # 000087;
.linecomment, .bockcomment {color: # 808080;
. String {color: # 0000ff;}
// "Adaptee"
Class Adaptee
{
//Methods
Public Function SpecificRequest (): Void
{
"" Called SpecificRequest () ");
}
}
// "adapter"
Class Adapter Extends Target
{
// fields
Private var adaptee: adaptee;
Public function adapter ()
{
Adaptee = new adaptee ();
}
//Methods
Public function request (): void
{
// Possibly Do some data manipulation
// and then Call SpecificRequest
Adaptee.specificRequest ();
}
}
Class Target
{
//Methods
Public function request (): void
{
// Normal Implementation Goes Here
}
}
//client.fla
Var T: target = new adapter ();
T.REQUEST ();
// Output:
// Called SpecificRequest ()