OO Frameworks Department of Computer Science Kent State University.

Slides:



Advertisements
Similar presentations
Object-Oriented Application Frameworks Much of the cost and effort stems from the continuous re- discovery and re-invention of core concepts and components.
Advertisements

Ch:8 Design Concepts S.W Design should have following quality attribute: Functionality Usability Reliability Performance Supportability (extensibility,
Framework is l Reusable Code, often domain specific (GUI, Net, Web, etc) l expressed as l a set of classes and l the way objects in those classes collaborate.
Solutions to Review Questions. 4.1 Define object, class and instance. The UML Glossary gives these definitions: Object: an instance of a class. Class:
Classes & Objects Computer Science I Last updated 9/30/10.
Object-Oriented Analysis and Design
Introduction To System Analysis and Design
The Architecture Design Process
R R R CSE870: Advanced Software Engineering: Frameworks (Cheng, Sp2003)1 Frameworks A Brief Introduction.
Design Patterns CS is not simply about programming
Object-Oriented Databases
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Design Patterns.
Developed by Reneta Barneva, SUNY Fredonia Component Level Design.
Reuse Activities Selecting Design Patterns and Components
Brief Introduction to Object- Oriented Frameworks Kurt Stirewalt.
Chapter 22 Object-Oriented Design
Object-oriented design CS 345 September 20,2002. Unavoidable Complexity Many software systems are very complex: –Many developers –Ongoing lifespan –Large.
1 An introduction to design patterns Based on material produced by John Vlissides and Douglas C. Schmidt.
The chapter will address the following questions:
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 18 Slide 1 Software Reuse 2.
Introduction To System Analysis and design
©Ian Sommerville 2006Software Engineering, 8th edition. Chapter 18 Slide 1 Software Reuse.
Software Engineering Muhammad Fahad Khan
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 18 Slide 1 Software Reuse.
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14Slide 1 Design with Reuse l Building software from reusable components.
Design Patterns.
Introduction to Object-oriented programming and software development Lecture 1.
Design Patterns OOD. Course topics Design Principles UML –Class Diagrams –Sequence Diagrams Design Patterns C#,.NET (all the course examples) Design Principles.
1 CS 456 Software Engineering. 2 Contents 3 Chapter 1: Introduction.
SWE 316: Software Design and Architecture – Dr. Khalid Aljasser Objectives Lecture 11 : Frameworks SWE 316: Software Design and Architecture  To understand.
©Ian Sommerville 2000 Software Engineering, 6th edition. Slide 1 Component-based development l Building software from reusable components l Objectives.
An Introduction to Design Patterns. Introduction Promote reuse. Use the experiences of software developers. A shared library/lingo used by developers.
Copyright 2002 Prentice-Hall, Inc. Modern Systems Analysis and Design Third Edition Jeffrey A. Hoffer Joey F. George Joseph S. Valacich Chapter 20 Object-Oriented.
Introduction To System Analysis and Design
11 Chapter 11 Object-Oriented Databases Database Systems: Design, Implementation, and Management 4th Edition Peter Rob & Carlos Coronel.
COMP 6471 Software Design Methodologies Winter 2006 Dr Greg Butler
R R R 1 Frameworks III Practical Issues. R R R 2 How to use Application Frameworks Application developed with Framework has 3 parts: –framework –concrete.
Design engineering Vilnius The goal of design engineering is to produce a model that exhibits: firmness – a program should not have bugs that inhibit.
Patterns and Reuse. Patterns Reuse of Analysis and Design.
ECE450 - Software Engineering II1 ECE450 – Software Engineering II Today: Design Patterns IX Interpreter, Mediator, Template Method recap.
SOFTWARE DESIGN AND ARCHITECTURE LECTURE 05. Review Software design methods Design Paradigms Typical Design Trade-offs.
Modeling Component-based Software Systems with UML 2.0 George T. Edwards Jaiganesh Balasubramanian Arvind S. Krishna Vanderbilt University Nashville, TN.
Chapter 8 Object Design Reuse and Patterns. Object Design Object design is the process of adding details to the requirements analysis and making implementation.
Distribution and components. 2 What is the problem? Enterprise computing is Large scale & complex: It supports large scale and complex organisations Spanning.
Part VII: Design Continuous
Frameworks CompSci 230 S Software Construction.
Dale Roberts Object Oriented Programming using Java - Introduction Dale Roberts, Lecturer Computer Science, IUPUI Department.
Object-Oriented Modeling: Static Models. Object-Oriented Modeling Model the system as interacting objects Model the system as interacting objects Match.
1 Software Engineering: A Practitioner’s Approach, 6/e Chapter 11a: Component-Level Design Software Engineering: A Practitioner’s Approach, 6/e Chapter.
CSE 303 – Software Design and Architecture
Introduction (Continued) Design Patterns (I) Lecture Two.
CHAPTER 3 MODELING COMPONENT-LEVEL DESIGN.
Component Design Elaborating the Design Model. Component Design Translation of the architectural design into a detailed (class-based or module- based)
Chapter 18 Object Database Management Systems. Outline Motivation for object database management Object-oriented principles Architectures for object database.
Lecture 21: Component-Based Software Engineering
Banaras Hindu University. A Course on Software Reuse by Design Patterns and Frameworks.
Banaras Hindu University. A Course on Software Reuse by Design Patterns and Frameworks.
Banaras Hindu University. A Course on Software Reuse by Design Patterns and Frameworks.
February 19, February 19, 2016February 19, 2016February 19, 2016 Azusa, CA Sheldon X. Liang Ph. D. Software Engineering in CS at APU Azusa Pacific.
Banaras Hindu University. A Course on Software Reuse by Design Patterns and Frameworks.
Basic Characteristics of Object-Oriented Systems
CLASSIFICATION OF DESIGN PATTERNS Hladchuk Maksym.
Design Patterns: MORE Examples
Introduction to Design Patterns
Distribution and components
object oriented Principles of software design
Model-Driven Analysis Frameworks for Embedded Systems
Inventory of Distributed Computing Concepts and Web services
Object-Oriented Design
Presentation transcript:

OO Frameworks Department of Computer Science Kent State University

Introduction Frameworks support reuse of detailed designs and architectures An integrated set of components Components collaborate to provide a reusable architecture for a family of related applications

Using Frameworks Frameworks are semi-complete software applications Complete applications are developed by –Inheriting from and –Instantiating parameterized framework components Frameworks provide domain specific functionality –Business telecom databases, OS, etc. Framework determines which objects and methods to invoke in response to events

Libraries vs Frameworks vs Patterns Class library –Self contained –Pluggable ADTs Framework –Reusable, semi-complete application Patterns –Problem, solution, context

Library Architecture

Framework Architecture

Characteristics of Frameworks User-defined methods invoked by the framework code Framework plays the role of the main body Inversion of control allows frameworks to serve as extensible code skeletons User-supplied methods tailor generic framework algorithms for a specific application

Component Integration Framework components are loosely coupled via callbacks Callbacks allow independently developed software to be connected together Callbacks provide a connection point –Generic framework objects communicate with application objects –Framework provides common template methods –Application provides the variant hook methods

Patterns vs Frameworks Patterns and frameworks play complementary cooperative roles Patterns are more abstract descriptions of frameworks Frameworks are implemented (and running) in a specific language Complex frameworks may involve dozens of patterns Patterns help document frameworks

Object-Oriented Frameworks Aka Object-oriented abstract design Consists of: –Abstract class for each major component –Interfaces between components defined in terms of sets of messages –Normally a library of subclasses that can be used as components in the design Examples: –Modern UI toolkits – AWT, Swing, MFC

Open vs Closed Determining common vs variable components is important –Insufficient variation makes it difficult for users to customize framework components –Insufficient commonality makes it hard for users to understand and depend upon framework behavior Generally, dependency should always be in the direction of stability –Components should not depend on any component less stable than itself Open/Closed Principle: –Allows most stable components to be extensible

Open/Closed Principle Components should be: –Open for extension –Closed for modification Implications: –Good: Abstraction Inheritance and polymorphism –Bad: Public/global data Runtime type identification

Incorrect class Shape; class Square : public Shape; class Circle : public Shape; void draw_square(const Square&); void draw_circle(const Circle&); void draw_shape(const Shape& s) { switch (s.shapeType) { case SQUARE: draw_square(s); break; case CIRCLE: draw_circle(s); break;.... }

Correct class Shape { public: virtual void draw () const = 0; }; void draw_all (const Shape& s) { s.draw(); }

Applying Frameworks Use of framework Training and understanding framework Evaluation of framework Development of framework

Building Applications An application developed using a framework includes: –Framework –Concrete subclasses –Scripts that specify which concrete classes to use and how to interconnect them –Objects that have no relationship to framework (e.g., domain specific, utilities)

Blackbox Frameworks Customize framework by supplying it with a set of components that provide application specific behavior (e.g., GUI frameworks) Based on composition and delegation Does not require changes to framework and no new concrete subclasses (i.e., no inheritance) Reuses framework’s interface and rules Application programmers only need to know: –Type A objects can be connected to type B objects –Don’t need to know exact specifics of A and B Implications: –Each component required to understand a particular protocol –Interfaces between components defined by protocol – only need to understand external interfaces of components –Less flexible –Information passed to application must be explicitly passed

Graybox Frameworks Define new concrete subclasses and use them to build application Subclasses are tightly coupled to super classes Requires more explicit knowledge about abstract classes Subclasses must meet specifications implied by super class Programmers must understate framework’s interface in detail

Whitebox Frameworks Program skeleton –Subclasses are the additions to the skeleton Change the abstract classes that form the core of the framework – add new operators and/or attributes Requires the actual source code of framework (versus just the interface) Implications –Framework implementation must be understood to use it –Every application requires the creation of many new subclasses –Can be difficult to learn – need to know hierarchical structure –State of each instance is implicitly available to all methods in framework –Changes to abstract classes can break existing concrete classes

Training Learning a framework is more challenging than learning a class library –Not just individual classes –Learn a set of classes with specific interconnections –Many abstract classes Must have concrete examples (complex to simple) Documentation should include –Purpose of framework –How to use it (cookbook) –How it works interaction between objects how responsibility is allocated between objects

Evaluation Most application domains have no commercially available domain specific frameworks Criteria –Platform/environment –Programming language –Standards –Tradeoffs between simplicity and power Framework objects: –Features that must be supported – distributed, networking issues, interaction styles, …

Development of Frameworks Design of frameworks is analogous to design of any reusable software –Domain analysis –First version should implement examples – typically whitebox –Then use it to build applications Uncover weak areas in the framework Uncover parts that are difficult to change –Experience leads to improvement in the framework Migrates towards a more blackbox system

Development Model Iteration (evolution) is important Domain analysis will gain more information Framework make explicit the parts of the system that will change –Components should implement changeable parts Frameworks are abstractions –Design of a framework depends on original examples

Hooks, Beacons, Hinges Hooks, beacons, hinges are points in the framework that are meant to be adapted or changed –Filling in parameters –Creating new subclasses Hook description –Describes problem and requirements that framework developer anticipates application developer will have –Provides guidance wrt use of hook –Details required changes to the design –Constraints to be satisfied –Effects to the framework

Hooks Adapt Framework Enabling/Disabling a feature Replacing a feature Augmenting a feature Adding a feature

Benefits of Frameworks Modularity –Encapsulate volatile implementation details behind stable interfaces –Localize impact of design and implementation changes Reusability –Stable interfaces enhance reusability of generic components –Leverages domain knowledge and prior experience

Benefits Extensibility –Hook methods allow applications to extend its stable interfaces –Hook methods decouple stable interfaces and behaviors of an application domain Inversion of Control –Application processing customized by event handler objects invoked via framework’s reactive dispatching mechanism –Allow framework rather than each application to determine which set of application specific methods to invoke in response to external events Window messages from end users Packets arriving on communications ports

Trade offs Benefits of frameworks –Enable direct reuse of code –Enable large amounts of reuse vs standalone functions/classes Drawbacks –High initial learning curve –Flow of control for reactive dispatching is often non- intuitive –Verification/validation of generic components is often quite difficult

Classification of Frameworks System infrastructure Middleware integration Enterprise application

System Infrastructure Simplify development of portable and efficient system infrastructure Examples: UI and language processing tools Primarily used internally within a software development organization

Middleware Integration Commonly used to integrate distribute applications and components Designed to enhance ability of software developers to modularize, reuse, and extend software infrastructure in distributed environments Examples: ORB, Transactional DB

Enterprise Applications Address broad application domains –Telecom, manufacturing, financial Expensive to develop and/or purchase Good investment –Support development of end-user applications and products efficiently System infrastructure/middleware frameworks –Focus largely on internal development concerns –Contribute significantly to rapid creation of high quality applications