Brief Introduction to ObjectOriented Frameworks - PowerPoint PPT Presentation

1 / 16
About This Presentation
Title:

Brief Introduction to ObjectOriented Frameworks

Description:

Framework classes expect to collaborate with others ... 'The AWT[1.0] event model is the son of Satan!' -- Ian Smith, subArctic developer. White-box: ... – PowerPoint PPT presentation

Number of Views:34
Avg rating:3.0/5.0
Slides: 17
Provided by: richards54
Learn more at: https://www.cse.msu.edu
Category:

less

Transcript and Presenter's Notes

Title: Brief Introduction to ObjectOriented Frameworks


1
Brief Introduction to Object-Oriented Frameworks
  • Kurt Stirewalt

2
Overview of talk
  • OO Frameworks
  • Definitions and characteristics
  • Example Java AWT
  • Issues in framework design
  • Usability
  • Extensibility, efficiency, and maintenance
  • Frameworks and code generation

3
Object-Oriented Frameworks
  • A.k.a Object-oriented abstract design
  • Salient features
  • Corpus of (partially implemented) classes
  • Framework classes expect to collaborate with
    others
  • Instantiated by subclassing framework classes and
    providing or over-riding polymorphic operations
  • Many well-known examples
  • Modern UI toolkits (e.g., Java AWT, subArctic,
    MFC).
  • Distributed computing toolkits (e.g., ACE).

4
Brief example (and notation)
Button
ActionListener
addActionListener()
actionPerformed()
MyApplicationClass
actionPerformed()
5
Frameworks programming model
  • Often
  • User-defined methods invoked by framework code.
  • Framework plays the role of main program''.
  • This inversion of control allows frameworks to
    serve as extensible code skeletons.
  • User-supplied methods tailor generic framework
    algorithms for a specific application.

6
Example Java AWT Framework
7
Example instantiation Online orders

Applet
Button
TextBox
Panel
OrderEntryApplet
StoreFrontDisplay
8
Overview of talk
  • OO Frameworks
  • Definitions and characteristics
  • Example Java AWT
  • Issues in framework design
  • Usability
  • Extensibility, efficiency, and maintenance
  • Frameworks and code generation

9
Issues in framework design
  • Usability
  • Some frameworks require more implementation
    knowledge to use than others
  • White- vs. black-box distinction
  • Extensibility/maintenance
  • Successful frameworks get large and bulky
  • Monolithic vs. collaboration-stratified frameworks

10
Framework usability
  • The AWT1.0 event model is the son of Satan!
  • -- Ian Smith, subArctic developer
  • White-box
  • Override to customize
  • Internal structure of classes exposed
  • Black-box
  • Configure to customize
  • Only interfaces exposed

11
Example AWT event handling
  • White box (version 1.02)
  • Every UI component had handleEvent method
  • To catch events, define subclass and override
    method
  • Black box (version 1.1)
  • UI components fire events to interested
    listeners
  • Objects that implement a listener interface can
    register for event notification from a UI
    component
  • Instantiation in 1.1 uses knowledge of an
    abstract protocol, not UI-component implementation

12
Black-box evolution of AWT
AWT v1.1
JFC/Swing
AWT v1.0
Black-box
White-box
  • Observe Can take a long time to migrate a
    white-box to a black-box framework

13
Why is black-box better?
  • Possible answers
  • Maturity of product
  • Separation of concerns
  • Better conceptual abstractions
  • Better understanding of key collaborations
  • Observe All of these features are important for
    code generation

14
Maintenance Evolution
  • Problem Framework classes can get bulky
  • Function of dependencies among the classes
  • Also backward compatibilty in presence of new
    features.
  • But, not all classes communicate with all others!
  • Rather, classes involved in smaller
    collaborations.
  • Classes play roles in a collaboration
  • Role often involves only subset of class
    operations
  • Solution GenVoca style layering/composition
    useful for organizing frameworks

15
Overview of talk
  • OO Frameworks
  • Definitions and characteristics
  • Example Java AWT
  • Issues in framework design
  • Usability
  • Extensibility, efficiency, and maintenance
  • Frameworks and code generation

16
Frameworks and code generation
  • Easier to build tool to specialize well-defined
    classes than to build a general-purpose code
    generator
  • Johnson Foote88.
  • Frameworks provide
  • (partial) specification for new components and
  • template for implementing them
  • UML class/state diagrams good at representing
    framework classes and behaviors
  • Meridian Can we automatically instantiate
    framework classes from UML-model specifications
Write a Comment
User Comments (0)
About PowerShow.com