Presentation is loading. Please wait.

Presentation is loading. Please wait.

Brief Introduction to Object- Oriented Frameworks Kurt Stirewalt.

Similar presentations


Presentation on theme: "Brief Introduction to Object- Oriented Frameworks Kurt Stirewalt."— Presentation transcript:

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: oModern UI toolkits (e.g., Java AWT, subArctic, MFC). oDistributed computing toolkits (e.g., ACE).

4 Brief example (and notation) addActionListener(…) ButtonActionListener actionPerformed(…) MyApplicationClass actionPerformed(…)

5 Frameworks programming model Often: oUser-defined methods invoked by framework code. oFramework 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 AppletButtonTextBoxPanel … OrderEntryAppletStoreFrontDisplay

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 AWT[1.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 Observe: Can take a long time to migrate a white-box to a black-box framework White-box Black-box AWT v1.0 AWT v1.1JFC/Swing

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 Easier to build tool to specialize well-defined classes than to build a general-purpose code generator –[Johnson & Foote’88]. 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


Download ppt "Brief Introduction to Object- Oriented Frameworks Kurt Stirewalt."

Similar presentations


Ads by Google