SlideShare a Scribd company logo
1 of 33
Download to read offline
Language-Independent
 Detection of Object-Oriented
       Design Patterns


                           Johan Fabry
    Vrije Universiteit Brussel, Programming Technology Lab
                     johan.fabry@vub.ac.be




25 Aug 2003              Lang-Indep Detection of OO DP       1
Overview
ß Research Goal
ß DMP and Soul
ß Soul to SoulJava
ß Base-Level Reification
ß Design Pattern Detection
ß Conclusion & Future Work

25 Aug 2003   Lang-Indep Detection of OO DP   2
Research Goal
ß Language-agnostic reasoning about OO
  programs
ß Validate research in different OO -
  languages
     ß Soul: Reasoning about Smalltalk (coding
       conventions, DP, bad smells, …)
ß Clear separation language indep / dep
ß Validation: ST + Java detect BPP, DP

25 Aug 2003       Lang-Indep Detection of OO DP   3
DMP and Soul
ß DMP:
     ß Declarative language at meta-level
     ß OO language at base level
     ß Meta-level programs reason about structure of
       base-level


ß Soul:
     ß Meta-level prolog-like programming language
     ß Smalltalk code can be embedded in prolog code


25 Aug 2003         Lang-Indep Detection of OO DP      4
Soul Layering
              ‘Uses’ Layering:




Inference                                        Code
              LiCoR                   MLI
  Engine                                       Repository


25 Aug 2003    Lang-Indep Detection of OO DP            5
Inference engine
ß Logic query with a variable:
          If class(?x)




Inference                                           Code
                LiCoR                    MLI
  Engine                                          Repository


25 Aug 2003       Lang-Indep Detection of OO DP            6
LiCoR
ß Appropriate rule is triggered:
    class(?c) if variable(?c),
       generate(?c,[ExplicitMLI
           current allClasses)])


Inference                                        Code
              LiCoR                   MLI
  Engine                                       Repository


25 Aug 2003    Lang-Indep Detection of OO DP            7
Meta Level Interface
ß Link to the base-level:
          allClasses
              ^Smalltalk allClasses



Inference                                            Code
                  LiCoR                   MLI
  Engine                                           Repository


25 Aug 2003        Lang-Indep Detection of OO DP            8
Code Repository
ß Investigate the code:
          allClasses
           …



Inference                                           Code
                LiCoR                    MLI
  Engine                                          Repository


25 Aug 2003       Lang-Indep Detection of OO DP            9
Soul to SoulJava
     We discuss changes in inverse order.




Inference                                          Code
                LicoR                   MLI
  Engine                                         Repository


25 Aug 2003      Lang-Indep Detection of OO DP           10
Java Code Repository
ß Use Frost to parse Java Code
     ß Assume correct java code !
     ß Java 1.0 (+epsilon) parser
ß Java Code = parse trees
ß .java ‘File in’ in File Browser
ß Java Code Browser


25 Aug 2003        Lang-Indep Detection of OO DP   11
Java Code Browser




25 Aug 2003       Lang-Indep Detection of OO DP   12
MLI For Java
ß Uses Java Code Repository

ß Implements
     ß all methods of ST MLI
     ß methods for interface support




25 Aug 2003       Lang-Indep Detection of OO DP   13
Base-Level Reification
ß Namespace [name|super|sub|classes]
     ß ->Through MLI
ß Class [name|super|sub|ns|methods|iv]
     ß ->Through MLI
ß InstVar [name|inClass|type]
     ß ->Through MLI
ß Method [name|arglist]
     ß ->Through MLI
25 Aug 2003      Lang-Indep Detection of OO DP   14
Method Body Reification
ß Method bodies = logic parse tree form
ß Smalltalk: count set: 0 =
  send(variable([#count])),[#set:],<[0]>)
ß Java: count.set(0) =
  send(variable([#count])),[#set],<[0]>)


ß Allows for easy verification:
     isMessageSend(send(?receiver,
       ?message,?arguments))


25 Aug 2003     Lang-Indep Detection of OO DP   15
Method Body Reification
ß But Java has more PT elements!
     ß if-then-else, while, for, …
ß Introduce new logic functor for each
ß Logic Java Parse trees have different form!
     ß No transformation to ‘ST-compatible’ form
     ß Logic PT as similar as possible to Java code
     ß Needed for later work: Java PT manipulations
ß Users of parse tree must take this into
  account

25 Aug 2003          Lang-Indep Detection of OO DP    16
Parse Tree Traversal Layer
ß PTT: Specific layer in LiCoR
ß Recursively traverses parse trees
ß Called with:
     ß ?found predicate
     ß ?process predicate
     ß ?env for results
ß Provide lang-spec implementation

25 Aug 2003       Lang-Indep Detection of OO DP   17
Parse Tree Traversal Layer
ß PTT: Specific layer in LiCoR
ß RecursivelyisMessageSend trees
              traverses parse
ß Called with:
     ß ?found predicate
     ß ?process predicate
     ß ?env for results
ß Provide lang-spec implementation

25 Aug 2003       Lang-Indep Detection of OO DP   18
Parse Tree Traversal Layer
ß PTT: messageSendMessage(
       Specific layer in LiCoR
ß Recursively traverses parse trees
            send(?rec,?msg,?args),
            ?args)
ß Called with:
     ß ?found predicate
     ß ?process predicate
     ß ?env for results
ß Provide lang-spec implementation

25 Aug 2003       Lang-Indep Detection of OO DP   19
Parse Tree Traversal Layer
ß PTT: Specific layer in LiCoR
ß Recursively traverses parse trees
ß Called with:
     ß ?found predicate
     ß ?process predicate
     ß ?env for results
ß Provide lang-spec implementation

25 Aug 2003       Lang-Indep Detection of OO DP   20
Idioms
ß Lang specific naming and coding
  conventions

ß Accessor method name:
     ß Smalltalk: var name
     ß Java: ‘get’ + capitalized var name



25 Aug 2003       Lang-Indep Detection of OO DP   21
Pattern Detection
ß 4 patterns in 4 apps
              Smalltalk                              Java

              HotDraw                           Drawlets


      RefactoringBrowser                      JRefactory


25 Aug 2003          Lang-Indep Detection of OO DP          22
Best Practice Patterns
                        Double Dispatch

ß        One language-independent rule
ß        Two idiom rules
     ß        selfReference
     ß        varName

ß        HotDraw: 0, Drawlets:3
ß        RefactoringBrowser: 17, JRefactory 174
25 Aug 2003              Lang-Indep Detection of OO DP   23
Best Practice Patterns
                       Getting Method

ß        One language-independent rule
ß        Two idiom rules
     ß        methodSelector
     ß        gettingMethodName

ß        HotDraw: 35/75, Drawlets:33/270
ß        RBrowser: 125/531, JRefactory 134/721
25 Aug 2003             Lang-Indep Detection of OO DP   24
Design Patterns
                       Template Method

ß        Three language-independent rules
ß        Three idiom rules
     ß        abstractSelector, abstractMethod
     ß        selfReference

ß        HotDraw Fig: 3, Drawlets Fig: 42 (19 I)
ß        RBrowser: 43, JRefactory: 50
25 Aug 2003              Lang-Indep Detection of OO DP   25
Design Patterns
                       Template Method

ß        Three language-independent rules
ß        Three idiom rules
     ß        abstractSelector, abstractMethod
     ß        selfReference

              Takes care of interfaces in Java
ß        HotDraw Fig: 3, Drawlets Fig: 42 (19 I)
ß        RBrowser: 43, JRefactory: 50
25 Aug 2003              Lang-Indep Detection of OO DP   26
Design Patterns
                       Template Method

ß        Three language-independent rules
ß        Three idiom rules
     ß        abstractSelector, abstractMethod
     ß        selfReference

ß        HotDraw Fig: 3, Drawlets Fig: 42 (19 I)
ß        RBrowser: 43, JRefactory: 50
25 Aug 2003              Lang-Indep Detection of OO DP   27
Design Patterns
                                Visitor

ß        Two language-independent rules
     ß        Use double-dispatch rule
ß        Zero idiom rules


ß        HotDraw: 0, Drawlets: 0
ß        RBrowser: 14, JRefactory: 174
25 Aug 2003              Lang-Indep Detection of OO DP   28
Conclusion
ß        Feasible to reason about OO software in a
         language-independent way
ß        Soul to SoulJava
     ß        Source Code Repository (Parser & Storage)
     ß        Meta-level Interface (Implement API)
     ß        Parse tree & traversal (Convertor & Logic Rules)
     ß        Idiom layer (As Needed)
ß        Growth Idiom Layer < growth Detection
         layer

25 Aug 2003              Lang-Indep Detection of OO DP      29
Future Work
ß        More pattern detection rules
     ß        Easy / Tricky / Too language-specific
ß        New languages
     ß        Small impact on current language-indep rules
ß        New language versions
ß        Reasoning about Java Bytecodes
ß        Type inferencing
ß        Language-Independent code generation
     ß        From UML, pattern descriptions

25 Aug 2003              Lang-Indep Detection of OO DP       30
FAQ
ß      Static Typing vs Dynamic Typing
     ß        No Type Inferencing (Yet)
     ß        Types in var declarations: 1 idiom rule
ß      Interfaces
     ß        Not widely used in patterns: 1 idiom rule
ß      Accuracy of detection
     ß        No false positives, no false negatives
     ß        Similar limitations as other approaches

25 Aug 2003             Lang-Indep Detection of OO DP   31
LiCoR Structure




25 Aug 2003      Lang-Indep Detection of OO DP   32
public void getFoo(){
   if (foo == null)
    foo = factory.boot();
   return foo;}


public void getFoo() {
   foo = factory.boot(foo == null);
   return foo;}


25 Aug 2003   Lang-Indep Detection of OO DP   33

More Related Content

What's hot

Learning to Generate Pseudo-code from Source Code using Statistical Machine T...
Learning to Generate Pseudo-code from Source Code using Statistical Machine T...Learning to Generate Pseudo-code from Source Code using Statistical Machine T...
Learning to Generate Pseudo-code from Source Code using Statistical Machine T...Yusuke Oda
 
Cjb0912010 lz algorithms
Cjb0912010 lz algorithmsCjb0912010 lz algorithms
Cjb0912010 lz algorithmsRAJAN ST
 
Term Rewriting applied to Cryptographic Protocol Analysis: the Maude-NPA tool
Term Rewriting applied to Cryptographic Protocol Analysis: the Maude-NPA toolTerm Rewriting applied to Cryptographic Protocol Analysis: the Maude-NPA tool
Term Rewriting applied to Cryptographic Protocol Analysis: the Maude-NPA toolFacultad de Informática UCM
 
R & CDK: A Sturdy Platform in the Oceans of Chemical Data}
R & CDK: A Sturdy Platform in the Oceans of Chemical Data}R & CDK: A Sturdy Platform in the Oceans of Chemical Data}
R & CDK: A Sturdy Platform in the Oceans of Chemical Data}Rajarshi Guha
 
A First Analysis of String APIs: the Case of Pharo
A First Analysis of String APIs: the Case of PharoA First Analysis of String APIs: the Case of Pharo
A First Analysis of String APIs: the Case of PharoESUG
 
CodeJugalbandi-Expression-Problem-HealthyCode-Magazine#Jan-2015-Issue
CodeJugalbandi-Expression-Problem-HealthyCode-Magazine#Jan-2015-IssueCodeJugalbandi-Expression-Problem-HealthyCode-Magazine#Jan-2015-Issue
CodeJugalbandi-Expression-Problem-HealthyCode-Magazine#Jan-2015-IssueDhaval Dalal
 
Rechkov. Lomonosov Report
Rechkov. Lomonosov ReportRechkov. Lomonosov Report
Rechkov. Lomonosov ReportAnton Rechkov
 
Logic and Reasoning in the Semantic Web (part I –RDF/RDFS)
Logic and Reasoning in the Semantic Web (part I –RDF/RDFS)Logic and Reasoning in the Semantic Web (part I –RDF/RDFS)
Logic and Reasoning in the Semantic Web (part I –RDF/RDFS)Fulvio Corno
 
Chemistry Enabling Chinese, Japanese and Korean Patents
Chemistry Enabling Chinese, Japanese and Korean PatentsChemistry Enabling Chinese, Japanese and Korean Patents
Chemistry Enabling Chinese, Japanese and Korean PatentsNextMove Software
 
Neural Machine Translation via Binary Code Prediction
Neural Machine Translation via Binary Code PredictionNeural Machine Translation via Binary Code Prediction
Neural Machine Translation via Binary Code PredictionYusuke Oda
 
DZone%20-%20Essential%20Ruby
DZone%20-%20Essential%20RubyDZone%20-%20Essential%20Ruby
DZone%20-%20Essential%20Rubytutorialsruby
 
Expressive And Modular Predicate Dispatch In Java
Expressive And Modular Predicate Dispatch In JavaExpressive And Modular Predicate Dispatch In Java
Expressive And Modular Predicate Dispatch In JavaDr Anjan Krishnamurthy
 
Registration 3
Registration 3Registration 3
Registration 3ngaybuonte
 
Body-Part Nouns and Whole-Part Relations in Portuguese
Body-Part Nouns and Whole-Part Relations in PortugueseBody-Part Nouns and Whole-Part Relations in Portuguese
Body-Part Nouns and Whole-Part Relations in PortugueseJorge Baptista
 
ITU - MDD - Textural Languages and Grammars
ITU - MDD - Textural Languages and GrammarsITU - MDD - Textural Languages and Grammars
ITU - MDD - Textural Languages and GrammarsTonny Madsen
 
Pronominal Anaphora resolution
Pronominal Anaphora resolutionPronominal Anaphora resolution
Pronominal Anaphora resolutionDev Poudel
 

What's hot (16)

Learning to Generate Pseudo-code from Source Code using Statistical Machine T...
Learning to Generate Pseudo-code from Source Code using Statistical Machine T...Learning to Generate Pseudo-code from Source Code using Statistical Machine T...
Learning to Generate Pseudo-code from Source Code using Statistical Machine T...
 
Cjb0912010 lz algorithms
Cjb0912010 lz algorithmsCjb0912010 lz algorithms
Cjb0912010 lz algorithms
 
Term Rewriting applied to Cryptographic Protocol Analysis: the Maude-NPA tool
Term Rewriting applied to Cryptographic Protocol Analysis: the Maude-NPA toolTerm Rewriting applied to Cryptographic Protocol Analysis: the Maude-NPA tool
Term Rewriting applied to Cryptographic Protocol Analysis: the Maude-NPA tool
 
R & CDK: A Sturdy Platform in the Oceans of Chemical Data}
R & CDK: A Sturdy Platform in the Oceans of Chemical Data}R & CDK: A Sturdy Platform in the Oceans of Chemical Data}
R & CDK: A Sturdy Platform in the Oceans of Chemical Data}
 
A First Analysis of String APIs: the Case of Pharo
A First Analysis of String APIs: the Case of PharoA First Analysis of String APIs: the Case of Pharo
A First Analysis of String APIs: the Case of Pharo
 
CodeJugalbandi-Expression-Problem-HealthyCode-Magazine#Jan-2015-Issue
CodeJugalbandi-Expression-Problem-HealthyCode-Magazine#Jan-2015-IssueCodeJugalbandi-Expression-Problem-HealthyCode-Magazine#Jan-2015-Issue
CodeJugalbandi-Expression-Problem-HealthyCode-Magazine#Jan-2015-Issue
 
Rechkov. Lomonosov Report
Rechkov. Lomonosov ReportRechkov. Lomonosov Report
Rechkov. Lomonosov Report
 
Logic and Reasoning in the Semantic Web (part I –RDF/RDFS)
Logic and Reasoning in the Semantic Web (part I –RDF/RDFS)Logic and Reasoning in the Semantic Web (part I –RDF/RDFS)
Logic and Reasoning in the Semantic Web (part I –RDF/RDFS)
 
Chemistry Enabling Chinese, Japanese and Korean Patents
Chemistry Enabling Chinese, Japanese and Korean PatentsChemistry Enabling Chinese, Japanese and Korean Patents
Chemistry Enabling Chinese, Japanese and Korean Patents
 
Neural Machine Translation via Binary Code Prediction
Neural Machine Translation via Binary Code PredictionNeural Machine Translation via Binary Code Prediction
Neural Machine Translation via Binary Code Prediction
 
DZone%20-%20Essential%20Ruby
DZone%20-%20Essential%20RubyDZone%20-%20Essential%20Ruby
DZone%20-%20Essential%20Ruby
 
Expressive And Modular Predicate Dispatch In Java
Expressive And Modular Predicate Dispatch In JavaExpressive And Modular Predicate Dispatch In Java
Expressive And Modular Predicate Dispatch In Java
 
Registration 3
Registration 3Registration 3
Registration 3
 
Body-Part Nouns and Whole-Part Relations in Portuguese
Body-Part Nouns and Whole-Part Relations in PortugueseBody-Part Nouns and Whole-Part Relations in Portuguese
Body-Part Nouns and Whole-Part Relations in Portuguese
 
ITU - MDD - Textural Languages and Grammars
ITU - MDD - Textural Languages and GrammarsITU - MDD - Textural Languages and Grammars
ITU - MDD - Textural Languages and Grammars
 
Pronominal Anaphora resolution
Pronominal Anaphora resolutionPronominal Anaphora resolution
Pronominal Anaphora resolution
 

Viewers also liked

Runtime Tools
Runtime ToolsRuntime Tools
Runtime ToolsESUG
 
Umlx
UmlxUmlx
UmlxESUG
 
Induced Intentional Software Views
Induced Intentional Software ViewsInduced Intentional Software Views
Induced Intentional Software ViewsESUG
 
Real World Haskell: Lecture 7
Real World Haskell: Lecture 7Real World Haskell: Lecture 7
Real World Haskell: Lecture 7Bryan O'Sullivan
 
QSOUL/Aop
QSOUL/AopQSOUL/Aop
QSOUL/AopESUG
 
OpenPonk modeling platform
OpenPonk modeling platformOpenPonk modeling platform
OpenPonk modeling platformESUG
 
Pragmas: Literal Messages as Powerful Method Annotations
Pragmas: Literal Messages as Powerful Method AnnotationsPragmas: Literal Messages as Powerful Method Annotations
Pragmas: Literal Messages as Powerful Method AnnotationsESUG
 
New Native Windows UI possibilities in Cincom Smalltalk ObjectStudio
New Native Windows UI possibilities in Cincom Smalltalk ObjectStudioNew Native Windows UI possibilities in Cincom Smalltalk ObjectStudio
New Native Windows UI possibilities in Cincom Smalltalk ObjectStudioESUG
 
The Object Repository - Pulling Objects out of the Ecosystem
The Object Repository - Pulling Objects out of the EcosystemThe Object Repository - Pulling Objects out of the Ecosystem
The Object Repository - Pulling Objects out of the EcosystemESUG
 

Viewers also liked (9)

Runtime Tools
Runtime ToolsRuntime Tools
Runtime Tools
 
Umlx
UmlxUmlx
Umlx
 
Induced Intentional Software Views
Induced Intentional Software ViewsInduced Intentional Software Views
Induced Intentional Software Views
 
Real World Haskell: Lecture 7
Real World Haskell: Lecture 7Real World Haskell: Lecture 7
Real World Haskell: Lecture 7
 
QSOUL/Aop
QSOUL/AopQSOUL/Aop
QSOUL/Aop
 
OpenPonk modeling platform
OpenPonk modeling platformOpenPonk modeling platform
OpenPonk modeling platform
 
Pragmas: Literal Messages as Powerful Method Annotations
Pragmas: Literal Messages as Powerful Method AnnotationsPragmas: Literal Messages as Powerful Method Annotations
Pragmas: Literal Messages as Powerful Method Annotations
 
New Native Windows UI possibilities in Cincom Smalltalk ObjectStudio
New Native Windows UI possibilities in Cincom Smalltalk ObjectStudioNew Native Windows UI possibilities in Cincom Smalltalk ObjectStudio
New Native Windows UI possibilities in Cincom Smalltalk ObjectStudio
 
The Object Repository - Pulling Objects out of the Ecosystem
The Object Repository - Pulling Objects out of the EcosystemThe Object Repository - Pulling Objects out of the Ecosystem
The Object Repository - Pulling Objects out of the Ecosystem
 

Similar to Language-Independent Detection of Object-Oriented Design Patterns

Static analysis for perl
Static analysis for perlStatic analysis for perl
Static analysis for perlmoznion
 
Generating Assertion Code from OCL: A Transformational Approach Based on Simi...
Generating Assertion Code from OCL: A Transformational Approach Based on Simi...Generating Assertion Code from OCL: A Transformational Approach Based on Simi...
Generating Assertion Code from OCL: A Transformational Approach Based on Simi...Shinpei Hayashi
 
Core_Java_with_SCJP_OCJP_Notes_By_Durga.pdf
Core_Java_with_SCJP_OCJP_Notes_By_Durga.pdfCore_Java_with_SCJP_OCJP_Notes_By_Durga.pdf
Core_Java_with_SCJP_OCJP_Notes_By_Durga.pdfkmspega
 
Aiche 2008, Philadelphia
Aiche 2008, PhiladelphiaAiche 2008, Philadelphia
Aiche 2008, Philadelphiajshine
 
Enhancing Domain Specific Language Implementations Through Ontology
Enhancing Domain Specific Language Implementations Through OntologyEnhancing Domain Specific Language Implementations Through Ontology
Enhancing Domain Specific Language Implementations Through OntologyChunhua Liao
 
Variables: names, bindings, type, scope
Variables: names, bindings, type, scopeVariables: names, bindings, type, scope
Variables: names, bindings, type, scopesuthi
 
4 compiler lab - Syntax Ana
4 compiler lab - Syntax Ana4 compiler lab - Syntax Ana
4 compiler lab - Syntax AnaMashaelQ
 
Java 7 - New Features - by Mihail Stoynov and Svetlin Nakov
Java 7 - New Features - by Mihail Stoynov and Svetlin NakovJava 7 - New Features - by Mihail Stoynov and Svetlin Nakov
Java 7 - New Features - by Mihail Stoynov and Svetlin NakovSvetlin Nakov
 
Site visit presentation 2012 12 14
Site visit presentation 2012 12 14Site visit presentation 2012 12 14
Site visit presentation 2012 12 14Mitchell Wand
 
2015.09 - Guidance, Please! Towards a Framework for RDF-Based Constraint Lang...
2015.09 - Guidance, Please! Towards a Framework for RDF-Based Constraint Lang...2015.09 - Guidance, Please! Towards a Framework for RDF-Based Constraint Lang...
2015.09 - Guidance, Please! Towards a Framework for RDF-Based Constraint Lang...Dr.-Ing. Thomas Hartmann
 
【DL輪読会】Scaling Laws for Neural Language Models
【DL輪読会】Scaling Laws for Neural Language Models【DL輪読会】Scaling Laws for Neural Language Models
【DL輪読会】Scaling Laws for Neural Language ModelsDeep Learning JP
 
Summarization and Abstraction using deep learning
Summarization and Abstraction using deep learningSummarization and Abstraction using deep learning
Summarization and Abstraction using deep learningSK Reddy
 
PHP Development Tools 2.0 - Success Story
PHP Development Tools 2.0 - Success StoryPHP Development Tools 2.0 - Success Story
PHP Development Tools 2.0 - Success StoryMichael Spector
 
TypeProf for IDE: Enrich Development Experience without Annotations
TypeProf for IDE: Enrich Development Experience without AnnotationsTypeProf for IDE: Enrich Development Experience without Annotations
TypeProf for IDE: Enrich Development Experience without Annotationsmametter
 
How to create a programming language
How to create a programming languageHow to create a programming language
How to create a programming languageRobert Mamore
 
The features of java 11 vs. java 12
The features of  java 11 vs. java 12The features of  java 11 vs. java 12
The features of java 11 vs. java 12FarjanaAhmed3
 

Similar to Language-Independent Detection of Object-Oriented Design Patterns (20)

Static analysis for perl
Static analysis for perlStatic analysis for perl
Static analysis for perl
 
Generating Assertion Code from OCL: A Transformational Approach Based on Simi...
Generating Assertion Code from OCL: A Transformational Approach Based on Simi...Generating Assertion Code from OCL: A Transformational Approach Based on Simi...
Generating Assertion Code from OCL: A Transformational Approach Based on Simi...
 
Core_Java_with_SCJP_OCJP_Notes_By_Durga.pdf
Core_Java_with_SCJP_OCJP_Notes_By_Durga.pdfCore_Java_with_SCJP_OCJP_Notes_By_Durga.pdf
Core_Java_with_SCJP_OCJP_Notes_By_Durga.pdf
 
Aiche 2008, Philadelphia
Aiche 2008, PhiladelphiaAiche 2008, Philadelphia
Aiche 2008, Philadelphia
 
Enhancing Domain Specific Language Implementations Through Ontology
Enhancing Domain Specific Language Implementations Through OntologyEnhancing Domain Specific Language Implementations Through Ontology
Enhancing Domain Specific Language Implementations Through Ontology
 
Variables: names, bindings, type, scope
Variables: names, bindings, type, scopeVariables: names, bindings, type, scope
Variables: names, bindings, type, scope
 
4 compiler lab - Syntax Ana
4 compiler lab - Syntax Ana4 compiler lab - Syntax Ana
4 compiler lab - Syntax Ana
 
Java 7 - New Features - by Mihail Stoynov and Svetlin Nakov
Java 7 - New Features - by Mihail Stoynov and Svetlin NakovJava 7 - New Features - by Mihail Stoynov and Svetlin Nakov
Java 7 - New Features - by Mihail Stoynov and Svetlin Nakov
 
Site visit presentation 2012 12 14
Site visit presentation 2012 12 14Site visit presentation 2012 12 14
Site visit presentation 2012 12 14
 
2015.09 - Guidance, Please! Towards a Framework for RDF-Based Constraint Lang...
2015.09 - Guidance, Please! Towards a Framework for RDF-Based Constraint Lang...2015.09 - Guidance, Please! Towards a Framework for RDF-Based Constraint Lang...
2015.09 - Guidance, Please! Towards a Framework for RDF-Based Constraint Lang...
 
The NERD project
The NERD projectThe NERD project
The NERD project
 
【DL輪読会】Scaling Laws for Neural Language Models
【DL輪読会】Scaling Laws for Neural Language Models【DL輪読会】Scaling Laws for Neural Language Models
【DL輪読会】Scaling Laws for Neural Language Models
 
Summarization and Abstraction using deep learning
Summarization and Abstraction using deep learningSummarization and Abstraction using deep learning
Summarization and Abstraction using deep learning
 
PHP Development Tools 2.0 - Success Story
PHP Development Tools 2.0 - Success StoryPHP Development Tools 2.0 - Success Story
PHP Development Tools 2.0 - Success Story
 
TypeProf for IDE: Enrich Development Experience without Annotations
TypeProf for IDE: Enrich Development Experience without AnnotationsTypeProf for IDE: Enrich Development Experience without Annotations
TypeProf for IDE: Enrich Development Experience without Annotations
 
Practical NLP with Lisp
Practical NLP with LispPractical NLP with Lisp
Practical NLP with Lisp
 
20DCE096_prac1.pdf
20DCE096_prac1.pdf20DCE096_prac1.pdf
20DCE096_prac1.pdf
 
How to create a programming language
How to create a programming languageHow to create a programming language
How to create a programming language
 
Java 8 Lambda
Java 8 LambdaJava 8 Lambda
Java 8 Lambda
 
The features of java 11 vs. java 12
The features of  java 11 vs. java 12The features of  java 11 vs. java 12
The features of java 11 vs. java 12
 

More from ESUG

Workshop: Identifying concept inventories in agile programming
Workshop: Identifying concept inventories in agile programmingWorkshop: Identifying concept inventories in agile programming
Workshop: Identifying concept inventories in agile programmingESUG
 
Technical documentation support in Pharo
Technical documentation support in PharoTechnical documentation support in Pharo
Technical documentation support in PharoESUG
 
The Pharo Debugger and Debugging tools: Advances and Roadmap
The Pharo Debugger and Debugging tools: Advances and RoadmapThe Pharo Debugger and Debugging tools: Advances and Roadmap
The Pharo Debugger and Debugging tools: Advances and RoadmapESUG
 
Sequence: Pipeline modelling in Pharo
Sequence: Pipeline modelling in PharoSequence: Pipeline modelling in Pharo
Sequence: Pipeline modelling in PharoESUG
 
Migration process from monolithic to micro frontend architecture in mobile ap...
Migration process from monolithic to micro frontend architecture in mobile ap...Migration process from monolithic to micro frontend architecture in mobile ap...
Migration process from monolithic to micro frontend architecture in mobile ap...ESUG
 
Analyzing Dart Language with Pharo: Report and early results
Analyzing Dart Language with Pharo: Report and early resultsAnalyzing Dart Language with Pharo: Report and early results
Analyzing Dart Language with Pharo: Report and early resultsESUG
 
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6ESUG
 
A Unit Test Metamodel for Test Generation
A Unit Test Metamodel for Test GenerationA Unit Test Metamodel for Test Generation
A Unit Test Metamodel for Test GenerationESUG
 
Creating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic ProgrammingCreating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic ProgrammingESUG
 
Threaded-Execution and CPS Provide Smooth Switching Between Execution Modes
Threaded-Execution and CPS Provide Smooth Switching Between Execution ModesThreaded-Execution and CPS Provide Smooth Switching Between Execution Modes
Threaded-Execution and CPS Provide Smooth Switching Between Execution ModesESUG
 
Exploring GitHub Actions through EGAD: An Experience Report
Exploring GitHub Actions through EGAD: An Experience ReportExploring GitHub Actions through EGAD: An Experience Report
Exploring GitHub Actions through EGAD: An Experience ReportESUG
 
Pharo: a reflective language A first systematic analysis of reflective APIs
Pharo: a reflective language A first systematic analysis of reflective APIsPharo: a reflective language A first systematic analysis of reflective APIs
Pharo: a reflective language A first systematic analysis of reflective APIsESUG
 
Garbage Collector Tuning
Garbage Collector TuningGarbage Collector Tuning
Garbage Collector TuningESUG
 
Improving Performance Through Object Lifetime Profiling: the DataFrame Case
Improving Performance Through Object Lifetime Profiling: the DataFrame CaseImproving Performance Through Object Lifetime Profiling: the DataFrame Case
Improving Performance Through Object Lifetime Profiling: the DataFrame CaseESUG
 
Pharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and FuturePharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and FutureESUG
 
thisContext in the Debugger
thisContext in the DebuggerthisContext in the Debugger
thisContext in the DebuggerESUG
 
Websockets for Fencing Score
Websockets for Fencing ScoreWebsockets for Fencing Score
Websockets for Fencing ScoreESUG
 
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScriptShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScriptESUG
 
Advanced Object- Oriented Design Mooc
Advanced Object- Oriented Design MoocAdvanced Object- Oriented Design Mooc
Advanced Object- Oriented Design MoocESUG
 
A New Architecture Reconciling Refactorings and Transformations
A New Architecture Reconciling Refactorings and TransformationsA New Architecture Reconciling Refactorings and Transformations
A New Architecture Reconciling Refactorings and TransformationsESUG
 

More from ESUG (20)

Workshop: Identifying concept inventories in agile programming
Workshop: Identifying concept inventories in agile programmingWorkshop: Identifying concept inventories in agile programming
Workshop: Identifying concept inventories in agile programming
 
Technical documentation support in Pharo
Technical documentation support in PharoTechnical documentation support in Pharo
Technical documentation support in Pharo
 
The Pharo Debugger and Debugging tools: Advances and Roadmap
The Pharo Debugger and Debugging tools: Advances and RoadmapThe Pharo Debugger and Debugging tools: Advances and Roadmap
The Pharo Debugger and Debugging tools: Advances and Roadmap
 
Sequence: Pipeline modelling in Pharo
Sequence: Pipeline modelling in PharoSequence: Pipeline modelling in Pharo
Sequence: Pipeline modelling in Pharo
 
Migration process from monolithic to micro frontend architecture in mobile ap...
Migration process from monolithic to micro frontend architecture in mobile ap...Migration process from monolithic to micro frontend architecture in mobile ap...
Migration process from monolithic to micro frontend architecture in mobile ap...
 
Analyzing Dart Language with Pharo: Report and early results
Analyzing Dart Language with Pharo: Report and early resultsAnalyzing Dart Language with Pharo: Report and early results
Analyzing Dart Language with Pharo: Report and early results
 
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
 
A Unit Test Metamodel for Test Generation
A Unit Test Metamodel for Test GenerationA Unit Test Metamodel for Test Generation
A Unit Test Metamodel for Test Generation
 
Creating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic ProgrammingCreating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic Programming
 
Threaded-Execution and CPS Provide Smooth Switching Between Execution Modes
Threaded-Execution and CPS Provide Smooth Switching Between Execution ModesThreaded-Execution and CPS Provide Smooth Switching Between Execution Modes
Threaded-Execution and CPS Provide Smooth Switching Between Execution Modes
 
Exploring GitHub Actions through EGAD: An Experience Report
Exploring GitHub Actions through EGAD: An Experience ReportExploring GitHub Actions through EGAD: An Experience Report
Exploring GitHub Actions through EGAD: An Experience Report
 
Pharo: a reflective language A first systematic analysis of reflective APIs
Pharo: a reflective language A first systematic analysis of reflective APIsPharo: a reflective language A first systematic analysis of reflective APIs
Pharo: a reflective language A first systematic analysis of reflective APIs
 
Garbage Collector Tuning
Garbage Collector TuningGarbage Collector Tuning
Garbage Collector Tuning
 
Improving Performance Through Object Lifetime Profiling: the DataFrame Case
Improving Performance Through Object Lifetime Profiling: the DataFrame CaseImproving Performance Through Object Lifetime Profiling: the DataFrame Case
Improving Performance Through Object Lifetime Profiling: the DataFrame Case
 
Pharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and FuturePharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and Future
 
thisContext in the Debugger
thisContext in the DebuggerthisContext in the Debugger
thisContext in the Debugger
 
Websockets for Fencing Score
Websockets for Fencing ScoreWebsockets for Fencing Score
Websockets for Fencing Score
 
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScriptShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
 
Advanced Object- Oriented Design Mooc
Advanced Object- Oriented Design MoocAdvanced Object- Oriented Design Mooc
Advanced Object- Oriented Design Mooc
 
A New Architecture Reconciling Refactorings and Transformations
A New Architecture Reconciling Refactorings and TransformationsA New Architecture Reconciling Refactorings and Transformations
A New Architecture Reconciling Refactorings and Transformations
 

Recently uploaded

"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 

Recently uploaded (20)

"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 

Language-Independent Detection of Object-Oriented Design Patterns

  • 1. Language-Independent Detection of Object-Oriented Design Patterns Johan Fabry Vrije Universiteit Brussel, Programming Technology Lab johan.fabry@vub.ac.be 25 Aug 2003 Lang-Indep Detection of OO DP 1
  • 2. Overview ß Research Goal ß DMP and Soul ß Soul to SoulJava ß Base-Level Reification ß Design Pattern Detection ß Conclusion & Future Work 25 Aug 2003 Lang-Indep Detection of OO DP 2
  • 3. Research Goal ß Language-agnostic reasoning about OO programs ß Validate research in different OO - languages ß Soul: Reasoning about Smalltalk (coding conventions, DP, bad smells, …) ß Clear separation language indep / dep ß Validation: ST + Java detect BPP, DP 25 Aug 2003 Lang-Indep Detection of OO DP 3
  • 4. DMP and Soul ß DMP: ß Declarative language at meta-level ß OO language at base level ß Meta-level programs reason about structure of base-level ß Soul: ß Meta-level prolog-like programming language ß Smalltalk code can be embedded in prolog code 25 Aug 2003 Lang-Indep Detection of OO DP 4
  • 5. Soul Layering ‘Uses’ Layering: Inference Code LiCoR MLI Engine Repository 25 Aug 2003 Lang-Indep Detection of OO DP 5
  • 6. Inference engine ß Logic query with a variable: If class(?x) Inference Code LiCoR MLI Engine Repository 25 Aug 2003 Lang-Indep Detection of OO DP 6
  • 7. LiCoR ß Appropriate rule is triggered: class(?c) if variable(?c), generate(?c,[ExplicitMLI current allClasses)]) Inference Code LiCoR MLI Engine Repository 25 Aug 2003 Lang-Indep Detection of OO DP 7
  • 8. Meta Level Interface ß Link to the base-level: allClasses ^Smalltalk allClasses Inference Code LiCoR MLI Engine Repository 25 Aug 2003 Lang-Indep Detection of OO DP 8
  • 9. Code Repository ß Investigate the code: allClasses … Inference Code LiCoR MLI Engine Repository 25 Aug 2003 Lang-Indep Detection of OO DP 9
  • 10. Soul to SoulJava We discuss changes in inverse order. Inference Code LicoR MLI Engine Repository 25 Aug 2003 Lang-Indep Detection of OO DP 10
  • 11. Java Code Repository ß Use Frost to parse Java Code ß Assume correct java code ! ß Java 1.0 (+epsilon) parser ß Java Code = parse trees ß .java ‘File in’ in File Browser ß Java Code Browser 25 Aug 2003 Lang-Indep Detection of OO DP 11
  • 12. Java Code Browser 25 Aug 2003 Lang-Indep Detection of OO DP 12
  • 13. MLI For Java ß Uses Java Code Repository ß Implements ß all methods of ST MLI ß methods for interface support 25 Aug 2003 Lang-Indep Detection of OO DP 13
  • 14. Base-Level Reification ß Namespace [name|super|sub|classes] ß ->Through MLI ß Class [name|super|sub|ns|methods|iv] ß ->Through MLI ß InstVar [name|inClass|type] ß ->Through MLI ß Method [name|arglist] ß ->Through MLI 25 Aug 2003 Lang-Indep Detection of OO DP 14
  • 15. Method Body Reification ß Method bodies = logic parse tree form ß Smalltalk: count set: 0 = send(variable([#count])),[#set:],<[0]>) ß Java: count.set(0) = send(variable([#count])),[#set],<[0]>) ß Allows for easy verification: isMessageSend(send(?receiver, ?message,?arguments)) 25 Aug 2003 Lang-Indep Detection of OO DP 15
  • 16. Method Body Reification ß But Java has more PT elements! ß if-then-else, while, for, … ß Introduce new logic functor for each ß Logic Java Parse trees have different form! ß No transformation to ‘ST-compatible’ form ß Logic PT as similar as possible to Java code ß Needed for later work: Java PT manipulations ß Users of parse tree must take this into account 25 Aug 2003 Lang-Indep Detection of OO DP 16
  • 17. Parse Tree Traversal Layer ß PTT: Specific layer in LiCoR ß Recursively traverses parse trees ß Called with: ß ?found predicate ß ?process predicate ß ?env for results ß Provide lang-spec implementation 25 Aug 2003 Lang-Indep Detection of OO DP 17
  • 18. Parse Tree Traversal Layer ß PTT: Specific layer in LiCoR ß RecursivelyisMessageSend trees traverses parse ß Called with: ß ?found predicate ß ?process predicate ß ?env for results ß Provide lang-spec implementation 25 Aug 2003 Lang-Indep Detection of OO DP 18
  • 19. Parse Tree Traversal Layer ß PTT: messageSendMessage( Specific layer in LiCoR ß Recursively traverses parse trees send(?rec,?msg,?args), ?args) ß Called with: ß ?found predicate ß ?process predicate ß ?env for results ß Provide lang-spec implementation 25 Aug 2003 Lang-Indep Detection of OO DP 19
  • 20. Parse Tree Traversal Layer ß PTT: Specific layer in LiCoR ß Recursively traverses parse trees ß Called with: ß ?found predicate ß ?process predicate ß ?env for results ß Provide lang-spec implementation 25 Aug 2003 Lang-Indep Detection of OO DP 20
  • 21. Idioms ß Lang specific naming and coding conventions ß Accessor method name: ß Smalltalk: var name ß Java: ‘get’ + capitalized var name 25 Aug 2003 Lang-Indep Detection of OO DP 21
  • 22. Pattern Detection ß 4 patterns in 4 apps Smalltalk Java HotDraw Drawlets RefactoringBrowser JRefactory 25 Aug 2003 Lang-Indep Detection of OO DP 22
  • 23. Best Practice Patterns Double Dispatch ß One language-independent rule ß Two idiom rules ß selfReference ß varName ß HotDraw: 0, Drawlets:3 ß RefactoringBrowser: 17, JRefactory 174 25 Aug 2003 Lang-Indep Detection of OO DP 23
  • 24. Best Practice Patterns Getting Method ß One language-independent rule ß Two idiom rules ß methodSelector ß gettingMethodName ß HotDraw: 35/75, Drawlets:33/270 ß RBrowser: 125/531, JRefactory 134/721 25 Aug 2003 Lang-Indep Detection of OO DP 24
  • 25. Design Patterns Template Method ß Three language-independent rules ß Three idiom rules ß abstractSelector, abstractMethod ß selfReference ß HotDraw Fig: 3, Drawlets Fig: 42 (19 I) ß RBrowser: 43, JRefactory: 50 25 Aug 2003 Lang-Indep Detection of OO DP 25
  • 26. Design Patterns Template Method ß Three language-independent rules ß Three idiom rules ß abstractSelector, abstractMethod ß selfReference Takes care of interfaces in Java ß HotDraw Fig: 3, Drawlets Fig: 42 (19 I) ß RBrowser: 43, JRefactory: 50 25 Aug 2003 Lang-Indep Detection of OO DP 26
  • 27. Design Patterns Template Method ß Three language-independent rules ß Three idiom rules ß abstractSelector, abstractMethod ß selfReference ß HotDraw Fig: 3, Drawlets Fig: 42 (19 I) ß RBrowser: 43, JRefactory: 50 25 Aug 2003 Lang-Indep Detection of OO DP 27
  • 28. Design Patterns Visitor ß Two language-independent rules ß Use double-dispatch rule ß Zero idiom rules ß HotDraw: 0, Drawlets: 0 ß RBrowser: 14, JRefactory: 174 25 Aug 2003 Lang-Indep Detection of OO DP 28
  • 29. Conclusion ß Feasible to reason about OO software in a language-independent way ß Soul to SoulJava ß Source Code Repository (Parser & Storage) ß Meta-level Interface (Implement API) ß Parse tree & traversal (Convertor & Logic Rules) ß Idiom layer (As Needed) ß Growth Idiom Layer < growth Detection layer 25 Aug 2003 Lang-Indep Detection of OO DP 29
  • 30. Future Work ß More pattern detection rules ß Easy / Tricky / Too language-specific ß New languages ß Small impact on current language-indep rules ß New language versions ß Reasoning about Java Bytecodes ß Type inferencing ß Language-Independent code generation ß From UML, pattern descriptions 25 Aug 2003 Lang-Indep Detection of OO DP 30
  • 31. FAQ ß Static Typing vs Dynamic Typing ß No Type Inferencing (Yet) ß Types in var declarations: 1 idiom rule ß Interfaces ß Not widely used in patterns: 1 idiom rule ß Accuracy of detection ß No false positives, no false negatives ß Similar limitations as other approaches 25 Aug 2003 Lang-Indep Detection of OO DP 31
  • 32. LiCoR Structure 25 Aug 2003 Lang-Indep Detection of OO DP 32
  • 33. public void getFoo(){ if (foo == null) foo = factory.boot(); return foo;} public void getFoo() { foo = factory.boot(foo == null); return foo;} 25 Aug 2003 Lang-Indep Detection of OO DP 33