Download presentation
Presentation is loading. Please wait.
1
Hyper/J George Fairbanks Objects and Aspects 12 November 2004
2
23 June 20152 Harumph! Too hot! Too cold! Everything stinks!
3
23 June 20153 Outline History Subjects Multi-Dimensional Separation of Concerns Hyper/J Artifact structure Hyperspaces Concerns Hypermodules Merging Experience Discussion
4
23 June 20154 History: Subjects Objects are good because of polymorphism and encapsulation In a large team, different programmers want to extend the object to add their functionality How is a poor programmer supposed to anticipate all those features?
5
23 June 20155 History: MDSoC MDSoC= Multi-Dimensional Separation of Concerns Meta, very meta Hyperslice A set of modules where all code is for a given concern “Declaratively complete” – not a simple partition “Tyranny of the dominant decomposition” The primary structure of a system Tangling One method has code for many concerns Scattering Code for one concern in many methods
6
23 June 20156 Hyper/J An “instance of MDSoC” that enables the definition of Java concerns (hyperslices) merges the concerns into a complete Java program Note: No Base/Aspect duality like in AspectJ Various composition rules can be defined
7
23 June 20157 Hyper/J Artifact Structure … and processing Hyperslice Hyperspace Hyperslice Merge Rule Hyper/J Hyperslice Hypermodule javac
8
23 June 20158 Hyperspace hyperspace DemoHyperspace composable class demo.ObjectDimension.*; composable class demo.StyleChecker.*; composable class demo.Observer.*; The Hyperspace definition is equivalent to defining the files in a project
9
23 June 20159 Hyperslice package demo.ObjectDimension : Feature.Kernel operation check : Feature.Check operation display : Feature.Display operation eval : Feature.Eval operation check_process : Feature.Check operation display_process : Feature.Display operation eval_process : Feature.Eval operation process : Feature.None package demo.StyleChecker : Feature.StyleChecker package demo.Observer : Feature.Logging Maps source code to concerns (features / aspects / hyperslices)
10
23 June 201510 Hypermodule hypermodule DemoSEE hyperslices: Feature.Kernel, Feature.Check, Feature.Display, Feature.Eval, Feature.StyleChecker, Feature.Logging; relationships: mergeByName; equate operation Feature.Kernel.process, Feature.Check.check_process, Feature.Display.display_process, Feature.Eval.eval_process; bracket "*"."{~_,~<}*" before Feature.Logging.LoggedClass._beforeInvoke( $ClassName, $OperationName ), after Feature.Logging.LoggedClass._afterInvoke( $ClassName, $OperationName ); set summary function for action DemoSEE.BinaryOperator.check to action DemoSEE.Expression.summarizeCheck; end hypermodule; Defines the composition of the concerns Detail on next slide
11
23 June 201511 Merging (Weaving) What matches? mergeByName, nonCorrespondingMerge, overrideByName Equate different names but really the same Bracket Methods should be preceded/followed by others Set summary function What is the return value of a composed function?
12
23 June 201512 Simple Example In foo.java public class Foo { public void sayHi() { System.out.println(“Hi”); } In bar.java public class Bar { public void sayBye() { System.out.println(“Bye”); } In demo.opt config file -hyperspace hyperspace demo composable class Foo; composable class Bar; -concerns class Foo : Feature.hi class Bar : Feature.bye -hypermodules hypermodule DemoHM hyperslices: Feature.hi, Feature.bye; relationships: mergeByName; equate operation Feature.hi.sayHi, Feature.bye.sayBye into greet; merge class Feature.hi.Foo, Feature.bye.Bar; end hypermodule;
13
23 June 201513 Hyper/J Experience Results from Murphy et al. Compared AspectJ, Hyper/J, LSOC tools Still need to decide structures in advance Concerns should not be tangled in a method Refactoring tools needed Results from Chavez et al. Wrote an AspectJ program Restructured it for Hyper/J Hyper/J may be less readable Hyper/J externalized composition rules helpful vs. AspectJ’s internal dominates rule
14
23 June 201514 Tooling: CME CME= Concern Manipulation Environment I would have a live demo of CME here but all I can seem to do is hang it. It is version 0.1.2.
15
23 June 201515 Discussion Comparison with AspectJ No “base/aspect dichotomy”, but “Kernel” hyperslice appears commonly Within-method concerns: which is better? When is program evolution easier, harder? What are the programmer’s benefits, burdens? If you owned a company, how would you decide whether or not to use Hyper/J?
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.