1 / 16

Brief Introduction to Object-Oriented Frameworks

Brief Introduction to Object-Oriented Frameworks. Kurt Stirewalt. Overview of talk. OO Frameworks: Definitions and characteristics Example: Java AWT Issues in framework design: Usability Extensibility, efficiency, and maintenance Frameworks and code generation. Object-Oriented Frameworks.

helaine
Download Presentation

Brief Introduction to Object-Oriented Frameworks

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

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: • 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 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 AWT v1.1 JFC/Swing AWT v1.0 Black-box White-box

  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 & 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

More Related