DOC PREVIEW
MSU CSE 870 - Frameworks

This preview shows page 1-2-17-18-19-36-37 out of 37 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 37 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 37 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 37 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 37 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 37 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 37 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 37 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 37 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

More FrameworksOverviewRecap on OOPInheritance and polymorphismProtocolAbstract classesUse of Abstract Class to Represent a ProtocolAbstract Operations and Design CouplingExample Decoupling using abstract operationsExample: Use of these classesExample: continuedPlug CompatibilityIntro to OO FrameworksFrameworkFrameworksClass Libraries vs Frameworks vs PatternsCharacteristics of FrameworksObject-Oriented FrameworksExample: Java AWT Framework (abstracted)Whitebox FrameworksExample: Event handling in Java AWT 1.02 and beforeBlackbox FrameworksExample: Event handling in Java AWT 1.0 and 1.1Event handling (AWT 1.1)AWTEvent hierarchyEvent routingListenersExample: An action-event listenerExample: A mouse-event listenerDesign schema for event routingExample OO Framework:SubArctic and animationAbstract UML of the frameworkData DictionarySubArctic animationsApplication Construction Environments (Toolkits)Influence of OO FrameworksCSE870: Advanced Software Engineering (Frameworks, Part 2)RRRMore Frameworks•Acknowledgements:–K. Stirewalt–R. Johnson, B. Foote–Johnson, Fayad, SchmidtCSE870: Advanced Software Engineering (Frameworks, Part 2)RRROverview•Review of object-oriented programming (OOP) principles. •Intro to OO frameworks: oKey characteristics. oUses. oBlack-box vs. white-box frameworks. •Example study: Animations in the subArctic UI toolkit.CSE870: Advanced Software Engineering (Frameworks, Part 2)RRRRecap on OOP•Key features that differentiate OOP from traditional block-structured languages: –Polymorphism: a late-binding feature, whereby a procedure is dynamically bound to a message request. –Inheritance: allows operations to be defined in one (parent) class and then overridden in another (child) class. •Inheritance and polymorphism together are the principle tools of OO frameworks.CSE870: Advanced Software Engineering (Frameworks, Part 2)RRRInheritance and polymorphism •Subclasses provide different methods for same operation. •Benefit: Enables decoupling of cooperating classes. –Clients need not know how an operation is implemented. –Thus, designs are portable and extensible. –Code can be reused. •Two cases: 1. Superclass provides a method for the operation. •we say the subclass overrides this method. •subclass method may explicitly invoke superclass method. 2. Superclass provides no method for the operation. •we say the operation is abstract in the superclass.CSE870: Advanced Software Engineering (Frameworks, Part 2)RRRProtocol •Operations performed on objects by ``sending them messages''. •Specification of an object given by its message protocol: –Set of messages that can be sent to it; –Includes type of arguments of each message. •Objects with identical protocols are interchangeable. •Interface between objects defined by protocols they expect each other to understand. •In most languages, protocol is bound to an object's class1.CSE870: Advanced Software Engineering (Frameworks, Part 2)RRRAbstract classes •Defn: class that cannot have any instances. •Only subclasses can have instances. •How to specify that a class is abstract: –C++: Implicit; abstract class has pure virtual functions. –Java: •Class can be explicitly declared abstract, or •Abstract operations can be grouped into an interface. •Used to define standard protocols.CSE870: Advanced Software Engineering (Frameworks, Part 2)RRRUse of Abstract Class to Represent a ProtocolCSE870: Advanced Software Engineering (Frameworks, Part 2)RRRAbstract Operations and Design Coupling•Imagine: a tool that places figures on a grid. –Example: gridding of program icons in a window manager. –Example: placement of button figures in a panel. •Grid-management code allocates figures to grid positions, avoiding collisions and possibly implementing a fill policy. •Code should not be concerned with how to draw a figure. •Question: How do you separate grid management from the drawing of figures?CSE870: Advanced Software Engineering (Frameworks, Part 2)RRRExample Decoupling using abstract operationsCSE870: Advanced Software Engineering (Frameworks, Part 2)RRRExample: Use of these classes#include "Square.h" #include "Triangle.h" #include "Circle.h" #include "Grid.h" ... Grid myGrid; ... myGrid.AddFigure( new Square );myGrid.AddFigure( new Triangle );myGrid.AddFigure( new Circle ); myGrid.Draw();CSE870: Advanced Software Engineering (Frameworks, Part 2)RRRExample: continued class Figure : public WindowComponent { public: virtual void Draw() = 0; // pure virtual function!}; class Grid : public WindowComponent { public: void AddFigure( Figure* ); void Draw() { for( int i=0; i < 3; ++i ) { figures[i].Draw(); } private: Figure* figures[3]; };CSE870: Advanced Software Engineering (Frameworks, Part 2)RRRPlug Compatibility•If several classes define same protocol, then objects in those classes are plug compatible. •Thus complex objects can be created by plugging together a set of compatible components. •Style of programming called building tool kits.CSE870: Advanced Software Engineering (Frameworks, Part 2)RRRIntro to OO FrameworksCSE870: Advanced Software Engineering (Frameworks, Part 2)RRRFramework•Support reuse of detailed designs•An integrated set of components:–Collaborate to provide reusable architecture for–Family of related applicationsCSE870: Advanced Software Engineering (Frameworks, Part 2)RRRFrameworks1. Frameworks are semi-complete applications•Complete applications are developed by inheriting from, and•Instantiating parameterized framework components2. Frameworks provide domain-specific functionality•Ex.: business, telecommunication, dbases, distributed, OS kernels3. Frameworks exhibit inversion of control at run-time•Framework determines which objects and methods to invoke in response to eventsCSE870: Advanced Software Engineering (Frameworks, Part 2)RRRClass Libraries vs Frameworks vs Patterns•Definition: –Class Libraries:•Self-contained,•Pluggable ADTs–Frameworks:•Reusable, semi-complete applications–Patterns:•Problem, solution, contextApplicationSpecificLogicNetworkingMathDbaseADTsUIEventLoopApplicationSpecific LogicMathADTsEventLoopUINetworkingDbaseInvokesInvokesCall BacksClass Library ArchitectureFramework ArchitectureCSE870: Advanced Software Engineering (Frameworks, Part 2)RRRCharacteristics of Frameworks•Often: oUser-defined methods invoked by the


View Full Document

MSU CSE 870 - Frameworks

Documents in this Course
HW2

HW2

3 pages

splc1

splc1

21 pages

Lessons

Lessons

3 pages

revision

revision

13 pages

ft1

ft1

12 pages

john.dsn

john.dsn

21 pages

Survey

Survey

2 pages

revision

revision

38 pages

Load more
Download Frameworks
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Frameworks and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Frameworks 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?