Ralph Johnson - University of Illinois1 Reflection and the Adaptive Object Model Architecture Ralph Johnson University of Illinois at Urbana-Champaign.

Slides:



Advertisements
Similar presentations
Chapter 10: Designing Databases
Advertisements

Adaptive Object-Models Joseph W. Yoder University of Illinois The Refactory, Inc.
1 Copyright 1998 by Dragos Manolescu and Joseph W. Yoder Building Frameworks With Patterns “An Active Object-Model For A Dynamic Web-Based Application”
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.
Data Model driven applications using CASE Data Models as the nucleus of software development in a Computer Aided Software Engineering environment.
The Database Environment
Introduction to Databases
Data - Information - Knowledge
1 Basic DB Terms Data: Meaningful facts, text, graphics, images, sound, video segments –A collection of individual responses from a marketing research.
File Systems and Databases
Software Factory Assembling Applications with Models, Patterns, Frameworks and Tools Anna Liu Senior Architect Advisor Microsoft Australia.
Application architectures
Satzinger, Jackson, and Burd Object-Orieneted Analysis & Design
Introduction to Databases Transparencies
Architectural Design Principles. Outline  Architectural level of design The design of the system in terms of components and connectors and their arrangements.
© 2007 by Prentice Hall 1 Chapter 1: The Database Environment Modern Database Management 8 th Edition Jeffrey A. Hoffer, Mary B. Prescott, Fred R. McFadden.
Automatic Data Ramon Lawrence University of Manitoba
Mgt 20600: IT Management & Applications Databases Tuesday April 4, 2006.
Course Instructor: Aisha Azeem
Chapter 1: The Database Environment
1 An introduction to design patterns Based on material produced by John Vlissides and Douglas C. Schmidt.
Data Modeling 1 Yong Choi School of Business CSUB.
Application architectures
BIS310: Week 7 BIS310: Structured Analysis and Design Data Modeling and Database Design.
Yong Choi School of Business CSUB
MDC Open Information Model West Virginia University CS486 Presentation Feb 18, 2000 Lijian Liu (OIM:
PHASE 3: SYSTEMS DESIGN Chapter 7 Data Design.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 18 Slide 1 Software Reuse.
Design Patterns.
11 1 Object oriented DB (not in book) Database Systems: Design, Implementation, & Management, 6 th Edition, Rob & Coronel Learning objectives: What.
Design patterns. What is a design pattern? Christopher Alexander: «The pattern describes a problem which again and again occurs in the work, as well as.
Chapter 7: Database Systems Succeeding with Technology: Second Edition.
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10Slide 1 Architectural Design l Establishing the overall structure of a software system.
Design Pattern Interpreter By Swathi Polusani. What is an Interpreter? The Interpreter pattern describes how to define a grammar for simple languages,
September 18, 2002 Windows 2000 Server Active Directory By Jerry Haggard.
Module 7 Active Directory and Account Management.
CSE 219 Computer Science III Program Design Principles.
Patterns and Reuse. Patterns Reuse of Analysis and Design.
Architectural Design lecture 10. Topics covered Architectural design decisions System organisation Control styles Reference architectures.
Database What is a database? A database is a collection of information that is typically organized so that it can easily be storing, managing and retrieving.
Architectural Design Yonsei University 2 nd Semester, 2014 Sanghyun Park.
Systems Analysis and Design in a Changing World, 3rd Edition
Lecture # 3 & 4 Chapter # 2 Database System Concepts and Architecture Muhammad Emran Database Systems 1.
Chapter 1 Chapter 1: The Database Environment Modern Database Management 8 th Edition Jeffrey A. Hoffer, Mary B. Prescott, Fred R. McFadden © 2007 by Prentice.
Chapter 9 Database Systems Introduction to CS 1 st Semester, 2014 Sanghyun Park.
Frameworks CompSci 230 S Software Construction.
Object-Oriented Modeling: Static Models. Object-Oriented Modeling Model the system as interacting objects Model the system as interacting objects Match.
12 Chapter 12: Advanced Topics in Object-Oriented Design Systems Analysis and Design in a Changing World, 3 rd Edition.
August 2003 At A Glance The IRC is a platform independent, extensible, and adaptive framework that provides robust, interactive, and distributed control.
CS223: Software Engineering
Slide 1 Chapter 8 Architectural Design. Slide 2 Topics covered l System structuring l Control models l Modular decomposition l Domain-specific architectures.
Data Models. 2 The Importance of Data Models Data models –Relatively simple representations, usually graphical, of complex real-world data structures.
1 Chapter 2: Operating-System Structures Services Interface provided to users & programmers –System calls (programmer access) –User level access to system.
Databases and DBMSs Todd S. Bacastow January 2005.
Design Patterns: MORE Examples
The Movement To Objects
Definition CASE tools are software systems that are intended to provide automated support for routine activities in the software process such as editing.
Databases Chapter 16.
Introduction to Design Patterns
Chapter 9 Database Systems
Behavioral Design Patterns
Software Design and Architecture
Part 3 Design What does design mean in different fields?
Data, Databases, and DBMSs
File Systems and Databases
Chapter 1: The Database Environment
The Database Environment
ACTIVE DIRECTORY An Overview.. By Karan Oberoi.
Chapter 5 Architectural Design.
Presentation transcript:

Ralph Johnson - University of Illinois1 Reflection and the Adaptive Object Model Architecture Ralph Johnson University of Illinois at Urbana-Champaign

Ralph Johnson - University of Illinois2 Reflection l Is hard l Is important l The ability of a program to reason about and change its own implementation.

Ralph Johnson - University of Illinois3 Reflection Base level (the application) Meta level (the virtual machine) Paycheck Printer Report Module Employee Class Method

Ralph Johnson - University of Illinois4 Patterns and Architecture Problem with Pattern-Oriented Software Architecture is that the “architectural patterns” are really pattern languages, not patterns.

Ralph Johnson - University of Illinois5 Kinds of Architectures Client-server Purpose: access shared data, distribute computation Result: bottlenecks usually database or network, not CPU

Ralph Johnson - University of Illinois6 Kinds of Architectures Layered system Purpose: reuse lower layers limit effects of change make system easier to understand Result: can be inefficient fix bottlenecks by “punching hole” thru layers

Ralph Johnson - University of Illinois7 Adaptive Object Model l Pattern of business software l Used to model information l Valuable where information structure is complex and changes rapidly l Can be inefficient and hard to understand

Ralph Johnson - University of Illinois8 Adaptive Object Model l Made up of design patterns »Composite, Strategy, Interpreter »Type Object »Properties l Examples: »Rating insurance policies »Rating telephone calls »Maintaining database

Ralph Johnson - University of Illinois9 Type Object l Problem: Have to subclass, and subclasses require code. Want to customize system without programming. l Solution: »For each kind of object, make two classes, an Instance and a Type. »Try not to make a subclass - make a new object of the Type.

Ralph Johnson - University of Illinois10 Examples l Airline scheduling system »airplane and airplane type l Medical information system »observation and observation type l Manufacturing »item and item type

Ralph Johnson - University of Illinois11 Type Object l “type” describes what a group of objects have in common l often “type” creates “instances” l often used with Strategy, Interpreter, and Property InstanceType name values name strategies properties type

Ralph Johnson - University of Illinois12 Insurance Policies Instead of using multiple inheritance to model policies, model a policy as a tree of components. House address, value, size, style House address, value, size, style Liability limit, deductable Liability limit, deductable Car value, mileage, age, drivers Car value, mileage, age, drivers Policy owner, address Policy owner, address Fire limit, deductable Fire limit, deductable Liability limit, deductable Liability limit, deductable Collision limit, deductable Collision limit, deductable

Ralph Johnson - University of Illinois13 Component Class Hierarchy One solution is to make a class for each kind of component. PolicyComponent CarHouseHouseFireHouseLiability CarFireCarLiability Policy

Ralph Johnson - University of Illinois14 Component Characteristics Insurance policies have only a few operations »Edit - create new policy or change old one »Rate - compute amount to charge for policy »Print - convert into paper Different components have different attributes

Ralph Johnson - University of Illinois15 Eliminating Subclasses l Policy made up of Components and ComponentTypes. l Each ComponentType defines a set of Strategies (to represent operations) l Component has a set of Properties (to represent attributes). l One Component class and one ComponentType class.

Ralph Johnson - University of Illinois16 Property Problem: object has arbitrary or huge number of attributes Solution: represent attributes with a dictionary SubjectProperty name value properties

Ralph Johnson - University of Illinois17 Composite Type Object with Properties and Strategies Component ComponentType name Property value PropertyType name type Strategy type properties children

Ralph Johnson - University of Illinois18 Composite Type Object with Properties and Strategies Component Strategy Property value = ‘1 Main Street, Big City’ Property value = ‘1 Main Street, Big City’ PropertyType name =‘address’ PropertyType name =‘address’ ComponentType name =‘House’ ComponentType name =‘House’ PropertyType name =‘owner’ PropertyType name =‘owner’ Property value =‘John Doe’ Property value =‘John Doe’ Auto ComponentType name =‘Policy’ ComponentType name =‘Policy’ Component

Ralph Johnson - University of Illinois19 Problem: Strategy leads to a big class hierarchy, one class for each kind of policy. Solution: Make Composite Strategies. => Interpreter pattern

Ralph Johnson - University of Illinois20 Interpreter Pattern Problem: Need a small language Solution: »Make class hierarchy that models the grammar »Each class defines a value() function with the context as the argument »Program is a tree of objects

Ralph Johnson - University of Illinois21 Small Language for Insurance l Attributes - value() function for an Attribute Type will return value of an attribute with that type in the context. l Arithmetic expressions (+,-,*,/) l Table lookup l Assignment to attribute

Ralph Johnson - University of Illinois22 Component ComponentType name Property value PropertyType name type Rule type children properties Table Expression type children Type Object Composite Strategy Interpreter Property CompositeType Object

Ralph Johnson - University of Illinois23 Products l A product is a type of policy. l Framework makes it easy to create new kind of product. l Framework makes composite types. l Instance vs. type l Operational vs. knowlege

Ralph Johnson - University of Illinois24 Editing a Policy l One editor can edit any policy. l Policy is a sequence of components. l Policy editor is a sequence of component editors. l Component editor has a field for each attribute in the component. »Number field »date field

Ralph Johnson - University of Illinois25 Creating New Component ComponentType name =‘Liability’ ComponentType name =‘Liability’ Component ComponentType name =‘Policy’ ComponentType name =‘Policy’ Component ComponentType name =‘House’ ComponentType name =‘House’ ComponentType name =‘Auto’ ComponentType name =‘Auto’ ComponentType name =‘Liability’ ComponentType name =‘Liability’

Ralph Johnson - University of Illinois26 Creating New Component l When editing component of type T, you can create a component of any type that is a child of T. l Types act like a grammar, while components are an abstract syntax tree

Ralph Johnson - University of Illinois27 Advantages of AOM l Automate user interface l Automate database interface l Enable users to extend system l Automate other aspects of system »History »Workflow

Ralph Johnson - University of Illinois28 Insurance Framework Summary l Policy is a tree of components l Component type is a composite object l System has tools for editing policies, and tools for editing component types l Domain specific object model is in the database, not the CASE tool.

Ralph Johnson - University of Illinois29 Adaptive Object Model l Many systems store object model in a database and interpret it »results in user extensible systems »flexible, easy to maintain »kernel is small, abstract, complex »performance is an issue

Ralph Johnson - University of Illinois30 AOM and Reflection l Similarities »Base level and meta level »Developers have to know both levels l Differences »Base level doesn’t necessarily invoke meta level »No “reflective tower”

Ralph Johnson - University of Illinois31 Telecommunications Billing l Database »customers »charges »network events (call, directory assistance, voic ) »billing plans »bills

Ralph Johnson - University of Illinois32 Telecommunications Billing Rating - converting network events into charges to customer Billing - computing discounts, finance charges, etc - printing bills

Ralph Johnson - University of Illinois33 Rating l Many kind of network events l Billing policy determines how to rate network events l Billing policies continually changing l Network event has a set of properties

Ralph Johnson - University of Illinois34 Rating Account Billing Policy BusinessEvent name = ‘information’ BusinessEvent name = ‘information’ BusinessEvent name = ‘phone call’ BusinessEvent name = ‘phone call’ Charge value = ‘roaming *.25’ Charge value = ‘roaming *.25’ Charge value = ‘air time *.05’ Charge value = ‘air time *.05’ Property name = ‘caller’ value = ‘ ’ Property name = ‘caller’ value = ‘ ’ Network Event name = ‘phone call’ Network Event name = ‘phone call’ Property name = ‘air time’ value = ‘25’ Property name = ‘air time’ value = ‘25’

Ralph Johnson - University of Illinois35 Rating Algorithm l Given a Network Event, find the Account, then the Billing Policy. l Find the Business Event with the same name as the Network Event. l Compute the total of the Charges for the Business Event by evaluating them in the context of the Business Event.

Ralph Johnson - University of Illinois36 NetworkEvent Type name Property name value NetworkEventType BusinessEvent BusinessEventType Charge +*PropertyRef Entity Properties type Interpreter Type Object

Ralph Johnson - University of Illinois37 Similarities Between Systems l Automate GUIs l Automate database access l Provide full history on all objects l Provide GUIs for editing types and rules. l Planned for customers to edit types, but they don’t.

Ralph Johnson - University of Illinois38 Differences Between Systems l Phone billing system makes lots of subclasses of Entity and Type l Phone billing system has more complex algorithms l Insurance system has more powerful rules

Ralph Johnson - University of Illinois39 Global Data l Database for factory locations, product types, accounting codes, conversion rates, etc. l Originally 10 tables, now 100. l Keeps complete history of data l Global Data Division in charge of schemas and data editing programs, their users are in charge of the data.

Ralph Johnson - University of Illinois40

Ralph Johnson - University of Illinois41 History l Effective date - data at which record is valid l Obsolete date - date at which record is invalid l Record is never deleted, its obsolete date is just set to yesterday. l Referential integrity

Ralph Johnson - University of Illinois42 Global Data Editor Window Description Table name Attribute name type Widget value RecordValidator Window Properties Type Object Record Field name value Type Object FieldValidator Widget Description Type Object Strategy

Ralph Johnson - University of Illinois43 Result l Instead of 200 COBOL programs, there are two Java programs (client and server) l We use XML for metadata (window specs and table specs) l Generate documentation from XML l Programs make type objects from XML l New validation rules are in Java

Ralph Johnson - University of Illinois44 Adaptive Object Models l It is common to see combinations of Type Object, Composite, Property, Strategy, and Interpreter. l Object model stored in the database. l Editors / database interface driven by object model. l Enables system to be customized easily.

Ralph Johnson - University of Illinois45 Disadvantages of AOM l Abstract - can be hard to learn l An interpreter - can be slow l A language - are you ready to write a debugger, a test harness, a configuration control system, documentation aids, etc?

Ralph Johnson - University of Illinois46 The Poetry of the Language “It is possible to put patterns together in such a way that many many patterns overlap in the same physical space: the building is very dense; it has many meanings captured in a small space; and through this density, it becomes profound.” Christopher Alexander “A Pattern Language”

Ralph Johnson - University of Illinois47 Summary l Interesting applications use many patterns l Many interesting patterns are not in Design Patterns l Particular combinations of patterns are architectures, and interesting in their own right.

Ralph Johnson - University of Illinois48 Summary l Document architectures l Patterns are a good model for documentation »architecture is a pattern? »architecture is a set of patterns? »architecture is an application of a set of patterns?

Ralph Johnson - University of Illinois49 For more information on adaptive object models and other architectures for business software, see /bus-obj.html