html5-img
1 / 15

Hyper/J

Hyper/J. George Fairbanks Objects and Aspects 12 November 2004. Harumph!. Too cold!. Too hot!. Everything stinks!. Outline. History Subjects Multi-Dimensional Separation of Concerns Hyper/J Artifact structure Hyperspaces Concerns Hypermodules Merging Experience Discussion.

golda
Download Presentation

Hyper/J

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Hyper/J George Fairbanks Objects and Aspects 12 November 2004

  2. Harumph! Too cold! Too hot! Everything stinks!

  3. Outline • History • Subjects • Multi-Dimensional Separation of Concerns • Hyper/J • Artifact structure • Hyperspaces • Concerns • Hypermodules • Merging • Experience • Discussion

  4. 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. 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. 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. Hyperspace Hyperslice Merge Rule Hypermodule Hyperslice Hyperslice Hyperslice Hyperslice Hyperslice Hyperslice Hyperslice Hyperslice Hyper/J Artifact Structure • … and processing Hyper/J javac

  8. 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. 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. 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. 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. 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; Simple Example

  13. 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. 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. 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?

More Related