Title: Evolution of Object Behavior Using Context Relations
1Evolution of Object BehaviorUsing Context
Relations
- Linda M. Seiter, Member, IEEE Computer Society,
Jens Palsberg, - and Karl J. Lieberherr, Member, IEEE
- IEEE TRANSACTIONS ON SOFTWARE ENGINEERING,
- VOL. 24, NO. 1, JANUARY 1998
- 2002/7/24
- Presented by Kim, Cheol-ho
2Contents
- Introduction
- Internal Contexts Dynamic Object Behavior
- Call Contexts Dynamic Collaborative Behavior
- Related Work
- Application of the Context Relation
- Conclusion
3Introduction(1/2)
1) explicit delegation along aggregation
relations 2) creation of auxiliary structures
and hierarchies 3) violation of class
encapsulation.
- Design Pattern
- design reuse
- identify variant aspects of system and propose a
way of applying them in programs - To support dynamic behavior
- class-based approach
- prototype-based approach
1) inability to ensure type safety 2) inability
to override existing behavior in a controlled
manner 3) negative performance impact
4Introduction(2/2)
- Context Relation
- support behavioral evolution while maintaining
the safety and performance benefits available
with strongly typed, class-based languages - to include context relation, extend UML at design
level and Java at language level - demonstrate how the context relation can be used
to easily model and program numerous design
patterns
5Internal Contexts Dynamic Object Behavior(1/4)
- structural and behavioral patterns that benefit
from the context relation can be categorized - based on altering a single object,
- based on altering a class (affecting all
instances) - To safely achieve dynamic behavior at both the
object and class level, object oriented languages
must support - instance-stored versus class-stored specification
- dynamic specification
- dynamic update
6Internal Contexts Dynamic Object Behavior(2/4)
- Instance-Stored Specification
- Dynamic Specification
7Internal Contexts Dynamic Object Behavior(3/4)
- Dynamic Update
- Type Checking Class Update Specifications
- dynamic method implementation should be executed
on the receiver object as well as the context
object - implicit self reference (this pointer in Java)
refers to the receiver object - a new keyword context to refer to the implicit
context object
8Internal Contexts Dynamic Object Behavior(4/4)
- Java Syntax
- Proposed java syntax
- Example class definitions
9Call Contexts Dynamic Collaborative
Behavior(1/4)
- how to alter the behavior of a group of
collaborating objects - attaching a context to a method invocation
- implicitly alter all class instances encountered
during the call
10Call Contexts Dynamic Collaborative
Behavior(2/4)
11Call Contexts Dynamic Collaborative
Behavior(3/4)
- Visitor Pattern Using Context Relations
12Call Contexts Dynamic Collaborative
Behavior(4/4)
13Related Work(1/2)
- Evolving Object Interfaces and Behavior
- Perspectives, Views, contexts, mode
- Evolving Collaborative Behavior
- Frameworks, Clusters, Mechanisms, Contracts,
Propagation patterns, Subjects - Java/C Approach
- Separating an interface from an implementation
- Dynamic binding
14Related Work(2/2)
- CLOS Approach
- multidispatch mechanisms
- Reflection
- use a metaobject protocol to implement the
context relation - Rather than extend the syntax of a language, a
metaobject protocol could be used to alter the
semantics of dynamic binding
15Application of the Context Relation
- A special case of the context relation has been
implemented in Demeter/Java - Demeter/Java visitor implementation has been used
successfully in a commercial project at GTE
Laboratories - traversal/visitor style used in Demeter/Java has
been used successfully in a commercial C
project at Hewlett-Packard - Other features which have not been implemented in
Demeter/Java - dynamic class extension
16Conclusion
- To model and implement the evolution of behavior,
this paper propose the context relation as an
extension to the existing object-oriented model - Context relation is meaningful
- at design, implementation levels and software
testing - dynamic boundary
- the base class along with its contexts
representing the dynamic class definition