Presentation is loading. Please wait.

Presentation is loading. Please wait.

Modularization and Customization Environment (MaCE)

Similar presentations


Presentation on theme: "Modularization and Customization Environment (MaCE)"— Presentation transcript:

1 Modularization and Customization Environment (MaCE)
Jiyong Park Real-Time Operating Systems Lab, Seoul National University, Korea

2 Summary Current progress Architecture Key algorithms Known problems
data structure weave algorithm modularize algorithm Known problems

3 Current Progress Research Implementation Adaptation
customization functionality modularization functionality user interface (shell-like) plug-in module for Java plug-in module for C/C++ user interface (as eclipse plug-in) test Adaptation converting legacy OS to make it compatible with MaCE about 80 %

4 MaCE Architecture (1/3) MaCE user user interface kernel C Java Make
file plug-in modules control flow data flow image file compiler feature repository customized view

5 MaCE Architecture (2/3) feature repository feature_X feature_Y
feature_Z main.c main.c main.c sub.c func.c readme MaCE weave modularize management customized view main.c sub.c readme user

6 MaCE Architecture (3/3) Kernel Plug-in modules User interface
manages features and artifacts weave/modularize language independent Plug-in modules language dependent parsing/printout User interface interface to the kernel

7 Feature Repository (1/2)
myProg main sub opt feature repository feature artifact feature descriptor artifact descriptor

8 Feature Repository (2/2)
a directory that contains all features of a software system Feature a sub directory that contains all artifacts for a specific feature of a system a feature can be activated/deactivated by users feature descriptor file: contains meta-data about a feature Artifact a file inside a feature artifact descriptor file: contains major/minor numbers of each language elements (method, class, code fragment, ...)

9 Customized View Customized view Weaved artifact
a directory that represents a customized software system Weaved artifact a file that is generated by weaving artifacts in activated features developer edits weaved artifact by using his/her favorite editors

10 How to Use MaCE af <feature> : add a new feature.
lf : list features. sf <feature> : show details of a feature. setdesc <feature> : set description for a feature. aa <feature> <artifact> : add an artifact to a feature. da <feature> <artifact> : delete an artifact from a feature. la <feature> : list artifacts in a feature. df <feature> : deletes a feature. ga <artifact> : get an artifact. u <feature> <artifact> : update an artifact.

11 Adding a Feature mace> af base mace> af sub mace> lf base sub
two features named base and sub are added mace> lf base sub mace> la base lists artifacts in a base feature. The result is none, since we did not add any artifact.

12 Adding an Artifact into a Feature
mace> aa base main.java adds an artifact named main.java into base feature mace> la base main.java main.java is added. base sub main.java

13 Get an Artifact to Customized View
mace> ga main.java weave main.java into customized view. From now, developers can edit the main.java Empty main.java file is created. base sub main.java weave main.java

14 Program an Artifact Use favorite editor to modify the main.java
public class A extends B { int a; int b; void func() { double x; double xxxx; double z; }

15 Modularize the Modification into a Feature Repository
mace> u base main.java updates the modification to the main.java in the base feature The user is working on the base feature The user is editing main.java main.java in customized view main.java in base public class A extends B { int a; int b; void func() { double x; double xxxx; double z; } public class A extends B { int a; int b; void func() { double x; double xxxx; double z; }

16 Modularize More mace> aa main.java sub mace> ga main.java
adds main.java to sub feature Again, edit main.java public class A extends B { int a; int b; int c; public void func() { double x; double xxxx; double yyyyy; double z; } int func2() { } public class A extends B { int a; int b; void func() { double x; double xxxx; double z; } edits

17 main.java in customized view
Modularize More mace> u sub main.java updates the recent modification to the main.java in sub feature. main.java in customized view main.java in sub public class A extends B { int a; int b; int c; public void func() { double x; double xxxx; double yyyyy; double z; } int func2() { } class A { int c; public void func() { double yyyyy; } int func2() { } modularizes

18 Result of Modularization
main.java in base main.java in sub public class A extends B { int a; int b; void func() { double x; double xxxx; double z; } class A { int c; public void func() { double yyyyy; } int func2() { }

19 Data Structure (1/2) FeatureRepository Feature Artifact rootDir name
reference subDir name: d.c A B name ref. C a.java D b.java E c.cpp d.c e.html artifact descriptor feature descriptor

20 Data Structure (2/2) An abstract class Artifact represents a parse tree of a source file Each language elements (class, method, ...) are represented as abstract class LanguageStructure This class is extended by plug-in module Artifact JavaArtifact extends * LanguageStructure * predefined class for representing a node with no child extends Class Method .... Field LanguageStructureLeaf

21 JavaArtifact Extended classes package imports types LanguageStructureLeaf Class Class Class name: String modifiers superclass interfaces fields methods Field Method Field Method Field name: String Method name: String arguments: String[] modifiers type modifiers type codes initializer

22 Parent-Child Relationship
Children are grouped Each group has a type that describes relationship among its elements and parent method code fragments public static int mymethod() { ..... } modifiers return type Child node Child node Child node Child node Child node order UNORDERED SINGLE ORDERED

23 Key Algorithms

24 main.c in customized view
Weaving a process of merging parse tree of each artifact that has the same name main.c from feature_X main.c from feature_Y weave main.c in customized view

25 Weaving There are three kinds of weaving depending on the type of a children group SINGLE only one child is permitted, a child with largest minor number wins UNORDERED different children: order among them are not guaranteed same children: a child with largest minor number wins ORDERED different children: order among them are determined by major number

26 Weaving – Case 1: SINGLE There are three kinds of weaving depending on the type of a children group Case 1: SINGLE – child with larger minor number wins weave Parent 1 Parent 2 Weaved parent Child 1 hash = h1 major = m1 minor = n1 Child 2 hash = h2 major = m2 minor = n2 Child 1 hash = h1 major = m1 minor = n1 abs(n1) > abs(n2)

27 Weaving – Case 2: UNORDERED
When two children are the same, child with larger minor number wins. weave Parent 1 Parent 2 Weaved parent Child 1 hash = h1 major = m1 minor = n1 Child 2 hash = h2 major = m2 minor = n2 Child 2 hash = h2 major = m2 minor = n2 .... .... .... .... .... .... h1 == h2 abs(n1) < abs(n2)

28 Weaving – Case 2: UNORDERED
Order between different children are not guaranteed weave Parent 1 Parent 2 Weaved parent Child 1 hash = h1 major = m1 minor = n1 Child 2 hash = h2 major = m2 minor = n2 Child 2 hash = h2 major = m2 minor = n2 Child 1 hash = h1 major = m1 minor = n1 .... .... .... .... .... .... order between child 1 and child 2 are not deterministic h1 != h2

29 Weaving – Case 3: ORDERED
Order between different children are determined by their major number weave Parent 1 Parent 2 Weaved parent Child 1 hash = h1 major = m1 minor = n1 Child 2 hash = h2 major = m2 minor = n2 Child 2 hash = h2 major = m2 minor = n2 Child 1 hash = h1 major = m1 minor = n1 .... .... .... .... .... .... Child 2 is placed before Child 1. m1 > m2

30 Weaving major and minor numbers are recorded in the artifact descriptor file <?xml version="1.0" encoding="UTF-8"?> <artifact name="a.java"> <CF group="2" majorNumber="1" minorNumber="1" hash=" "> <CF group="0" majorNumber="1" minorNumber="1" hash=" " /> <CF group="1" majorNumber="1" minorNumber="1" hash="66" /> <CF group="3" majorNumber="1" minorNumber="1" hash="97"> <CF group="1" majorNumber="1" minorNumber="1" hash="104431" /> </CF> <CF group="3" majorNumber="1" minorNumber="1" hash="98"> <CF group="3" majorNumber="1" minorNumber="1" hash=" "> <CF group="1" majorNumber="1" minorNumber="1" hash=" " /> <CF group="3" majorNumber="1" minorNumber="1" hash=" " /> <CF group="3" majorNumber="2" minorNumber="1" hash=" " /> <CF group="3" majorNumber="3" minorNumber="1" hash=" " /> <CF group="3" majorNumber="4" minorNumber="-4" hash=" " /> </artifact>

31 Modularize Reverse process of weave working on feature_Y feature_X
feature_Z feature_X feature_Y feature_Z main.c main.c main.c main.c main.c main.c Weave Modularize main.c main.c main.c

32 Known Problems (1/2) Impossible to support independent development of features add a new feature “yours” feature “base” 1 2 3 printf(“hello”); printf(“your”); printf(“world”); What happens when the two features are used together? printf(“hello”); printf(“world”); 1 2 Team A Impossible to weave add a new feature “mine” feature “base” 1 2 3 4 printf(“oh!”); printf(“hello”); printf(“my”); printf(“world”); 1 2 printf(“hello”); printf(“world”); Team B

33 Known Problems (2/3) feature “base” feature “yours” Team A 1 3 2
printf(“hello”); printf(“world”); 1 3 printf(“your”); 2 feature “base” feature “mine” printf(“hello”); printf(“world”); 2 4 printf(“oh!”); printf(“my”); 1 3 Team B Neither is correct.

34 What if we activate only “base” and “mine”?
Known Problems (3/3) Deletion an existing code fragment can lead to unexpected situation delete a sentence make it as a part of feature “our” add a sentence make it as a part of feature “mine” feature “base” printf(“hello”); printf(“your”); printf(“world”); printf(“hello”); printf(“my”); printf(“world”); printf(“hello”); printf(“world”); What if we activate only “base” and “mine”? Three cases: printf(“hello”);printf(“your”); printf(“my”); printf(“world”); printf(“hello”); printf(“my”); printf(“yours”); printf(“world”); printf(“hello”); printf(“my”); printf(“world”);

35 Future Work Discuss with Samsung Demo Interim report
Is eclipse plug-in necessary? What are the features that needs to be added? Demo Interim report


Download ppt "Modularization and Customization Environment (MaCE)"

Similar presentations


Ads by Google