sweet talk (part 2) tool support for sweet

59
Sweet Talk (part 2) Tool Support for Sweet Phil Quitslund

Upload: emmet

Post on 21-Jan-2016

44 views

Category:

Documents


0 download

DESCRIPTION

Sweet Talk (part 2) Tool Support for Sweet. Phil Quitslund. Plan. Sweet Tooling issues Introduction to Eclipse Sweet Plugin at a glance Implementation notes Pitch and Caveats Where next. Plan. Sweet Tooling issues Introduction to Eclipse Sweet Plugin at a glance Implementation notes - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Sweet Talk (part 2) Tool Support for Sweet

Sweet Talk (part 2)Tool Support for Sweet

Phil Quitslund

Page 2: Sweet Talk (part 2) Tool Support for Sweet

Plan

1. Sweet Tooling issues

2. Introduction to Eclipse

3. Sweet Plugin at a glance

4. Implementation notes

5. Pitch and Caveats

6. Where next

Page 3: Sweet Talk (part 2) Tool Support for Sweet

Plan

1. Sweet Tooling issues

2. Introduction to Eclipse

3. Sweet Plugin at a glance

4. Implementation notes

5. Pitch and Caveats

6. Where next

Page 4: Sweet Talk (part 2) Tool Support for Sweet

Automating the BuildThe Problem: Manual builds considered painful

Page 5: Sweet Talk (part 2) Tool Support for Sweet

Automating the Build

• generative techniques require extra steps to stage builds

The Problem: Manual builds considered painful

Page 6: Sweet Talk (part 2) Tool Support for Sweet

Automating the Build

• generative techniques require extra steps to stage builds

The Problem: Manual builds considered painful

the rub: manual builds hurt and interrupt programmer flow

Page 7: Sweet Talk (part 2) Tool Support for Sweet

public abstract class List { public case Nil public case Cons(private int head, private List tail)}

public int length() case List abstract; case Nil { return 0; } case Cons { return 1 + tail.length(); }

Automating the Build

Page 8: Sweet Talk (part 2) Tool Support for Sweet

Automating the Build

public abstract class List { public case Nil public case Cons(private int head, private List tail)}

public int length() case List abstract; case Nil { return 0; } case Cons { return 1 + tail.length(); }

Page 9: Sweet Talk (part 2) Tool Support for Sweet

Automating the Build

3 “Introductions”

public abstract class List { public case Nil public case Cons(private int head, private List tail)}

public int length() case List abstract; case Nil { return 0; } case Cons { return 1 + tail.length(); }

Page 10: Sweet Talk (part 2) Tool Support for Sweet

Automating the Build

public abstract class List { public case Nil public case Cons(private int head, private List tail)}

public int length() case List abstract; case Nil { return 0; } case Cons { return 1 + tail.length(); }

Page 11: Sweet Talk (part 2) Tool Support for Sweet

Automating the Build

repositoryS

Page 12: Sweet Talk (part 2) Tool Support for Sweet

Automating the Build

repository

J

J

JS

Page 13: Sweet Talk (part 2) Tool Support for Sweet

Automating the Build

repository

J

J

JS

C

C

C

Page 14: Sweet Talk (part 2) Tool Support for Sweet

Managing DependenciesThe Problem: Crufty Orphans

Page 15: Sweet Talk (part 2) Tool Support for Sweet

Managing Dependencies

• generated files are "orphaned" when their introductions get removed.

The Problem: Crufty Orphans

Page 16: Sweet Talk (part 2) Tool Support for Sweet

Managing Dependencies

• generated files are "orphaned" when their introductions get removed.

The Problem: Crufty Orphans

the rub: manual maintenance is tedious and error prone

Page 17: Sweet Talk (part 2) Tool Support for Sweet

Managing Dependencies

repository

J

J

JS

C

C

C

Page 18: Sweet Talk (part 2) Tool Support for Sweet

Managing Dependencies

repository

J

J

JS

C

C

C

Page 19: Sweet Talk (part 2) Tool Support for Sweet

Managing Dependencies

repository

J

J

JS

C

C

C

Page 20: Sweet Talk (part 2) Tool Support for Sweet

Managing Dependencies

repository

J

J

JS

C

C

C

Page 21: Sweet Talk (part 2) Tool Support for Sweet

Managing Dependencies

repository

J

J

S

C

C

C

Page 22: Sweet Talk (part 2) Tool Support for Sweet

Managing Dependencies

repository

J

J

S

C

C

Page 23: Sweet Talk (part 2) Tool Support for Sweet

Managing Dependencies

repository

J

J

S

C

C

Done manually this is tedious and prone to error!

Page 24: Sweet Talk (part 2) Tool Support for Sweet

Error Handling

The Problem: Say What?

Page 25: Sweet Talk (part 2) Tool Support for Sweet

Error Handling

• Errors in generated files can be hard to trace back to their source

The Problem: Say What?

Page 26: Sweet Talk (part 2) Tool Support for Sweet

Error Handling

• Errors in generated files can be hard to trace back to their source

The Problem: Say What?

the rub: indirection decreases understandability

Page 27: Sweet Talk (part 2) Tool Support for Sweet

public abstract class List { public case Nil public case Cons(private int head, private List tail)}

public int length() case List abstract; case Nil { return 0; } case Cons { return 1 + tail.length(); }

Error Reporting

Page 28: Sweet Talk (part 2) Tool Support for Sweet

public abstract class List { public case Nil public case Cons(private int head, private List tail)}

public int length() case List abstract; case Nil { return 0; } case Cons { return 1 + tail.length(); }

Error Reporting

Legal Sweet

Page 29: Sweet Talk (part 2) Tool Support for Sweet

public abstract class List { public case Nil public case Cons(private int head, private List tail)}

public int length() case List abstract; case Nil { return 0; } case Cons { return 1 + tail.length(); } case Nil { return 1; }

Error Reporting

Legal Sweet?

Page 30: Sweet Talk (part 2) Tool Support for Sweet

Error Reporting

public abstract class List { public case Nil public case Cons(private int head, private List tail)}

public int length() case List abstract; case Nil { return 0; } case Cons { return 1 + tail.length(); } case Nil { return 1; }

Legal Sweet? Nope…

Page 31: Sweet Talk (part 2) Tool Support for Sweet

Error Reporting

Conflicting declarations

public abstract class List { public case Nil public case Cons(private int head, private List tail)}

public int length() case List abstract; case Nil { return 0; } case Cons { return 1 + tail.length(); } case Nil { return 1; }

Page 32: Sweet Talk (part 2) Tool Support for Sweet

Error Reporting (from 10,000ft)

repository

S

S

S

Page 33: Sweet Talk (part 2) Tool Support for Sweet

Error Reporting (from 10,000ft)

repository

S

S

S

Page 34: Sweet Talk (part 2) Tool Support for Sweet

Error Reporting (from 10,000ft)

repository

S

S

S

Page 35: Sweet Talk (part 2) Tool Support for Sweet

Error Reporting (from 10,000ft)

repository

S

S

S

Page 36: Sweet Talk (part 2) Tool Support for Sweet

Error Reporting (from 10,000ft)

repository

S

S

S

Page 37: Sweet Talk (part 2) Tool Support for Sweet

Plan

1. Sweet Tooling issues

2. Introduction to Eclipse

3. Sweet Plugin at a glance

4. Implementation notes

5. Pitch and Caveats

6. Where next

Page 38: Sweet Talk (part 2) Tool Support for Sweet

What is Eclipse?

• A universal platform for integrating development tools– “An IDE for everything and nothing in

particular”

• An open, extensible architecture based on plug-ins

Page 39: Sweet Talk (part 2) Tool Support for Sweet

What is Eclipse? (a picture)

Platform Runtime

Workspace

Help

Team

Workbench

JFace

SWT

Eclipse Project

JavaDevelopment

Tools(JDT)

Stellation

SweetPlugin

AnotherTool

Plug-inDevelopmen

tEnvironment

(PDE)

Eclipse Platform

Debug

Page 40: Sweet Talk (part 2) Tool Support for Sweet

What is Eclipse?

• Lot’s for free (well almost)– Tight integration of common core tools

• CVS, Ant, JUnit, diff

– Extensible/open architecture

• Third-party plugins– ruby, c#, php, etc.– AOSD (aspectJ, hyperJ, FEAT, JQuery, etc)

Page 41: Sweet Talk (part 2) Tool Support for Sweet

Plan

1. Sweet Tooling issues

2. Introduction to Eclipse

3. Sweet Plugin at a glance

4. Implementation notes

5. Pitch and Caveats

6. Where next

Page 42: Sweet Talk (part 2) Tool Support for Sweet

Plugin Features

• Keyword awareness

• Integrated SweetBuilder

• Automated House-Cleaning

• Artifact Special Treatment

• Basic Error-Reporting

• Integrated Help

Page 43: Sweet Talk (part 2) Tool Support for Sweet

DEMO!!

Cross fingers please…

Page 44: Sweet Talk (part 2) Tool Support for Sweet

Plan

1. Sweet Tooling issues

2. Introduction to Eclipse

3. Sweet Plugin at a glance

4. Implementation notes

5. Pitch and Caveats

6. Where next

Page 45: Sweet Talk (part 2) Tool Support for Sweet

Automating the Build (Impl.)

- Eclipse leverages the Observer (Listener) Design Pattern

The idea is to register listeners to monitor for changes to resources that should trigger a build.

Page 46: Sweet Talk (part 2) Tool Support for Sweet

Automating the Build (Impl.)

• Our pipeline:

Page 47: Sweet Talk (part 2) Tool Support for Sweet

Automating the Build (Impl.)

• Ordered list of builders

• Insert SweetBuilder before JavaBuilder

• Our pipeline:

SB

JB

Page 48: Sweet Talk (part 2) Tool Support for Sweet

Managing Dependencies (Impl.)

/

pkgA pkgB pkgC

ouptut/

pkgA pkgB pkgC

Possible Approach: Parallel Worlds

Page 49: Sweet Talk (part 2) Tool Support for Sweet

Managing Dependencies (Impl.)

/

pkgA pkgB pkgC

ouptut/

pkgA pkgB pkgC

Possible Approach: Parallel Worlds

Possible Solution: “make clean”

Page 50: Sweet Talk (part 2) Tool Support for Sweet

Managing Dependencies (Impl.)

- Complete rebuild

- Worst case every Java file re-compiled

- File-based

- subtler: de-values artifacts• In a multi-view setting should be first-class!

Parallel Worlds Disadvantages

Page 51: Sweet Talk (part 2) Tool Support for Sweet

Managing Dependencies (Impl.)

- Use Sweet Parser to collect Introductions

- Store in Resource object metadata

Advantages:– Persistence for free– Limited introduction/deletion ripple

Better: Mapping

Page 52: Sweet Talk (part 2) Tool Support for Sweet

Error Reporting (Impl.)

- Should be integrated into environment- Shouldn’t re-route programmer flow- Minimize dissonance

Ideal: Handle Like Errors NOT Exceptions!

Page 53: Sweet Talk (part 2) Tool Support for Sweet

Error Reporting (Impl.)

- Extended Sweet Handler to collect Problem data

- Data marshalled into a Marker object

- Attached to Eclipse Resource

Result:

- visual (localized) cues, persistence, navigability

Eclipse Resource Marker Strategy

Page 54: Sweet Talk (part 2) Tool Support for Sweet

Plan

1. Sweet Tooling issues

2. Introduction to Eclipse

3. Sweet Plugin at a glance

4. Implementation notes

5. Pitch and Caveats

6. Where next

Page 55: Sweet Talk (part 2) Tool Support for Sweet

Pitch

• Nice vision– “user as programmer”

• Nice Execution– Mature tool for Java and Plugin Development

• Growing market share– Research and Industry

• Active Developer Community• In short: a viable tool to leverage now

– http://www.eclipse.org

Page 56: Sweet Talk (part 2) Tool Support for Sweet

Caveats

• Steep Initial Learning Curve

• Lagging Documentation– but “system is the curriculum…”

• Designer Bias– “strong world view”– pervasively file-oriented

Page 57: Sweet Talk (part 2) Tool Support for Sweet

Plan

1. Sweet Tooling issues

2. Introduction to Eclipse

3. Sweet Plugin at a glance

4. Implementation notes

5. Pitch and Caveats

6. Where next

Page 58: Sweet Talk (part 2) Tool Support for Sweet

Where next

• Short Term– Plugin improvements

• Export metadata (introductions) to Ant• More sophisticated Error Reporting• Context visualization

– Sweet Programming Guide

• Long Term– Multi-view support

Page 59: Sweet Talk (part 2) Tool Support for Sweet

Programming in the 21st century

• Emphasis on“ilities”– Reusability, evolvability, etc.– What about the “archies?” (hier/heter)

• The rub: current SOC technologies (HyperJ, AspectJ, etc) depose the dominant decomposition only to replace it with their own!

• It remains to be seen if their decomposition is any better!• Polyphonic Programming!

• The time for multi-view AOSD Tool-support is now!