Jiazzi: New-Age Components for Old-Fashioned Java Sean McDirmid Matthew Flatt Wilson C. Hsieh School...
-
date post
19-Dec-2015 -
Category
Documents
-
view
213 -
download
0
Transcript of Jiazzi: New-Age Components for Old-Fashioned Java Sean McDirmid Matthew Flatt Wilson C. Hsieh School...
Jiazzi: New-Age Components for Old-Fashioned Java
Sean McDirmid
Matthew Flatt
Wilson C. Hsieh
School of ComputingUniversity of Utah
Java Components
Not all components are objects Components should share classes
ApplicationUser
InterfaceLibrary
External Linking
ApplicationUser
InterfaceLibrary
External Linking
ApplicationUser
InterfaceLibrary
InterposedService
Separate Compilation
Application
cl ass Wi dget {…}cl ass But t on ext ends Wi dget {…}cl ass Wi ndow {…}
cl ass Appl i cat i on { st at i c voi d mai n( ) { b = new But t on( ) ; w = new Wi ndow( ) ; w. add( b) ; w. show( ) ; }}
Separate Compilation
ApplicationUser
InterfaceLibrary
cl ass Appl i cat i on { st at i c voi d mai n( ) { b = new But t on( ) ; w = new Wi ndow( ) ; w. add( b) ; w. show( ) ; }}
Separate Compilation
ApplicationUser
InterfaceLibrary
cl ass Appl i cat i on { st at i c voi d mai n( ) { b = new But t on( ) ; w = new Wi ndow( ) ; w. add( b) ; w. show( ) ; }}
Separate Compilation
ApplicationUser
InterfaceLibrary
Separate Compilation
ApplicationUser
InterfaceLibrary
Separate Compilation
LinkedApplication
ApplicationUser
InterfaceLibrary
Jiazzi Components
cl ass AppWi ndow ext ends …{ voi d r un( ) {…} voi d i ni t ( ) {…}}
Imports
in Widget Window
cl ass AppWi ndow ext ends …{ voi d r un( ) {…} voi d i ni t ( ) {…}}
Imports
in Widget Window
cl ass AppWi ndow ext ends i n. Wi ndow{ voi d r un( ) {…} voi d i ni t ( ) {…}}
Exports
in Widget Window
ou
t
cl ass AppWi ndow ext ends i n. Wi ndow{ voi d r un( ) {…} voi d i ni t ( ) {…}}
AppWindow
Signatures
in Widget Window
ou
t
cl ass AppWi ndow ext ends i n. Wi ndow{ voi d r un( ) {…} voi d i ni t ( ) {…}}
AppWindow
Signatures
in
Widgetpaint
Windowshow
ou
t
cl ass AppWi ndow ext ends i n. Wi ndow{ voi d r un( ) {…} voi d i ni t ( ) {…}}
AppWindowrun
Linking
in
Widgetpaint
Windowshow
ou
t
ou
t
cl ass AppWi ndow ext ends i n. Wi ndow{ voi d r un( ) {…} voi d i ni t ( ) {…}}
Widgetpaint
Windowshow
AppWindowrun
Linking
in
Widgetpaint
Windowshow
ou
t
ou
t
cl ass AppWi ndow ext ends i n. Wi ndow{ voi d r un( ) {…} voi d i ni t ( ) {…}}
Widgetpaint
Windowshow
AppWindowrun
Re-exports
in
Widgetpaint
Windowshow
ou
t
ou
t
ou
t
cl ass AppWi ndow ext ends i n. Wi ndow{ voi d r un( ) {…} voi d i ni t ( ) {…}}
Widgetpaint
Windowshow
AppWindowrun
AppWindowrun
Re-exports
in
Widgetpaint
Windowshow
ou
t
ou
t
ou
t
cl ass AppWi ndow ext ends i n. Wi ndow{ voi d r un( ) {…} voi d i ni t ( ) {…}}
Widgetpaint
Windowshow
AppWindowrun
AppWindowrun
Outline
Jiazzi: components for Java Demonstration of expressiveness Key features of Jiazzi
An Extensibility Problem
Widgetpaint
ButtonsetLabel
An Extensibility Problem
Widgetpaint
ButtonsetLabel
An Extensibility Problem
Widgetpaint
ButtonsetLabel
ColorWidgetsetColor
An Extensibility Problem
Widgetpaint
ButtonsetLabel
ColorWidgetsetColor
An Extensibility Problem
Widgetpaint
ButtonsetLabel
ColorWidgetsetColor
ColorButton
An Extensibility Problem
Widgetpaint
ButtonsetLabel
ColorWidgetsetColor
ColorButton
An Extensibility Problem
Widgetpaint
ButtonsetLabel
ColorWidgetsetColor
ColorButton
An Extensibility Problem
Widgetpaint
ButtonsetLabel
ColorWidgetsetColor
ColorButton
A Solution
Widgetpaint
ButtonsetLabel
ColorWidgetsetColor
ColorButton
A Solution
Widgetpaint
ButtonsetLabel
ColorWidgetsetColor
ColorButton
FontWidgetsetFont
FontButton
A Solution
Widgetpaint
ButtonsetLabel
ColorWidgetsetColor
ColorButton
FontWidgetsetFont
FontButton
A Solution
Widgetpaint
ButtonsetLabel
ColorWidgetsetColor
ColorButton
FontWidgetsetFont
FontButton
Open Class Pattern
Widgetpaint
ButtonsetLabel
ColorWidgetsetColor
ColorButton
FontWidgetsetFont
FontButton
Open Class Pattern
Widgetpaint
ButtonsetLabel
WidgetsetColor
Button
WidgetsetFont
Button
Open Class Pattern
WidgetsetColor
Button
Widgetpaint
ButtonsetLabel
WidgetsetFont
Button
Open Class Pattern
in
Widgetpaint
ButtonsetLabel
WidgetsetColor
Button
ou
t Widgetpaint
ButtonsetLabel
WidgetsetFont
Button
WidgetsetColor
Button
WidgetsetFont
Button
Open Class Pattern
in
Widgetpaint
ButtonsetLabel
ou
t WidgetsetColor
Button
ou
t Widgetpaint
ButtonsetLabel
in
Widgetpaint
ButtonsetLabel
WidgetsetFont
Button
Open Class Pattern
in
Widgetpaint
ButtonsetLabel
ou
t WidgetsetColor
Button
ou
t Widgetpaint
ButtonsetLabel
fix
ed Widget in
Widgetpaint
ButtonsetLabel
ou
t WidgetsetFont
Button
Button
Open Class Pattern
in
Widgetpaint
ButtonsetLabel
ou
t WidgetsetColor
Button
ou
t Widgetpaint
ButtonsetLabel
fix
ed Widget in
Widgetpaint
ButtonsetLabel
ou
t WidgetsetFont
Button
Button
Open Class Pattern
in
Widgetpaint
ButtonsetLabel
ou
t WidgetsetColor
Buttonfi
xed Widget Button
ou
t Widgetpaint
ButtonsetLabel
fix
ed Widget Button in
Widgetpaint
ButtonsetLabel
ou
t WidgetsetFont
Button
fix
ed Widget Button
Open Class Pattern
in
Widgetpaint
ButtonsetLabel
ou
t WidgetsetColor
Buttonfi
xed Widget Button
ou
t Widgetpaint
ButtonsetLabel
fix
ed Widget Button
Open Class Pattern o
ut Widget
paintButton
setLabel
fix
ed Widget Button in
Widgetpaint
ButtonsetLabel
ou
t WidgetsetFont
Button
fix
ed Widget Button
Open Class Pattern o
ut Widget
paintButton
setLabel
fix
ed Widget Button
Outline
Jiazzi: components for Java Demonstration of expressiveness Key features of Jiazzi
Cyclic Component Linking
in
Widgetpaint
ButtonsetLabel
ou
t WidgetsetColor
Buttonfi
xed Widget Button
ou
t Widgetpaint
ButtonsetLabel
fix
ed Widget Button in
Widgetpaint
ButtonsetLabel
ou
t WidgetsetFont
Button
fix
ed Widget Button
Mixin Constructions
in
Widgetpaint
ButtonsetLabel
ou
t WidgetsetColor
Buttonfi
xed Widget Button
ou
t Widgetpaint
ButtonsetLabel
fix
ed Widget Button in
Widgetpaint
ButtonsetLabel
ou
t WidgetsetFont
Button
fix
ed Widget Button
Mixin Constructions
in
Widgetpaint
ButtonsetLabel
ou
t WidgetsetColor
Button
fixe
dWidget Button
ou
t Widgetpaint
ButtonsetLabel
fixe
d
Widget Button in
Widgetpaint
ButtonsetLabel
ou
t WidgetsetFont
Button
fixe
d
Widget Button
Widgetpaint
setColorsetFont
ButtonsetLabel
Mixin Constructions
in
Widgetpaint
ButtonsetLabel
ou
t WidgetsetColor
Button
fixe
dWidget Button
ou
t Widgetpaint
ButtonsetLabel
fixe
d
Widget Button in
Widgetpaint
ButtonsetLabel
ou
t WidgetsetFont
Button
fixe
d
Widget Button
Widgetpaint
setColorsetFont
ButtonsetLabel
Pragmatics
Separates core and component languages Operates on class files Executes on Java Virtual Machines
See our poster
Some Related Work
Program Units – [Flatt et al., POPL ‘98]
MultiJava – [Millstein et al., OOPSLA ‘00]
Mixin Modules – [Duggan and Techaubol OOPSLA ‘01]
Summary
Separate compilation External linking Cyclic linking Mixin constructions
http://www.cs.utah.edu/plt/jiazzi