Frameworks
- Some material from Ciera Jaspan,
Bill Scherlis, Travis Breaux, and Erich Gamma
Frameworks - - PowerPoint PPT Presentation
Frameworks Some material from Ciera Jaspan, Bill
Bill Scherlis, Travis Breaux, and Erich Gamma
Input key.value pairs Intermediate key.value pairs Output key.value pairs map : (k1,v1) list (k2,v2) reduce : (k2,list(v2)) list (v2)
8 9:
Input key.value pairs Intermediate key.value pairs Output key.value pairs map : (k1,v1) list (k2,v2) reduce : (k2,list(v2)) list (v2)
)'0' ''-.
@4->
@1,:
'--0 '---0 '--3-#0
$!
'--3-#0 '--- &
'---
H<# :I->I':I6"$JI<K H< :IL-I<K H'K H# :I'---IK H :IG@1I #:I#I
$! L
0-M
#:I#I :IA-') :I'---#-N "#1I :I--G@1I :I--G@1IK HAK HA#K HA'K
AA0A0O
$!
'
" #$% #$% &
&
public class SampleTest { private List<String> emptyList; @Before public void setUp() { emptyList = new ArrayList<String>(); } @After public void tearDown() {
Here the important plugin mechanism is Java annotations
$!
public void tearDown() { emptyList = null; } @Test public void testEmptyList() { assertEquals("Empty list should have 0 elements", 0, emptyList.size()); } }
:-'57-5'Q>R7, ':-/57,
$#$%& #
Enter your userid:
'() '()*'()* ( ( *+,-" #'()*./012/34 #'()*./012/34 )5# 6 )% )7 6 )%5 8 '()*9: 15;5;)
6 , 4 , , 4< =6 *+, =< :6> +6-" ? :6> +6-" ? @)-" A A
JButton $1
MyWidget
,9)< ,9)6< '() '()*'()* B
A =66< ) A A
,9)*< ,9)6< ) A 6#=8) 6#=8) =*6')< 6 @6):8 )** )055)9 ).) A A
framework application
class library
Framework Package
→ no implementation
more con more sta
F
StandardDrawing
→ more implementation
Kit Packages
→ implementation only
re concrete re stable
(credit: Erich Gamma)
S D>>EB
(credit: Erich Gamma)
D>>EB
(credit: Erich Gamma)
E D>>EB
(credit: Erich Gamma)
L> D>>EB
%'
$( $ %(
(credit: Erich Gamma)
L D>>EB
%'
!"'
$ %(
$( $ %(
(credit: Erich Gamma)
L D>>EB
%'
!"'
$ %(
$( $ %(
(credit: Erich Gamma)
LL D>>EB
%'
!"'
$ %(
* *
$( $ %(
$%
(credit: Erich Gamma)
L D>>EB
%'
!"'
$ %(
* *
$( $ %(
$%
(credit: Erich Gamma)
L D>>EB
%'
!"'
$ %(
* * &$
$( $ %(
$%
(credit: Erich Gamma)
LF D>>EB
%'
!"'
$ %(
* * &$
$( $ %(
$%
(credit: Erich Gamma)
LS D>>EB
%'
!"'
$ %(
* * &$
+! +! "
(credit: Erich Gamma)
LJ D>>EB
).
Framework
$! LE
).
private void Page_Load(object sender, EventArgs e) { DropDownList ddl = new DropDownList(); ddl.DataSource = H; //accesses another control ddl.DataBind(); addControl(ddl); }
private void Page_Load(object sender, EventArgs e) { if (!IsPostBack()) { DropDownList ddl = new DropDownList(); ddl.DataSource = H; //accesses another control ddl.DataBind(); addControl(ddl); } }
private void Page_Load(object sender, EventArgs e) { DropDownList ddl = new DropDownList(); if (!IsPostBack()) { ddl.DataSource = H; ddl.DataBind(); } addControl(ddl); addControl(ddl); }
private void Page_PreInit(object sender, EventArgs e) { DropDownList ddl = new DropDownList(); if (!IsPostBack()) { ddl.DataSource = H; //accesses another control ddl.DataBind(); } addControl(ddl); addControl(ddl); }
DropDownList ddl; private void Page_PreInit(object sender, EventArgs e) { ddl = new DropDownList(); addControl(ddl); } private void Page_Load(object sender, EventArgs e) { private void Page_Load(object sender, EventArgs e) { if (!IsPostBack()) { ddl.DataSource = H; //accesses another control ddl.DataBind(); } }
<asp:LoginView ID=“LoginScreen” runat=“server”> <AnonymousTemplate> <AnonymousTemplate> You can only setup accounts when you are logged in. </AnonymousTemplate> <LoggedInTemplate> <h4>Location</h4> <asp:DropDownList ID=“LocationList” runat=“server”/> <asp:Button ID=“ChangeButton” runat=“server” Text=“Change”/> </LoggedInTemplate> </asp:LoginView>
LoginView LoginScreen; private void Page_Load(object sender, EventArgs e) { DropDownList list = (DropDownList) LoginScreen.FindControl(“LocationList”); list.DataSource = H; list.DataSource = H; list.DataBind(); }
LoginView LoginScreen; private void Page_Load(object sender, EventArgs e) { if (this.getRequest().IsAuthenticated()) { DropDownList list = (DropDownList) LoginScreen.FindControl(“LocationList”); list.DataSource = H; list.DataBind(); list.DataBind(); } }