Preliminary Dissertation Proposal Exam<br />Facilitating Maintenance and Evolution of<br />Non-Functional Concerns (NFCs) ...
Background<br />2<br />Metadata<br />Non-Functional Concerns<br />Annotations<br />@Table<br />Confi-<br />gure<br />Secur...
Business Logic<br />NFC Example: Persistence<br />+Metadata (XML)<br />public class ManagerBean<br />  extends javax.ejb.E...
Problem:<br />Address maintenance and evolution challenges of implementing non-functional concerns (NFCs) declaratively<br...
Background: Goal 1<br />5<br /><ul><li>Goal 1: Reusable Enterprise Metadata with PBSE</li></ul>Metadata<br />Non-Functiona...
Background: Goal 2<br />6<br /><ul><li>Goal 2: Managing Transparent Program Transformations</li></ul>Metadata<br />Non-Fun...
Background: Goal 3<br />7<br /><ul><li>Goal 3: Reusing NFCs Across Languages</li></ul>Metadata<br />Non-Functional Concern...
Pattern-Based Structural Expressions (PBSE)<br />A novel metadata language based on queries against the main program; easi...
<ul><li>Background
Completed Work
Reusable Enterprise Metadata with Pattern-Based Structural Expressions (PBSE)
(Main research track paper at AOSD’10)
Enhancing Source-Level Programming Tools with An Awareness of Transparent Program Transformations
(Main research track paper & SW demo at OOPSLA’09)
Research Plan</li></ul>Reusing NFCs Across Languages<br /><ul><li>Work Plan</li></ul>Roadmap<br />9<br />
Business Logic<br />Limitation of Enterprise Metadata<br />10<br />+ Metadata (Java 5 Annotation)<br />publicclassManagerE...
A PBSE Script Example<br />01  Metadata MyJPA<Package p><br />02   Class c in p<br />03      Where (public *EJB)<br />04  ...
<ul><li>Metadata module_name
<[Package|Class|Method|Field|Parameter] val>
[Class|Method|Field|Parameter] iterator in parm
Where (pattern)
@Metadata
@Metadata.property
@Metadata.property =  val
val += @Metadata
~s / [^] old_val [$] / new_val</li></ul>PBSE Constructs<br />12<br />
Programmable<br />Use OO and declarative query programming<br />Understandable<br />Encode relationship between program co...
<ul><li>Background
Completed Work
Reusable Enterprise Metadata with Pattern-Based Structural Expressions </li></ul>(Main research track paper at AOSD’10)<br...
Example: Mortgage <br />Authorization Application<br />public void displayMaxMortgageEligibility<br />(mortgage.Bank$Displ...
 Hinder source-level Prog. tools.</li></ul>15<br />
A SER Script Example<br />01<br />02<br />03<br />04<br />05<br />06<br />07<br />08<br />09<br />10<br />11<br />12<br />...
Managing Bytecode Enhancements<br /><ul><li>What is a structural enhancement?
Large scale program transformations
Add, change, remove classes, methods, and fields
Upcoming SlideShare
Loading in …5
×

Mksong proposal-slide

251 views

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
251
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
3
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Mksong proposal-slide

  1. 1. Preliminary Dissertation Proposal Exam<br />Facilitating Maintenance and Evolution of<br />Non-Functional Concerns (NFCs) in <br />Modern Enterprise Applications<br />Myoungkyu Song <br />SW Innovations Lab, Dept. of Computer Science, Virginia Tech<br /> Committee Members<br />Dr. Eli Tilevich, Chair Virginia Tech<br />Dr. Stephen H. Edwards Virginia Tech<br />Dr. Dennis G. Kafura Virginia Tech<br />Dr. Barbara G. Ryder Virginia Tech<br />Dr. Kwangkeun Yi Seoul National Univ.,<br /> South Korea<br />SW <br />I-Lab<br />April, 28 2011, 2225@KWII<br />
  2. 2. Background<br />2<br />Metadata<br />Non-Functional Concerns<br />Annotations<br />@Table<br />Confi-<br />gure<br />Security<br />Testing<br />C# Attributes<br />[Author ( …<br />Enterprise<br />Application<br />Fault<br />Tolerance<br />Persistence<br />XML<br /><column=…<br /> <field=…/><br />Functional Concerns<br />Intermediate<br />Representation<br />(Bytecode)<br />Source<br />Code<br />Compiler<br />
  3. 3. Business Logic<br />NFC Example: Persistence<br />+Metadata (XML)<br />public class ManagerBean<br /> extends javax.ejb.EntityBean {<br />private Long orderId;<br />private String status;<br />public ManagerBean(){...}<br />...<br />}<br /><entity><br /><class name=“ManagerBean” table=“Manager”><br /><field name=“orderId” primary-key=“true”> <column name=“ORDERID”/> </field> <br /><field name=“status”> <column name=“STATUS”/> </field> <br />...<br /></entity><br />3<br />
  4. 4. Problem:<br />Address maintenance and evolution challenges of implementing non-functional concerns (NFCs) declaratively<br />Thesis statement: <br />Domain-specific languages can facilitate the maintenance and evolution of NFC implementations in modern enterprise applications<br />Dissertation Objective<br />4<br />
  5. 5. Background: Goal 1<br />5<br /><ul><li>Goal 1: Reusable Enterprise Metadata with PBSE</li></ul>Metadata<br />Non-Functional Concerns<br />Annotation<br />@Table<br />Confi-<br />gure<br />Security<br />Testing<br />C# Attributes<br />[Author ( …<br />Enterprise<br />Application<br />Fault<br />Tolerance<br />Persistence<br />XML<br /><column=…<br /> <field=…/><br />Functional Concerns<br />Intermediate<br />Representation<br />(Bytecode)<br />Source<br />Code<br />Compiler<br />
  6. 6. Background: Goal 2<br />6<br /><ul><li>Goal 2: Managing Transparent Program Transformations</li></ul>Metadata<br />Non-Functional Concerns<br />Annotation<br />@Table<br />Confi-<br />gure<br />Security<br />Testing<br />C# Attributes<br />[Author ( …<br />Enterprise<br />Application<br />Fault<br />Tolerance<br />Persistence<br />XML<br /><column=…<br /> <field=…/><br />Functional Concerns<br />Intermediate<br />Representation<br />(Bytecode)<br />Source<br />Code<br />Compiler<br />
  7. 7. Background: Goal 3<br />7<br /><ul><li>Goal 3: Reusing NFCs Across Languages</li></ul>Metadata<br />Non-Functional Concerns<br />Annotation<br />@Table<br />Confi-<br />gure<br />Security<br />Testing<br />C# Attributes<br />[Author ( …<br />Enterprise<br />Application<br />Fault<br />Tolerance<br />Persistence<br />XML<br /><column=…<br /> <field=…/><br />Functional Concerns<br />Intermediate<br />Representation<br />(Bytecode)<br />Source<br />Code<br />Compiler<br />
  8. 8. Pattern-Based Structural Expressions (PBSE)<br />A novel metadata language based on queries against the main program; easier to program, understand, maintain, and reuse.<br />The Structural Enhancement Rule (SER) language<br />A DSL for documenting bytecode enhancements; enables source-level prog. understanding and debugging tools<br />Reusing NFCs Across Languages<br />An approach to reusing NFCs across languages through automated metadata translation<br />Contributions<br />8<br />
  9. 9. <ul><li>Background
  10. 10. Completed Work
  11. 11. Reusable Enterprise Metadata with Pattern-Based Structural Expressions (PBSE)
  12. 12. (Main research track paper at AOSD’10)
  13. 13. Enhancing Source-Level Programming Tools with An Awareness of Transparent Program Transformations
  14. 14. (Main research track paper & SW demo at OOPSLA’09)
  15. 15. Research Plan</li></ul>Reusing NFCs Across Languages<br /><ul><li>Work Plan</li></ul>Roadmap<br />9<br />
  16. 16. Business Logic<br />Limitation of Enterprise Metadata<br />10<br />+ Metadata (Java 5 Annotation)<br />publicclassManagerEJB <br />{<br />public String getOrderId(){<br /> return orderId;<br /> }<br />public String getStatus(){<br /> return status;<br /> }<br />@Entity<br />@Table(name="Manager")<br /> @Id<br /> @Column(name="orderId", primaryKey=true)<br /> @Column(name="status", primaryKey=false)<br />
  17. 17. A PBSE Script Example<br />01 Metadata MyJPA<Package p><br />02 Class c in p<br />03 Where (public *EJB)<br />04 c += @Table<br />05 @Table.name = (c.name =~ s/EJB$//) <br />06 Column<c> <br />07<br />08 Metadata Column<Class c><br />09 Field f in c<br />10 Where (private * *)<br />11 Method m in c <br />12 Where((“get” + (f.name =~ s/^[a-z]/[A-Z]/)) == m.name)<br />13 m += @Column<br /> @Column.name = f.name<br />15 Where(public * get*Id ())<br />16 @Column.primKey = true<br />17 m += @Id <br />18 MyJPA <"package1"><br />11<br />
  18. 18. <ul><li>Metadata module_name
  19. 19. <[Package|Class|Method|Field|Parameter] val>
  20. 20. [Class|Method|Field|Parameter] iterator in parm
  21. 21. Where (pattern)
  22. 22. @Metadata
  23. 23. @Metadata.property
  24. 24. @Metadata.property = val
  25. 25. val += @Metadata
  26. 26. ~s / [^] old_val [$] / new_val</li></ul>PBSE Constructs<br />12<br />
  27. 27. Programmable<br />Use OO and declarative query programming<br />Understandable<br />Encode relationship between program constructs and their metadata<br />Maintainable<br />Express explicit structural information<br />Reusable<br />Leverage naming conventions of framework dependent code<br />Pattern-Based Structural Expressions<br />13<br />
  28. 28. <ul><li>Background
  29. 29. Completed Work
  30. 30. Reusable Enterprise Metadata with Pattern-Based Structural Expressions </li></ul>(Main research track paper at AOSD’10)<br /><ul><li>Enhancing Source-Level Programming Tools with An Awareness of Transparent Program Transformations</li></ul>(Main research track paper & SW demo at OOPSLA’09)<br /><ul><li>Research Plan</li></ul>Reusing NFCs Across Languages<br /><ul><li>Work Plan</li></ul>Roadmap<br />14<br />
  31. 31. Example: Mortgage <br />Authorization Application<br />public void displayMaxMortgageEligibility<br />(mortgage.Bank$Display, double);<br /> Code:<br />...<br /> invokestatic // jdoGetsalaryLevel;<br /> aload_0<br /> invokestatic // jdoGetcreditLevel;<br />...<br /> invokevirtual // calcMaxMortgage<br />...<br /> invokevirtual // getMortgageField<br />public void displayMaxMortgageEligibility<br /> (Display display, double projectedIncrease) {<br />...<br /> double maxMortgage =<br />calcMaxMortgage(salaryLevel, creditLevel);<br />...<br /> FrameField mortgageField = <br /> display.getMortgageField();<br /> mortgageField.setVal(maxMortgage);<br />...<br />}<br /><ul><li> Difficult to find errors.
  32. 32. Hinder source-level Prog. tools.</li></ul>15<br />
  33. 33. A SER Script Example<br />01<br />02<br />03<br />04<br />05<br />06<br />07<br />08<br />09<br />10<br />11<br />12<br />13<br />Program JDO Using SUPER_JDO_SER<br />Begin<br />EnhClass = OrgClass<br />EnhClass.AddInterface (“javax.jdo.spi.PersistenceCapable”)<br />Var PatternfieldP<br />Begin<br />modifiers= (“private” or “protected”) and not “static”<br />End<br />VarIterator fieldIter = OrgClass.Fields(fieldP)<br />EnhClass.AddMethod(FieldSetReplacer(“jdoSet”, fieldIter))<br />EnhClass.AddMethod(FieldGetReplacer(“jdoGet”, fieldIter))<br />End<br />16<br />
  34. 34. Managing Bytecode Enhancements<br /><ul><li>What is a structural enhancement?
  35. 35. Large scale program transformations
  36. 36. Add, change, remove classes, methods, and fields
  37. 37. Limited and well-defined method body changes
  38. 38. Replace field accesses with getter/setter
  39. 39. Replace method calls with wrappers</li></ul>17<br />
  40. 40. Managing Bytecode Enhancements<br /><ul><li>Structural enhancements at the bytecode level
  41. 41. Poorly understood, not properly documented
  42. 42. Lack easy-to-understand expression medium
  43. 43. Our solution
  44. 44. Structural Enhancements Rules (SER) Language
  45. 45. Domain Specific Language (DSL) for bytecode enhancements
  46. 46. Helps express ,understand, and maintain enhancements</li></ul>18<br />
  47. 47. <ul><li>AddClass
  48. 48. [Add|Remove]SuperClass
  49. 49. [Add|Remove]SuperInterface
  50. 50. [Add|Remove]Method
  51. 51. [Add|Remove]Field
  52. 52. ReplicateMethod
  53. 53. Field[Get|Set]Replacer
  54. 54. Iterators
  55. 55. Patterns</li></ul>SER Constructs<br />19<br />
  56. 56. Leveraging SER for Maintenance<br />SER<br />Script<br />SER<br />Parser<br />Enhanced<br />Bytecode<br />Source Code Enhancement Program Constructs<br />Bytecode <br />Processor<br />Src. code <br />Processor<br />Original<br />Source code<br />Bytecode to Src. Map<br />Symbol<br />Table<br />Original<br />Source Code<br />SER Interpreter<br />Enhancement<br />Information<br />20<br />
  57. 57. Symbolic Debugger for Enhanced Bytecode<br />A standard debugger : JDB<br />The newly added methods<br />The skip instruction<br />Our symbolic debugger<br />The changed method<br />The reverse instruction<br />21<br />
  58. 58. <ul><li>Background</li></ul>Completed Work<br />Reusable Enterprise Metadata with Pattern-Based Structural Expressions <br />Enhancing Source-Level Programming Tools with An Awareness of Transparent Program Transformations<br /><ul><li>Research Plan</li></ul>Reusing NFCs Across Languages<br /><ul><li>Work Plan</li></ul>Roadmap<br />22<br />
  59. 59. Metadata<br />Non-Functional Concerns<br />Annotation<br />@Table<br />Confi-<br />gure<br />Security<br />Testing<br />C# Attributes<br />[Author ( …<br />Enterprise<br />Application<br />Fault<br />Tolerance<br />Persistence<br />XML<br /><column=…<br /> <field=…/><br />Functional Concerns<br />Intermediate<br />Representation<br />(Bytecode)<br />Source<br />Code<br />Compiler<br />Emerging languages(ELs) cross-compiled to mainstream languages(MLs)<br />NFCs, such as security, testing, and persistence implemented in target MLs<br />NFCs specified through metadata<br />EL unable to access ML’s NFC implementations<br />EL programmers waste development effort reimplementing NFCs<br />A novel approach <br />reusing NFC implementations across languages by automatically translating metadata<br />Research Plan<br />23<br />
  60. 60. Goals & Steps<br />24<br />PBSE<br />Translator<br />Metadata<br />Translator<br />PBSE<br />Source<br />Language<br />PBSE<br />Target<br />Language<br />Metadata<br />Target<br />Language<br />1...n<br />1...n<br />Program<br />in Target<br />Language<br />Program<br />in Source<br />Language<br />1...n<br />Cross Compiler<br /><ul><li>Step 1: PBSE Metadata Translation Framework
  61. 61. Step 2: PBSE Meta-metadata
  62. 62. Step 3: Generative Visitor</li></ul>Executable<br />NFCs<br />Functional<br />Concerns<br />1st<br />1st<br />2nd<br />2nd<br />nth<br />nth<br />
  63. 63. Step 1:Metadata Translation Framework<br />25<br />Program<br />in Source<br />Language<br />Metadata<br />in Source<br />Language<br /><<tag>><br />Program<br />Cross-<br />Compile<br />Metadata<br />Cross-<br />Compile<br />Program<br />in Target<br />Language<br />1...n<br />Metadata<br />in Target<br />Language<br />1...n<br /><<tag>><br />
  64. 64. MetaMetadata PBSEJavaToXML<PBSE pbse><br />Where(Class c inpbse)<br /> @Table ->"<class/>"<br /> @Table.name -> "<class name=" + c.name + "/>"<br /> @Table.class -> "<class table=" + c.table + "/>"<br />Where (Field f in pbse)<br /> @Field -> "<field/>"<br /> @Field.name -> "<field name=" + f.name + "/>"<br /> @Column -> "<column/>"<br /> @Column.name -> "<column name=" + f.column + "/>"<br />Step 2: PBSE meta-metadata<br />26<br />Mapping<br />Mapping<br />
  65. 65. Step 3: Generative Visitor<br />27<br /><<interface>><br />PBSEVistitor<br />+ visit(PBSEElementPackage elem)<br />+ visit(PBSEElementClass elem)<br />+ visit(PBSEElementField elem)<br />+ visit(PBSEElementMethod elem)<br />...<br />PBSEVisitorX10toJava<br />PBSEVisitorJavatoXML<br />PBSEVisitorJavatoAnnotation<br />PBSEVisitorX10toCpp<br />...<br />PBSEElementPackage<br /><<interface>><br />PBSEElement<br />+ accept(PBSEVisitor visitor)<br />PBSEElementClass<br />...<br />
  66. 66. Step 3: Generative Visitor<br />28<br /><jdo><package name=“packageName"><br /><class table="ClassName"<br /> name="ClassNameModel" <br />...><br /> <field name=...><br /> <column name=.../><br /> </field><br />...<br />cont’d<br />class PBSEVisitorJavaToXML extends PBSEVisitorAdaptor{<br />void visit(...){<br />...<br />if( elem.tagWith ("@Table")){ <br /> out.write( JavaToXML.translate<br /> ("@Table","<class/>"));<br /> } else<br />if( elem.tagWith ("@Table.name")){ <br /> out.write( JavaToXML.translate<br /> ("@Table.name","<class table=${value}/>"));<br /> } else<br />...<br />
  67. 67. <ul><li>Reuse NFCs across languages</li></ul>Collaborate with IBM Research on X10<br />IBM Innovation Award 2010<br /><ul><li>Cross-compilation
  68. 68. X10 cross-compiles to Java & C++
  69. 69. Scala, Jython, and JRuby
  70. 70. Reuse NFCs of </li></ul>Testing: JUnit (Java Unit Testing Framework) & CppUnit (C++ Unit Testing Framework)<br />Transparent Persistence: JDO (Java Data Objects) & ODB (ORM system for C++)<br />Evaluation Plan<br />29<br />
  71. 71. Reusing UnitTest Framework<br />30<br />The class to be tested<br />publicclass IntegrateTest {<br />var parm : double;<br />var expt : double;<br />var integrate : Integrate;<br />defthis(parm : double, expt : double) {<br />this.parm = parm;<br />this.expt = expt;<br /> }<br />publicdef testComputeArea() {<br />val result = integrate.computeArea(0, this.parm);<br />TUnit.assertEquals(this.expt, result);<br /> }<br />publicstatic def data() {<br />val parm = new Array[double](0..1*0..2);<br /> parm(0, 0) = 2;<br /> parm(0, 1) = 6.000000262757339;<br />...}}<br />publicclass Integrate {<br />staticdef computeArea(left:double, right:double) {<br />return recEval(left, (left*left + 1.0) * left, <br /> right, (right*right + 1.0) * right, 0);<br /> } <br />staticdef recEval(l:double,.. r:double,..) {<br /> // ..<br />finish { <br />async{expr1 = recEval(c, fc, r, fr, ar); }; <br /> expr2 = recEval(l, fl, c, fc, al);<br /> } <br />return expr1 + expr2;<br />}}<br />The method to be tested<br />Parameterizing<br />
  72. 72. Reusing UnitTestFramework: PBSE Spec.<br />31<br />cont’d<br />MetadataUnitTest<Package p><br /> Class c in p<br />Where(public class *Test)<br /> c += @RunWith<br /> @RunWith.value = "Parameterized"<br /> TestMethod<c><br />Metadata TestMethod<Class c><br /> Method m in c<br />Where (public def init ())<br /> m += @Before<br />Where (public def finish ())<br /> m += @After<br />Where (public def test* ())<br /> m += @Test<br />Where (public static def data ())<br /> m += @Parameters<br />UnitTest<“package1"><br />Parameterization<br />
  73. 73. Reusing Transparent Persistence<br />32<br />publicclass Fmm3d{<br />def getDirectEnergy() : Double{<br />val model = new FmmModel();<br />val directEnergy = finish (SumReducer()){<br />ateach (p1 in locallyEssentialTrees) {<br />varthisPlaceEnergy : Double = 0.0;<br />for ([x1,y1,z1] in lowestLevelBoxes.dist(here)){<br /> val box1 = lowestLevelBoxes(x1,y1,z1) as FmmLeafBox;<br /> for ([atomIndex1] in 0..(box1.atoms.size()-1)){<br /> for (p in uList){<br /> for ([otherBoxAtomIndex] in 0..(boxAtoms.size-1)){<br /> thisPlaceEnergy += <br /> atom1.charge * atom2Packed.charge / <br /> atom1.centre.distance(atom2Packed.centre);<br /> }}}<br />model.setModelId(id(box1.x,box1.y,box1.z));<br />model.setEnergy(thisPlaceEnergy);<br /> //...<br />TP.setFmmModelObj(model);<br />Long <br />Comput-<br />ation Part<br />Transparently<br />Persistent<br />
  74. 74. <ul><li>Enable reuse of main stream language NFC implementations in emerging languages.</li></ul>Research Plan: Summary<br />33<br />NFCs<br />Cross-compile<br />Metadata<br />X Language<br />NFCs<br />Metadata<br />Metadata<br />Metadata<br />X Language<br />Background<br />Application<br />Emerging<br />Language Application<br />Metadata<br />Y Language<br />NFCs<br />Y Language<br />Background<br />Application<br />Cross-<br />compiler<br />
  75. 75. <ul><li>Problems:
  76. 76. Metadata programming takes increasingly large amounts of time and efforts
  77. 77. Source code alone not sufficient to understand the enhanced NFC implementations at intermediate level in modern applications
  78. 78. Cross-compiled source language inaccessible to the NFCs implemented by mainstream target ones</li></ul>Significance<br />34<br />cont’d<br />
  79. 79. <ul><li>The specific innovations:
  80. 80. Pattern-Based Structural Expressions (PBSE)
  81. 81. A novel metadata format that is easier to author, understand, reuse, and maintain than existing metadata formats
  82. 82. Structural Enhancement Rule (SER)
  83. 83. A DSL documenting intermediate code enhancements that facilitates the understanding and debugging of NFC implementations
  84. 84. Automated metadata cross-translation
  85. 85. Enable cross-compiled source language programs to reuse target language NFC implementations</li></ul>Significance<br />35<br />
  86. 86. <ul><li>Goal 1 & 2: published on 2 conferences
  87. 87. Goal 3: will submit ICSE, ECOOP, OOPSLA , AOSD, or TOSEM</li></ul>Work Plan<br />36<br />Thank you<br />

×