Title: Building Frameworks With Patterns
1Building Frameworks With Patterns
- An Active Object-Model For A Dynamic Web-Based
Application
2Presenters
- Joseph W. Yoder -
- j-yoder_at_uiuc.edu
- http//www.uiuc.edu/ph/www/j-yoder
- Dragos Manolescu -
- manolesc_at_uiuc.edu
- http//www.uiuc.edu/ph/www/manolesc
3Goals
- Have fun
- Learn a little about our framework
- Overview of patterns used in the framework
- See how to implement the patterns using Java
4Outline
- Project Overview
- Active Object-Model
- Overview of Frameworks
- Preview of Patterns in the Framework
- Architecture Design of the Framework
- Patterns in the Framework
- Future Development
- Summary
5Active Object-Model(Dynamic Object-Model)
- An ACTIVE OBJECT-MODEL is an object model that
provides meta information about itself so that
it can be changed at runtime - explicit object model that it interprets at
run-time - change the object model, system changes its
behavior - ACTIVE OBJECT-MODELS usually arise as
domain-specific frameworks - Business rules can be stored in ACTIVE
OBJECT-MODELS
6Purpose Of ProjectOn-line Registration
- Develop reusable Software System to be used for
on-line Conference Registration - Customizable
- Different Reports
- Different databases
- Different Business Logic
- Composable
7Requirements
- Web Access
- Easy to Use
- Secure
- Platform Independent
- Integration with Legacy Databases
- Robust
8How to DevelopReusable Software
- Reusable software is hard to develop
- Generalize from examples
- Refactor to pull out common parts
- Develop special interface/language for specifying
application
9Frameworks
- Interface design and functional factoring
constitute the key intellectual content of
software and are far more difficult to create or
re-create than code. - Peter Deutsch
- Difference between framework and component
library for framework (components get plugged in
and are concrete sub-classes that do all the
work). - For detailed information about Frameworks attend
Ralph Johnsons tutorial or see - http//st-www.cs.uiuc.edu/users/johnson/
- or http//www-cat.ncsa.uiuc.edu/yoder/Research/F
rameworks
10Frameworks Encode Domain Knowledge
- Frameworks solve particular sets of problems.
- get different points of view
- explain/defend current design
- Some frameworks are more technology (horizontal)
frameworks verses application domain (vertical)
frameworks. - Are we solving GUIs, object persistence verses
more application domain related such as
insurance, medical,or manufacturing.
11Frameworks
- Framework is
- reusable design of an application or subsystem
- represented by a set of abstract classes and
the way objects in those classes collaborate. - Use framework to build application by
- Creating new subclasses
- Configuring objects together
- Modifying working examples
12Frameworks
- Framework prescribes how to decompose a problem.
- Not just the classes, but the way instances of
the classes collaborate. - shared invariants that objects must maintain, and
how they maintain them - framework imposes a collaborative model that you
must adapt to.
13Relevant Principles
- Frameworks are abstractions people generalize
from concrete examples - Designing reusable code requires iteration
- Frameworks encode domain knowledge
- Customer of framework is application programmer
14Generalize from Concrete Cases
- People think concretely, not abstractly.
- Abstractions are found bottom-up, by examining
concrete examples. - Generalization proceeds by
- finding things that are given different
namesbut are really the same, - parameterizing to eliminate differences,
- breaking large things into small things so that
similar components can be found, and - categorizing things that are similar.
15Finding Abstract Classes
- Abstract classes are discovered by generalizing
from concrete classes. - To give two classes a common superclass
- give them common interface
- rename operations so classes use same names
- reorder arguments, change types of arguments,
etc. - refactor (split or combine) operations
- if operations have same interface but different
implementation, make them abstract - if operations have same implementation, move to
superclass
16Frameworks Require Iteration
- Reusable code requires many iterations.
- Basic law of software engineering (Johnsons law)
- If it hasn't been tested, it doesn't work.
- Corollary software that hasn't been reused is
not reusable.
17White-box vs. Black-box
Black-box Customize by configuring Emphasize
polymorphism Must know interfaces Complex, harder
to design Easier to learn, requires less
programming. Harder to customize because you
need to learn how objects collaborate
- White-box
- Customize by subclassing
- Emphasize inheritance
- Must know internals
- Simpler, easier to design
- Harder to learn, requires more programming.
- Easier to customize because you can overwrite the
code
18Patterns for Developing Frameworks
- 1) Three Examples
- 2) White-box Framework
- 3) Component Library
- Build applications and add components to library
- 4) Hot Spots
- Separate Changeable from Stable Code
- Design Patterns
19Patterns for Developing Frameworks
- 5) Pluggable Objects
- 6) Fine-grained Objects
- 7) Black-box Framework
- 8) Visual Builder
- 9) Language Tools
- http//st-www.cs.uiuc.edu/users/droberts/evolve.ht
ml
20Mapping Objects To Persistence Pattern Language
- Persistence Layer
- CRUD
- SQL Code
- Attribute Mapping Methods
- Type Conversion
21Mapping Objects To Persistence Pattern Language
- Changed Manager
- OID Manager
- Transaction Manager
- Connection Manager
- Table Manager
22Security Patterns
23Architecture
- To be presented by Dragos Manolescu
- http//www-cat.ncsa.uiuc.edu/yoder/Research/PLoP/
arch.html
24Future Development
- Metadata stored in database
- Visual Builders and Editors
- Debugging Tools
- Distribution through CORBA etc
25Patterns used in the System
- GOF Patterns
- Strategy, State, Singleton, Composite, Factory
Method, Prototype - Layered Architecture
- Security Patterns
- Limited View, Single Access Point, Roles, Check
Point, Session, Secure Access Layer - Persistence Object Patterns
- Attribute Mapping Methods, Transaction Manager,
OID Manager, Change Manager, CRUD, Type
Conversion, Connection Manager, Table Manager,
Persistence Layer - Type-Object, Properties, Metadata
- Evolving Frameworks
26Summary
- We have developed a reusable designfor on-line
registration - Patterns can be very useful for solving problems
in your domain - Frameworks take time to develop butthe payoff
can be tremendous
27Where to Find more Information
- http//www-cat.ncsa.uiuc.edu/yoder/Research/PLoP
- http//www-cat.ncsa.uiuc.edu/yoder/Research/metad
ata - http//st-www.cs.uiuc.edu/users/droberts/evolve.ht
ml - http//www-cat.ncsa.uiuc.edu/yoder/papers/pattern
s - http//hillside.net
- http//st-www.cs.uiuc.edu/
28Thats All