SlideShare uma empresa Scribd logo
1 de 69
Baixar para ler offline
Ptidej Tool Suite
Yann-Gaël Guéhéneuc
yann-gael.gueheneuc@polytmtl.ca
Presentation in Sukyoung Ruy’s group
KAIST
2013/06/07

Département de génie informatique et de génie logiciel

This work is licensed under a Creative
Commons Attribution-NonCommercialShareAlike 3.0 Unported License
Patterns
Patterns document reusable solutions to
recurring problems
– Architecture
• Architectural styles

– Design
• Design patterns
• Design anti-patterns

– Implementation
• Idioms
2/69
Patterns
Several books, articles
– “Theoretical”
– With examples
– Among others…

3/69
Patterns
Several books, articles
– “Theoretical”
– With examples
– Among others…

4/69
Patterns
Several books, articles
– “Theoretical”
– With examples
– Among others…

5/69
Patterns
Several books, articles
– “Theoretical”
– With examples
– Among others…

6/69
Patterns
Several books, articles
– “Theoretical”
– With examples
– Among others…

7/69
Patterns
Several books, articles
– “Theoretical”
– With examples
– Among others…

8/69
Patterns
“[E]xisting books on design patterns take a
catalog approach, where they show the
individual design patterns in isolation. This
approach is […] flawed, because you can't see
how the design patterns actually function in the
real world. Most programmers learn by looking
at computer programs.”
—Allen Holub in Holub on Patterns: Learning
Design Patterns by Looking at Code

9/69
Outline
Patterns
Ptidej Tool Suite

10/69
Outline
Patterns
Ptidej Tool Suite

11/69
Patterns
Several books, articles
– Amazon.com
• Books › Computers & Technology › Programming ›
Software Design, Testing & Engineering › ObjectOriented Design › "patterns"
• 224 results on May 31, 2013

12/69
Patterns
Several books, articles
– Amazon.com
• Exclusion
– Unreleased books
– Specific to a technology or frameworks
» e.g., MVVM Unleashed by Michael Brown
– Process oriented, user-interface, programming languages
» e.g., Process Patterns: Building Large-Scale Systems
Using Object Technology by Scott W. Ambler and
Barbara Hanscome
– Proceedings of conferences
– Unrelated to software engineering
13/69
Patterns
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.

Pattern-Oriented Software Architecture, Patterns for Concurrent and Networked Objects: Volume 2 (Wiley Software...
by Douglas C. Schmidt, Michael Stal, Hans Rohnert and Frank Buschmann
Pattern-Oriented Software Architecture, Patterns for Resource Management: Volume 3 (Wiley Software Patterns
Series... by Michael Kircher and Prashant Jain
Pattern-Oriented Software Architecture, A System of Patterns: Volume 1 (Wiley Software Patterns Series) by Frank
Buschmann, Regine Meunier, Hans Rohnert and Peter Sommerlad
Pattern-Oriented Software Architecture For Dummies (For Dummies (Computers)) by Robert Hanmer
Web Security Patterns by Ramesh Nagappan and Christopher Steel
Safe C++ by Vladimir Kushnir
Programming in the Large with Design Patterns by Eddie Burris
Elemental Design Patterns by Jason McC. Smith
Java Application Architecture: Modularity Patterns with Examples Using OSGi (Robert C. Martin Series) by Kirk
Knoernschild
Enterprise Integration Patterns: Designing, Building, and Deploying Messaging Solutions (Addison-Wesley
Signature... by Gregor Hohpe and Bobby Woolf
Patterns of Enterprise Application Architecture (Addison-Wesley Signature Series (Fowler)) by Martin Fowler
Cognitive Patterns: Problem-Solving Frameworks for Object Technology by Robert K Konitzer, Bobbin Teegarden,
Alexander Rush and Karen M Gardner
Service Design Patterns: Fundamental Design Solutions for SOAP/WSDL and RESTful Web Services by Robert
Daigneau
The ACE Programmer's Guide: Practical Design Patterns for Network and Systems Programming by Stephen D.
Huston, James CE Johnson and Umar Syyid
Patterns for Parallel Software Design (Wiley Software Patterns Series) by Jorge Luis Ortega-Arjona
Design Patterns in Object-oriented ABAP by Igor Barbaric
Object-Oriented Reengineering Patterns by Oscar Nierstrasz, Stéphane Ducasse and Serge Demeyer
Dependency Injection by Dhanji R. Prasanna
Object-Oriented Software Engineering Using UML, Patterns, and Java (3rd Edition) by Bernd Bruegge and Allen H.
Dutoit
J2EE Design Patterns by William Crawford and Jonathan Kaplan
Applying UML and Patterns: An Introduction to Object-oriented Analysis and Design and Iterative Development by
Craig Larman
Object-oriented Analysis and Design Using Umlan Introduction to Unified Process and Design Patterns by Mahesh P.
Matha
C++ Design Patterns and Derivatives Pricing (Mathematics, Finance and Risk) by M. S. Joshi
Effective Java (2nd Edition) by Joshua Bloch
Patterns for Fault Tolerant Software (Wiley Software Patterns Series) by Robert Hanmer
Implementation Patterns by Kent Beck
Patterns for Computer-Mediated Interaction (Wiley Software Patterns Series) by Till Schummer and Stephan Lukosch
Pattern Oriented Software Architecture Volume 5: On Patterns and Pattern Languages by Frank Buschmann, Kevlin
Henney and Douglas C. Schmidt
Object-Oriented Analysis and Design with Applications (3rd Edition) by Grady Booch, Robert A. Maksimchuk, Michael
W. Engle and Bobbi J. Young
Head First Object-Oriented Analysis and Design by Brett D. McLaughlin, Gary Pollice and Dave West
Agile Principles, Patterns, and Practices in C# by Robert C. Martin and Micah Martin
Design Patterns For Dummies by Steve Holzner
Pattern Languages of Program Design 5 by Dragos Manolescu, Markus Voelter and James Noble
Design Patterns in Java(TM) (Software Patterns Series) by Steven John Metsker and William C. Wake
Object-Oriented Design and Patterns by Cay S. Horstmann

37.
38.
39.
40.
41.
42.
43.
44.
45.
46.
47.
48.
49.
50.
51.
52.
53.
54.
55.
56.
57.
58.
59.
60.
61.
62.
63.
64.
65.
66.
67.
68.
69.
70.
71.
72.

Object-Oriented Modeling and Design with UML (2nd Edition) by Michael R. Blaha and James R Rumbaugh
Remoting Patterns: Foundations of Enterprise, Internet and Realtime Distributed Object Middleware (Wiley
Software... by Markus Völter, Michael Kircher and Uwe Zdun
Software Factories: Assembling Applications with Patterns, Models, Frameworks, and Tools (Wiley Application
Development... by Jack Greenfield, Keith Short, Steve Cook and Stuart Kent
Refactoring to Patterns by Joshua Kerievsky
Architecting Enterprise Solutions: Patterns for High-Capability Internet-based Systems (Wiley Software Patterns...
by Paul Dyson and Andrew Longshaw
Enterprise Patterns and MDA: Building Better Software with Archetype Patterns and UML by Jim Arlow and Ila
Neustadt
Data Access Patterns: Database Interactions in Object-Oriented Applications by Clifton Nock
Domain-Driven Design: Tackling Complexity in the Heart of Software by Eric Evans
Pattern-Oriented Analysis and Design: Composing Patterns to Design Software Systems by Sherif M. Yacoub,
Hany H. Ammar, Sherif Yacoub and Hany Ammar
Java Extreme Programming Cookbook by Eric M. Burke and Brian M. Coyner
J2EE Best Practices: Java Design Patterns, Automation, and Performance (Wiley Application Development
Series) by Darren Broemmer
Real-Time Design Patterns: Robust Scalable Architecture for Real-Time Systems by Bruce Powel Douglass
Design Patterns Java¿ Workbook by Steven John Metsker
EJB Design Patterns: Advanced Patterns, Processes, and Idioms by Floyd Marinescu
Streamlined Object Modeling: Patterns, Rules, and Implementation by Jill Nicola, Mark Mayfield and Mike Abney
Design Patterns Explained: A New Perspective on Object-Oriented Design by Alan Shalloway and James Trott
Small Memory Software: Patterns for systems with limited memory (Software Patterns Series) by James Noble
and Charles Weir
AntiPatterns in Project Management by William J. Brown, Hays W. "Skip" McCormick III and Scott W. Thomas
Pattern Languages of Program Design 4 (Software Patterns Series) by Brian Foote, Neil Harrison and Hans
Rohnert
Testing Object-Oriented Systems: Models, Patterns, and Tools by Robert V. Binder
Design Patterns and Contracts by Jean-Marc Jezequel, Michel Train and Christine Mingins
Object-Oriented Software Development Using Java: Principles, Patterns, and Frameworks (1/e) by Xiaoping Jia
Refactoring: Improving the Design of Existing Code by Martin Fowler, Kent Beck, John Brant and William Opdyke
More Process Patterns: Delivering Large-Scale Systems Using Object Technology (SIGS: Managing Object
Technology... by Scott W. Ambler
Pattern Hatching: Design Patterns Applied by John Vlissides
AntiPatterns: Refactoring Software, Architectures, and Projects in Crisis by William J. Brown, Raphael C. Malveau,
Hays W. "Skip" McCormick and Thomas J. Mowbray
A Little Java, A Few Patterns (Language, Speech, & Communication) by Matthias Felleisen, Daniel P. Friedman
and Ralph E. Johnson
Pattern Languages of Program Design 3 (v. 3) by Robert C. Martin, Dirk Riehle and Frank Buschmann
Object Models: Strategies, Patterns, and Applications (2nd Edition) by Peter Coad, David North and Mark Mayfield
Analysis Patterns: Reusable Object Models by Martin Fowler
Patterns of Software: Tales from the Software Community by Richard P. Gabriel
Pattern Languages of Program Design 2 (v. 2) by John Vlissides, James O. Coplien and Norman L. Kerth
Software Patterns by James Coplien
Software Architecture: Perspectives on an Emerging Discipline by Mary Shaw and David Garlan
Adaptive Object-Oriented Software: The Demeter Method with Propagation Patterns: The Demeter Method with
Propagation... by Karl Lieberherr
Pattern Languages of Program Design by James O. Coplien and Douglas C. Schmidt

14/69
Patterns
The following is not a substitute to reading
previous books and practicing
The following is complementary to reading
books and practicing
– These patterns that have been “found” the hard
way and that work (or do not work!)

15/69
Patterns
The following is not a substitute to reading
these books and practicing
The following is complementary to reading
books and practicing
– These patterns that have been “found” the hard
way and that work (or do not work!)

16/69
Patterns
General form as for the GoF , also inspired
by Coplien’s form
– Name
– Problem(s)
– Solution
– Consequences

17/69
Patterns
General form as for the GoF, also inspired
by Coplien’s form
– Name
– Problem(s)
– Example(s)
– Solution
– Example(s)
– Consequences
– (Follow-up)

18/69
Patterns
General form as for the GoF, also inspired
by Coplien’s form
– Name
– Problem(s)
– Example(s)
– Solution
– Example(s)
– Consequences
– (Follow-up)

Problem:
Solution:

19/69
Patterns
General form as for the GoF, also inspired
by Coplien’s form
– Not formal
– Room for interpretation
– But…
• UML-like class diagrams
• UML-like sequence diagrams
• Smalltalk / C++ example code
20/69
Outline
Patterns
Ptidej Tool Suite

21/69
Ptidej Tool Suite
Context
– Research work started since my Ph.D. thesis
(2000–2003)
– Pattern Trace Identification, Detection, and
Enhancement in Java
• Theories, methods, and tools, to evaluate and to
improve the quality of object-oriented programs by
promoting the use of idioms, design patterns, and
architectural patterns
22/69
Ptidej Tool Suite
Requirements
– Software tools
• Support the analysis of the implementation, design,
and architecture of object-oriented programs
• Support the detection and introduction of patterns at
the code, design, and architectural levels

23/69
Ptidej Tool Suite
Analysis
– Domain concepts
• “quality of object-oriented”
• “promoting the use of idioms, design patterns, and
architectural patterns”
• “analysis of the implementation, design, and
architecture of object-oriented programs”
• “detection and introduction of patterns at the code,
design, and architectural levels”
24/69
Ptidej Tool Suite
Analysis
– Domain concepts
• “quality of object-oriented”
• “promoting the use of idioms, design patterns, and
architectural patterns”
• “analysis of the implementation, design, and
architecture of object-oriented programs”
• “detection and introduction of patterns at the code,
design, and architectural levels”
25/69
Ptidej Tool Suite
Constraint
– Apply patterns/best practices (existing or new)
when developing the tools
• Architectural
• Design
• Implementation

– Self-imposed but sensible
• “Eating your own dog food”
(http://www.urbandictionary.com/define.php?
term=eating%20your%20own%20dog%20food)

26/69
Ptidej Tool Suite
Related work
– Various parsers (target languages)
e.g., GCCXML

– Various meta-model (sometimes implicit)
•
•
•
•

Similar to UML meta-model (1997)
Before OMG KDM (2003)
Before Eclipse EMF (2004)
Before OMG MOF (2006)

– Various tools
e.g., Rigi (H. M. Kienle and H. A. Müller: Rigi – An environment
for software reverse engineering, exploration, visualization, and
redocumentation. Sci. Comput. Program. 75(4): 247-263, 2010)

27/69
Ptidej Tool Suite
Related work
↑ Existing ☺
↓ Too low-level
e.g., GCCXML

↓ No “free” parsers
e.g., UML meta-model

↓ Difficult to access / to use / to adapt
e.g., Rigi
28/69
Ptidej Tool Suite
Related work
– Pierre Cointe’s team in 2000 at École des Mines
de Nantes, France
– Fertile ground
• Hervé Albin-Amiot was already developing a metamodel to describe design patterns
– “Idioms and patterns Java: application to code synthesis and
detection” (Ph.D. in 2003)
– PDL (Pattern Description Language)

29/69
Ptidej Tool Suite
What to detect?

In what to
detect it?

How to
express it?
30/69
Ptidej Tool Suite

“Great software is not built, it is grown”
—Bill de hÓra in 97 Things Every
Software Architect Should Know

31/69
Ptidej Tool Suite
Design Patterns

Models of
OO programs

PDL metamodel
32/69
Ptidej Tool Suite

PDL meta-model

33/69
Ptidej Tool Suite

+

PDL meta-model
Models of OO programs

34/69
Ptidej Tool Suite

+
=

PDL meta-model
Models of OO programs
PADL meta-model

35/69
Ptidej Tool Suite

PADL
Pattern and Abstract-level Description Language

36/69
Ptidej Tool Suite

PADL Creators
C++, C#, Java, JavaScript?
PADL
Pattern and Abstract-level Description Language

37/69
Ptidej Tool Suite

PADL Analyses
• Binary Class Relationships
• Systematic UML
PADL Creators
C++, C#, Java, JavaScript?
PADL
Pattern and Abstract-level Description Language

38/69
Ptidej Tool Suite

PADL Generators
XMI…
PADL Analyses
• Binary Class Relationships
• Systematic UML
PADL Creators
C++, C#, Java, JavaScript?
PADL
Pattern and Abstract-level Description Language

39/69
Ptidej Tool Suite

PADL Generators
XMI…
PADL Analyses
• Binary Class Relationships
• Systematic UML
PADL Creators
C++, C#, Java, JavaScript?

PADL Serialisers
DB4O, JOS…

PADL
Pattern and Abstract-level Description Language

40/69
Ptidej Tool Suite

PADL Generators
XMI…
PADL Analyses
• Binary Class Relationships
• Systematic UML

PADL Design Motifs
Anti-patterns, code smells, and µ-patterns

PADL Creators
C++, C#, Java, JavaScript?

PADL Serialisers
DB4O, JOS…

PADL
Pattern and Abstract-level Description Language

41/69
Ptidej Tool Suite

PADL Generators
XMI…

POM
Primitives, Operations, Metrics

PADL Analyses
• Binary Class Relationships
• Systematic UML

PADL Design Motifs
Anti-patterns, code smells, and µ-patterns

PADL Creators
C++, C#, Java, JavaScript?

PADL Serialisers
DB4O, JOS…

PADL
Pattern and Abstract-level Description Language

42/69
Ptidej Tool Suite
(Ptidej Solver)
Identification of design motifs
PADL Generators
XMI…

POM
Primitives, Operations, Metrics

PADL Analyses
• Binary Class Relationships
• Systematic UML

PADL Design Motifs
Anti-patterns, code smells, and µ-patterns

PADL Creators
C++, C#, Java, JavaScript?

PADL Serialisers
DB4O, JOS…

PADL
Pattern and Abstract-level Description Language

43/69
Ptidej Tool Suite
(Ptidej Solver)
Identification of design motifs

SAD
Identification of anti-patterns

PADL Generators
XMI…

POM
Primitives, Operations, Metrics

PADL Analyses
• Binary Class Relationships
• Systematic UML

PADL Design Motifs
Anti-patterns, code smells, and µ-patterns

PADL Creators
C++, C#, Java, JavaScript?

PADL Serialisers
DB4O, JOS…

PADL
Pattern and Abstract-level Description Language

44/69
Ptidej Tool Suite
Ptidej UI
User interface (using reflection)
(Ptidej Solver)
Identification of design motifs

SAD
Identification of anti-patterns

PADL Generators
XMI…

POM
Primitives, Operations, Metrics

PADL Analyses
• Binary Class Relationships
• Systematic UML

PADL Design Motifs
Anti-patterns, code smells, and µ-patterns

PADL Creators
C++, C#, Java, JavaScript?

PADL Serialisers
DB4O, JOS…

PADL
Pattern and Abstract-level Description Language

45/69
Ptidej UI Viewer Standalone Swing displaying PADL
(Another example of “Eating your own dog food” ☺)

46/69
PADL Kernel, main interfaces provided to the users
(SVG and JPG from Ptidej UI Viewer Standalone Swing)

47/69
PADL Kernel, abstract-level models
Describe models of programs, including design motifs

48/69
PADL Kernel, elements
Describe methods, fields…

49/69
PADL Kernel, entities
Describe classes, interfaces…

50/69
PADL Kernel, relationships
Describe inheritances, associations…

51/69
Ptidej Tool Suite
Advantages
– Creators
– BCRs
– Extensibility
– Reliability
(Has been used in many studies)

52/69
Ptidej Tool Suite
Advantages
– Available! ☺
• https://web.soccerlab.polymtl.ca/rptidej/ptidejlab/
Software/Ptidej 5 Workspace
• Username: guestsvn
• Password: g1u2e3s4t5

– See also
• http://www.ptidej.net/material/inanutshell
• http://www.ptidej.net/material/development/
• http://wiki.ptidej.net/doku.php

53/69
Ptidej Tool Suite
Advantages
– Extensible
e.g., C++ creator provide new/modified constituent

• Factory design pattern
• Builder design pattern
– Including for the user interface

54/69
Ptidej Tool Suite
Limits
– Coarse representation
of method statements

– Unsatisfactory support of non-typed, non-objectoriented programming languages
• (Very) partial support for Smalltalk
55/69
Ptidej Tool Suite
Performance
– Eclipse v3.1
– Google Chrome v1.0.154.53
• Quality of the model under tests

56/69
Ptidej Tool Suite
Academic Usage
– Dozen of empirical studies
e.g., S. Kpodjedo, F. Ricca, P. Galinier, G. Antoniol,
and Y.-G. Guéhéneuc. MADMatch: Many-to-many
Approximate Diagram Matching for Design
Comparison. IEEE TSE, Feburary 2013

– Please see
• http://www.ptidej.net/publications/
57/69
Ptidej Tool Suite
Concrete Usage
– Build a model from some C++ code (1/2)
public static IIdiomLevelModel generateModelFromCppFilesUsingEclipse(
final String aName,
final String aSourceDirectory,
final IModelListener aModelListener) {
ICodeLevelModel codeLevelModel = null;
try {
final ICodeLevelModelCreator creator =
new padl.creator.cppfile.eclipse.CppCreator(aSourceDirectory);
codeLevelModel =
CPPFactoryEclipse.getInstance().createCodeLevelModel(aName);
if (aModelListener != null) {
codeLevelModel.addModelListener(aModelListener);
}
codeLevelModel.create(creator);
}
catch (final CreationException e) {
e.printStackTrace(ProxyConsole.getInstance().errorOutput());
}
...

58/69
Specialised creator

Ptidej Tool Suite
Concrete Usage
– Build a model from some C++ code (1/2)
public static IIdiomLevelModel generateModelFromCppFilesUsingEclipse(
final String aName,
final String aSourceDirectory,
final IModelListener aModelListener) {
ICodeLevelModel codeLevelModel = null;
try {
final ICodeLevelModelCreator creator =
new padl.creator.cppfile.eclipse.CppCreator(aSourceDirectory);
codeLevelModel =
CPPFactoryEclipse.getInstance().createCodeLevelModel(aName);
if (aModelListener != null) {
codeLevelModel.addModelListener(aModelListener);
}
codeLevelModel.create(creator);
}
catch (final CreationException e) {
e.printStackTrace(ProxyConsole.getInstance().errorOutput());
}
...

59/69
Specialised creator

Ptidej Tool Suite
Concrete Usage

Specialised factory to
allow new constituents

– Build a model from some C++ code (1/2)
public static IIdiomLevelModel generateModelFromCppFilesUsingEclipse(
final String aName,
final String aSourceDirectory,
final IModelListener aModelListener) {
ICodeLevelModel codeLevelModel = null;
try {
final ICodeLevelModelCreator creator =
new padl.creator.cppfile.eclipse.CppCreator(aSourceDirectory);
codeLevelModel =
CPPFactoryEclipse.getInstance().createCodeLevelModel(aName);
if (aModelListener != null) {
codeLevelModel.addModelListener(aModelListener);
}
codeLevelModel.create(creator);
}
catch (final CreationException e) {
e.printStackTrace(ProxyConsole.getInstance().errorOutput());
}
...

60/69
Specialised creator

Ptidej Tool Suite
Concrete Usage

Specialised factory to
allow new constituents
Builder design pattern

– Build a model from some C++ code (1/2)
public static IIdiomLevelModel generateModelFromCppFilesUsingEclipse(
final String aName,
final String aSourceDirectory,
final IModelListener aModelListener) {

ICodeLevelModel codeLevelModel = null;
try {
final ICodeLevelModelCreator creator =
new padl.creator.cppfile.eclipse.CppCreator(aSourceDirectory);
codeLevelModel =
CPPFactoryEclipse.getInstance().createCodeLevelModel(aName);
if (aModelListener != null) {
codeLevelModel.addModelListener(aModelListener);
}
codeLevelModel.create(creator);
}
catch (final CreationException e) {
e.printStackTrace(ProxyConsole.getInstance().errorOutput());
}
...

61/69
Ptidej Tool Suite
Concrete Usage
– Build a model from some C++ code (2/2)
public static IIdiomLevelModel generateModelFromCppFilesUsingEclipse(
final String aName,
final String aSourceDirectory,
final IModelListener aModelListener) {
...
IIdiomLevelModel idiomLevelModel = null;
try {
idiomLevelModel =
(IIdiomLevelModel) new AACRelationshipsAnalysis().invoke(aCodeLevelModel);
}
catch (final UnsupportedSourceModelException e) {
e.printStackTrace(ProxyConsole.getInstance().errorOutput());
}
return idiomLevelModel;
}

62/69
Promotion of the model

Ptidej Tool Suite
Concrete Usage
– Build a model from some C++ code (2/2)
public static IIdiomLevelModel generateModelFromCppFilesUsingEclipse(
final String aName,
final String aSourceDirectory,
final IModelListener aModelListener) {
...
IIdiomLevelModel idiomLevelModel = null;
try {
idiomLevelModel =
(IIdiomLevelModel) new AACRelationshipsAnalysis().invoke(aCodeLevelModel);
}
catch (final UnsupportedSourceModelException e) {
e.printStackTrace(ProxyConsole.getInstance().errorOutput());
}
return idiomLevelModel;
}

63/69
Ptidej Tool Suite
Concrete Usage
– Identify occurrence of the Composite DM
final Problem problem =
CompositeMotif.getProblem(Manager.build(idiomLevelModel));
final StringWriter writer = new StringWriter();
problem.setWriter(new PrintWriter(writer));
problem.automaticSolve(true);
final Properties properties = new Properties();
properties.load(new ReaderInputStream(new StringReader(writer.getBuffer().toString())));
final OccurrenceBuilder solutionBuilder = OccurrenceBuilder.getInstance();
final Occurrence[] solutions = solutionBuilder.getCanonicalOccurrences(properties);

64/69
Ptidej Tool Suite

From a library of
design motifs

Concrete Usage
– Identify occurrence of the Composite DM
final Problem problem =
CompositeMotif.getProblem(Manager.build(idiomLevelModel));
final StringWriter writer = new StringWriter();
problem.setWriter(new PrintWriter(writer));
problem.automaticSolve(true);
final Properties properties = new Properties();
properties.load(new ReaderInputStream(new StringReader(writer.getBuffer().toString())));
final OccurrenceBuilder solutionBuilder = OccurrenceBuilder.getInstance();
final Occurrence[] solutions = solutionBuilder.getCanonicalOccurrences(properties);

65/69
Ptidej Tool Suite
Concrete Usage
– Identify occurrence of the Blob anti-pattern
final IDesignSmellDetection detection = (IDesignSmellDetection) new BlobDetection();
detection.setMetricsFileRepository(ClassFileRepository.getInstance(Repository.class));
detection.setModel(idiomLevelModel);
detection.performDetection();
final String path = ...;
detection.output(new PrintWriter(ProxyDisk.getInstance().fileTempOutput(path)));
final Properties properties = new Properties();
properties.load(new ReaderInputStream(ProxyDisk.getInstance().fileTempInput(path)));
final OccurrenceBuilder solutionBuilder = OccurrenceBuilder.getInstance();
final Occurrence[] solutions = solutionBuilder.getCanonicalOccurrences(properties);

66/69
Ptidej Tool Suite

From a library of
anti-patterns

Concrete Usage
– Identify occurrence of the Blob anti-pattern
final IDesignSmellDetection detection = (IDesignSmellDetection) new BlobDetection();
detection.setMetricsFileRepository(ClassFileRepository.getInstance(Repository.class));
detection.setModel(idiomLevelModel);
detection.performDetection();
final String path = ...;
detection.output(new PrintWriter(ProxyDisk.getInstance().fileTempOutput(path)));
final Properties properties = new Properties();
properties.load(new ReaderInputStream(ProxyDisk.getInstance().fileTempInput(path)));
final OccurrenceBuilder solutionBuilder = OccurrenceBuilder.getInstance();
final Occurrence[] solutions = solutionBuilder.getCanonicalOccurrences(properties);

67/69
Ptidej Tool Suite
Limitations and future work
– Treatment and modelling of method bodies
• Coarse grain multi-language support for method
bodies currently available
• Fine grain through meta-model extension

– Treatment and modelling of non-typed, nonobject-oriented programming languages
• Unsatisfactory support for Smalltalk
• No support for PHP, JavaScript

68/69
Ptidej Tool Suite
Limitations and future work
– Treatment and modelling of method bodies
• Coarse grain multi-language support for method
bodies currently available
• Fine grain through meta-model extension

– Treatment and modelling of non-typed, nonobject-oriented programming languages
• Unsatisfactory support for Smalltalk
• No support for PHP, JavaScript

69/69

Mais conteúdo relacionado

Semelhante a Ptidej Tool Suite: Software Patterns

Design & Evaluation of the Goal-Oriented Design Knowledge Library
Design & Evaluation of the Goal-Oriented Design Knowledge LibraryDesign & Evaluation of the Goal-Oriented Design Knowledge Library
Design & Evaluation of the Goal-Oriented Design Knowledge Libraryandrewhilts
 
Research article
Research article Research article
Research article RASHID ALI
 
Ptidej Architecture, Design, and Implementation in Action v2.1
Ptidej Architecture, Design, and Implementation in Action v2.1Ptidej Architecture, Design, and Implementation in Action v2.1
Ptidej Architecture, Design, and Implementation in Action v2.1Yann-Gaël Guéhéneuc
 
Contributions to the multidisciplinarity of computer science and IS
Contributions to the multidisciplinarity of computer science and ISContributions to the multidisciplinarity of computer science and IS
Contributions to the multidisciplinarity of computer science and ISSaïd Assar
 
Comparative Development Methodologies
Comparative Development MethodologiesComparative Development Methodologies
Comparative Development Methodologiesguestc990b6
 
Integrating qualitative data analysis and interactive system design
Integrating qualitative data analysis and interactive system designIntegrating qualitative data analysis and interactive system design
Integrating qualitative data analysis and interactive system designpbelouin
 
AudrisMockus_MSR22.pdf
AudrisMockus_MSR22.pdfAudrisMockus_MSR22.pdf
AudrisMockus_MSR22.pdfTapajitDey1
 
The Application of Function Models In Software Design: A Survey Within the So...
The Application of Function Models In Software Design: A Survey Within the So...The Application of Function Models In Software Design: A Survey Within the So...
The Application of Function Models In Software Design: A Survey Within the So...CSCJournals
 
David vernon software_engineering_notes
David vernon software_engineering_notesDavid vernon software_engineering_notes
David vernon software_engineering_notesmitthudwivedi
 
NL based Object Oriented modeling - EJSR 35(1)
NL based Object Oriented modeling - EJSR 35(1)NL based Object Oriented modeling - EJSR 35(1)
NL based Object Oriented modeling - EJSR 35(1)IT Industry
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringHironori Washizaki
 
Studying Software Engineering Patterns for Designing Machine Learning Systems
Studying Software Engineering Patterns for Designing Machine Learning SystemsStudying Software Engineering Patterns for Designing Machine Learning Systems
Studying Software Engineering Patterns for Designing Machine Learning SystemsHironori Washizaki
 
From Representation to Mediation: A New Agenda for Conceptual Modeling Resear...
From Representation to Mediation: A New Agenda for Conceptual Modeling Resear...From Representation to Mediation: A New Agenda for Conceptual Modeling Resear...
From Representation to Mediation: A New Agenda for Conceptual Modeling Resear...Jan Recker @ University of Hamburg
 
Social Requirements Engineering and the RWTH Aachen University Test Bed
Social Requirements Engineering and the RWTH Aachen University Test BedSocial Requirements Engineering and the RWTH Aachen University Test Bed
Social Requirements Engineering and the RWTH Aachen University Test BedRalf Klamma
 
The Object Model
The Object Model  The Object Model
The Object Model yndaravind
 
EMMM: A Unified Meta-Model for Tracking Machine Learning Experiments
 EMMM: A Unified Meta-Model for Tracking Machine Learning Experiments EMMM: A Unified Meta-Model for Tracking Machine Learning Experiments
EMMM: A Unified Meta-Model for Tracking Machine Learning ExperimentsSEAA 2022
 

Semelhante a Ptidej Tool Suite: Software Patterns (20)

Design & Evaluation of the Goal-Oriented Design Knowledge Library
Design & Evaluation of the Goal-Oriented Design Knowledge LibraryDesign & Evaluation of the Goal-Oriented Design Knowledge Library
Design & Evaluation of the Goal-Oriented Design Knowledge Library
 
Research article
Research article Research article
Research article
 
Ptidej Architecture, Design, and Implementation in Action v2.1
Ptidej Architecture, Design, and Implementation in Action v2.1Ptidej Architecture, Design, and Implementation in Action v2.1
Ptidej Architecture, Design, and Implementation in Action v2.1
 
Software bug prediction
Software bug prediction Software bug prediction
Software bug prediction
 
IT-UG-New-Syllabus.pdf
IT-UG-New-Syllabus.pdfIT-UG-New-Syllabus.pdf
IT-UG-New-Syllabus.pdf
 
Contributions to the multidisciplinarity of computer science and IS
Contributions to the multidisciplinarity of computer science and ISContributions to the multidisciplinarity of computer science and IS
Contributions to the multidisciplinarity of computer science and IS
 
Comparative Development Methodologies
Comparative Development MethodologiesComparative Development Methodologies
Comparative Development Methodologies
 
Integrating qualitative data analysis and interactive system design
Integrating qualitative data analysis and interactive system designIntegrating qualitative data analysis and interactive system design
Integrating qualitative data analysis and interactive system design
 
AudrisMockus_MSR22.pdf
AudrisMockus_MSR22.pdfAudrisMockus_MSR22.pdf
AudrisMockus_MSR22.pdf
 
Iwesep19.ppt
Iwesep19.pptIwesep19.ppt
Iwesep19.ppt
 
H1803044651
H1803044651H1803044651
H1803044651
 
The Application of Function Models In Software Design: A Survey Within the So...
The Application of Function Models In Software Design: A Survey Within the So...The Application of Function Models In Software Design: A Survey Within the So...
The Application of Function Models In Software Design: A Survey Within the So...
 
David vernon software_engineering_notes
David vernon software_engineering_notesDavid vernon software_engineering_notes
David vernon software_engineering_notes
 
NL based Object Oriented modeling - EJSR 35(1)
NL based Object Oriented modeling - EJSR 35(1)NL based Object Oriented modeling - EJSR 35(1)
NL based Object Oriented modeling - EJSR 35(1)
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their Engineering
 
Studying Software Engineering Patterns for Designing Machine Learning Systems
Studying Software Engineering Patterns for Designing Machine Learning SystemsStudying Software Engineering Patterns for Designing Machine Learning Systems
Studying Software Engineering Patterns for Designing Machine Learning Systems
 
From Representation to Mediation: A New Agenda for Conceptual Modeling Resear...
From Representation to Mediation: A New Agenda for Conceptual Modeling Resear...From Representation to Mediation: A New Agenda for Conceptual Modeling Resear...
From Representation to Mediation: A New Agenda for Conceptual Modeling Resear...
 
Social Requirements Engineering and the RWTH Aachen University Test Bed
Social Requirements Engineering and the RWTH Aachen University Test BedSocial Requirements Engineering and the RWTH Aachen University Test Bed
Social Requirements Engineering and the RWTH Aachen University Test Bed
 
The Object Model
The Object Model  The Object Model
The Object Model
 
EMMM: A Unified Meta-Model for Tracking Machine Learning Experiments
 EMMM: A Unified Meta-Model for Tracking Machine Learning Experiments EMMM: A Unified Meta-Model for Tracking Machine Learning Experiments
EMMM: A Unified Meta-Model for Tracking Machine Learning Experiments
 

Mais de Ptidej Team

From IoT to Software Miniaturisation
From IoT to Software MiniaturisationFrom IoT to Software Miniaturisation
From IoT to Software MiniaturisationPtidej Team
 
Presentation by Lionel Briand
Presentation by Lionel BriandPresentation by Lionel Briand
Presentation by Lionel BriandPtidej Team
 
Manel Abdellatif
Manel AbdellatifManel Abdellatif
Manel AbdellatifPtidej Team
 
Azadeh Kermansaravi
Azadeh KermansaraviAzadeh Kermansaravi
Azadeh KermansaraviPtidej Team
 
CSED - Manel Grichi
CSED - Manel GrichiCSED - Manel Grichi
CSED - Manel GrichiPtidej Team
 
Cristiano Politowski
Cristiano PolitowskiCristiano Politowski
Cristiano PolitowskiPtidej Team
 
Will io t trigger the next software crisis
Will io t trigger the next software crisisWill io t trigger the next software crisis
Will io t trigger the next software crisisPtidej Team
 
Thesis+of+laleh+eshkevari.ppt
Thesis+of+laleh+eshkevari.pptThesis+of+laleh+eshkevari.ppt
Thesis+of+laleh+eshkevari.pptPtidej Team
 
Thesis+of+nesrine+abdelkafi.ppt
Thesis+of+nesrine+abdelkafi.pptThesis+of+nesrine+abdelkafi.ppt
Thesis+of+nesrine+abdelkafi.pptPtidej Team
 

Mais de Ptidej Team (20)

From IoT to Software Miniaturisation
From IoT to Software MiniaturisationFrom IoT to Software Miniaturisation
From IoT to Software Miniaturisation
 
Presentation
PresentationPresentation
Presentation
 
Presentation
PresentationPresentation
Presentation
 
Presentation
PresentationPresentation
Presentation
 
Presentation by Lionel Briand
Presentation by Lionel BriandPresentation by Lionel Briand
Presentation by Lionel Briand
 
Manel Abdellatif
Manel AbdellatifManel Abdellatif
Manel Abdellatif
 
Azadeh Kermansaravi
Azadeh KermansaraviAzadeh Kermansaravi
Azadeh Kermansaravi
 
Mouna Abidi
Mouna AbidiMouna Abidi
Mouna Abidi
 
CSED - Manel Grichi
CSED - Manel GrichiCSED - Manel Grichi
CSED - Manel Grichi
 
Cristiano Politowski
Cristiano PolitowskiCristiano Politowski
Cristiano Politowski
 
Will io t trigger the next software crisis
Will io t trigger the next software crisisWill io t trigger the next software crisis
Will io t trigger the next software crisis
 
MIPA
MIPAMIPA
MIPA
 
Thesis+of+laleh+eshkevari.ppt
Thesis+of+laleh+eshkevari.pptThesis+of+laleh+eshkevari.ppt
Thesis+of+laleh+eshkevari.ppt
 
Thesis+of+nesrine+abdelkafi.ppt
Thesis+of+nesrine+abdelkafi.pptThesis+of+nesrine+abdelkafi.ppt
Thesis+of+nesrine+abdelkafi.ppt
 
Medicine15.ppt
Medicine15.pptMedicine15.ppt
Medicine15.ppt
 
Qrs17b.ppt
Qrs17b.pptQrs17b.ppt
Qrs17b.ppt
 
Icpc11c.ppt
Icpc11c.pptIcpc11c.ppt
Icpc11c.ppt
 
Icsme16.ppt
Icsme16.pptIcsme16.ppt
Icsme16.ppt
 
Msr17a.ppt
Msr17a.pptMsr17a.ppt
Msr17a.ppt
 
Icsoc15.ppt
Icsoc15.pptIcsoc15.ppt
Icsoc15.ppt
 

Último

Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 

Último (20)

Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 

Ptidej Tool Suite: Software Patterns

  • 1. Ptidej Tool Suite Yann-Gaël Guéhéneuc yann-gael.gueheneuc@polytmtl.ca Presentation in Sukyoung Ruy’s group KAIST 2013/06/07 Département de génie informatique et de génie logiciel This work is licensed under a Creative Commons Attribution-NonCommercialShareAlike 3.0 Unported License
  • 2. Patterns Patterns document reusable solutions to recurring problems – Architecture • Architectural styles – Design • Design patterns • Design anti-patterns – Implementation • Idioms 2/69
  • 3. Patterns Several books, articles – “Theoretical” – With examples – Among others… 3/69
  • 4. Patterns Several books, articles – “Theoretical” – With examples – Among others… 4/69
  • 5. Patterns Several books, articles – “Theoretical” – With examples – Among others… 5/69
  • 6. Patterns Several books, articles – “Theoretical” – With examples – Among others… 6/69
  • 7. Patterns Several books, articles – “Theoretical” – With examples – Among others… 7/69
  • 8. Patterns Several books, articles – “Theoretical” – With examples – Among others… 8/69
  • 9. Patterns “[E]xisting books on design patterns take a catalog approach, where they show the individual design patterns in isolation. This approach is […] flawed, because you can't see how the design patterns actually function in the real world. Most programmers learn by looking at computer programs.” —Allen Holub in Holub on Patterns: Learning Design Patterns by Looking at Code 9/69
  • 12. Patterns Several books, articles – Amazon.com • Books › Computers & Technology › Programming › Software Design, Testing & Engineering › ObjectOriented Design › "patterns" • 224 results on May 31, 2013 12/69
  • 13. Patterns Several books, articles – Amazon.com • Exclusion – Unreleased books – Specific to a technology or frameworks » e.g., MVVM Unleashed by Michael Brown – Process oriented, user-interface, programming languages » e.g., Process Patterns: Building Large-Scale Systems Using Object Technology by Scott W. Ambler and Barbara Hanscome – Proceedings of conferences – Unrelated to software engineering 13/69
  • 14. Patterns 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28. 29. 30. 31. 32. 33. 34. 35. Pattern-Oriented Software Architecture, Patterns for Concurrent and Networked Objects: Volume 2 (Wiley Software... by Douglas C. Schmidt, Michael Stal, Hans Rohnert and Frank Buschmann Pattern-Oriented Software Architecture, Patterns for Resource Management: Volume 3 (Wiley Software Patterns Series... by Michael Kircher and Prashant Jain Pattern-Oriented Software Architecture, A System of Patterns: Volume 1 (Wiley Software Patterns Series) by Frank Buschmann, Regine Meunier, Hans Rohnert and Peter Sommerlad Pattern-Oriented Software Architecture For Dummies (For Dummies (Computers)) by Robert Hanmer Web Security Patterns by Ramesh Nagappan and Christopher Steel Safe C++ by Vladimir Kushnir Programming in the Large with Design Patterns by Eddie Burris Elemental Design Patterns by Jason McC. Smith Java Application Architecture: Modularity Patterns with Examples Using OSGi (Robert C. Martin Series) by Kirk Knoernschild Enterprise Integration Patterns: Designing, Building, and Deploying Messaging Solutions (Addison-Wesley Signature... by Gregor Hohpe and Bobby Woolf Patterns of Enterprise Application Architecture (Addison-Wesley Signature Series (Fowler)) by Martin Fowler Cognitive Patterns: Problem-Solving Frameworks for Object Technology by Robert K Konitzer, Bobbin Teegarden, Alexander Rush and Karen M Gardner Service Design Patterns: Fundamental Design Solutions for SOAP/WSDL and RESTful Web Services by Robert Daigneau The ACE Programmer's Guide: Practical Design Patterns for Network and Systems Programming by Stephen D. Huston, James CE Johnson and Umar Syyid Patterns for Parallel Software Design (Wiley Software Patterns Series) by Jorge Luis Ortega-Arjona Design Patterns in Object-oriented ABAP by Igor Barbaric Object-Oriented Reengineering Patterns by Oscar Nierstrasz, Stéphane Ducasse and Serge Demeyer Dependency Injection by Dhanji R. Prasanna Object-Oriented Software Engineering Using UML, Patterns, and Java (3rd Edition) by Bernd Bruegge and Allen H. Dutoit J2EE Design Patterns by William Crawford and Jonathan Kaplan Applying UML and Patterns: An Introduction to Object-oriented Analysis and Design and Iterative Development by Craig Larman Object-oriented Analysis and Design Using Umlan Introduction to Unified Process and Design Patterns by Mahesh P. Matha C++ Design Patterns and Derivatives Pricing (Mathematics, Finance and Risk) by M. S. Joshi Effective Java (2nd Edition) by Joshua Bloch Patterns for Fault Tolerant Software (Wiley Software Patterns Series) by Robert Hanmer Implementation Patterns by Kent Beck Patterns for Computer-Mediated Interaction (Wiley Software Patterns Series) by Till Schummer and Stephan Lukosch Pattern Oriented Software Architecture Volume 5: On Patterns and Pattern Languages by Frank Buschmann, Kevlin Henney and Douglas C. Schmidt Object-Oriented Analysis and Design with Applications (3rd Edition) by Grady Booch, Robert A. Maksimchuk, Michael W. Engle and Bobbi J. Young Head First Object-Oriented Analysis and Design by Brett D. McLaughlin, Gary Pollice and Dave West Agile Principles, Patterns, and Practices in C# by Robert C. Martin and Micah Martin Design Patterns For Dummies by Steve Holzner Pattern Languages of Program Design 5 by Dragos Manolescu, Markus Voelter and James Noble Design Patterns in Java(TM) (Software Patterns Series) by Steven John Metsker and William C. Wake Object-Oriented Design and Patterns by Cay S. Horstmann 37. 38. 39. 40. 41. 42. 43. 44. 45. 46. 47. 48. 49. 50. 51. 52. 53. 54. 55. 56. 57. 58. 59. 60. 61. 62. 63. 64. 65. 66. 67. 68. 69. 70. 71. 72. Object-Oriented Modeling and Design with UML (2nd Edition) by Michael R. Blaha and James R Rumbaugh Remoting Patterns: Foundations of Enterprise, Internet and Realtime Distributed Object Middleware (Wiley Software... by Markus Völter, Michael Kircher and Uwe Zdun Software Factories: Assembling Applications with Patterns, Models, Frameworks, and Tools (Wiley Application Development... by Jack Greenfield, Keith Short, Steve Cook and Stuart Kent Refactoring to Patterns by Joshua Kerievsky Architecting Enterprise Solutions: Patterns for High-Capability Internet-based Systems (Wiley Software Patterns... by Paul Dyson and Andrew Longshaw Enterprise Patterns and MDA: Building Better Software with Archetype Patterns and UML by Jim Arlow and Ila Neustadt Data Access Patterns: Database Interactions in Object-Oriented Applications by Clifton Nock Domain-Driven Design: Tackling Complexity in the Heart of Software by Eric Evans Pattern-Oriented Analysis and Design: Composing Patterns to Design Software Systems by Sherif M. Yacoub, Hany H. Ammar, Sherif Yacoub and Hany Ammar Java Extreme Programming Cookbook by Eric M. Burke and Brian M. Coyner J2EE Best Practices: Java Design Patterns, Automation, and Performance (Wiley Application Development Series) by Darren Broemmer Real-Time Design Patterns: Robust Scalable Architecture for Real-Time Systems by Bruce Powel Douglass Design Patterns Java¿ Workbook by Steven John Metsker EJB Design Patterns: Advanced Patterns, Processes, and Idioms by Floyd Marinescu Streamlined Object Modeling: Patterns, Rules, and Implementation by Jill Nicola, Mark Mayfield and Mike Abney Design Patterns Explained: A New Perspective on Object-Oriented Design by Alan Shalloway and James Trott Small Memory Software: Patterns for systems with limited memory (Software Patterns Series) by James Noble and Charles Weir AntiPatterns in Project Management by William J. Brown, Hays W. "Skip" McCormick III and Scott W. Thomas Pattern Languages of Program Design 4 (Software Patterns Series) by Brian Foote, Neil Harrison and Hans Rohnert Testing Object-Oriented Systems: Models, Patterns, and Tools by Robert V. Binder Design Patterns and Contracts by Jean-Marc Jezequel, Michel Train and Christine Mingins Object-Oriented Software Development Using Java: Principles, Patterns, and Frameworks (1/e) by Xiaoping Jia Refactoring: Improving the Design of Existing Code by Martin Fowler, Kent Beck, John Brant and William Opdyke More Process Patterns: Delivering Large-Scale Systems Using Object Technology (SIGS: Managing Object Technology... by Scott W. Ambler Pattern Hatching: Design Patterns Applied by John Vlissides AntiPatterns: Refactoring Software, Architectures, and Projects in Crisis by William J. Brown, Raphael C. Malveau, Hays W. "Skip" McCormick and Thomas J. Mowbray A Little Java, A Few Patterns (Language, Speech, & Communication) by Matthias Felleisen, Daniel P. Friedman and Ralph E. Johnson Pattern Languages of Program Design 3 (v. 3) by Robert C. Martin, Dirk Riehle and Frank Buschmann Object Models: Strategies, Patterns, and Applications (2nd Edition) by Peter Coad, David North and Mark Mayfield Analysis Patterns: Reusable Object Models by Martin Fowler Patterns of Software: Tales from the Software Community by Richard P. Gabriel Pattern Languages of Program Design 2 (v. 2) by John Vlissides, James O. Coplien and Norman L. Kerth Software Patterns by James Coplien Software Architecture: Perspectives on an Emerging Discipline by Mary Shaw and David Garlan Adaptive Object-Oriented Software: The Demeter Method with Propagation Patterns: The Demeter Method with Propagation... by Karl Lieberherr Pattern Languages of Program Design by James O. Coplien and Douglas C. Schmidt 14/69
  • 15. Patterns The following is not a substitute to reading previous books and practicing The following is complementary to reading books and practicing – These patterns that have been “found” the hard way and that work (or do not work!) 15/69
  • 16. Patterns The following is not a substitute to reading these books and practicing The following is complementary to reading books and practicing – These patterns that have been “found” the hard way and that work (or do not work!) 16/69
  • 17. Patterns General form as for the GoF , also inspired by Coplien’s form – Name – Problem(s) – Solution – Consequences 17/69
  • 18. Patterns General form as for the GoF, also inspired by Coplien’s form – Name – Problem(s) – Example(s) – Solution – Example(s) – Consequences – (Follow-up) 18/69
  • 19. Patterns General form as for the GoF, also inspired by Coplien’s form – Name – Problem(s) – Example(s) – Solution – Example(s) – Consequences – (Follow-up) Problem: Solution: 19/69
  • 20. Patterns General form as for the GoF, also inspired by Coplien’s form – Not formal – Room for interpretation – But… • UML-like class diagrams • UML-like sequence diagrams • Smalltalk / C++ example code 20/69
  • 22. Ptidej Tool Suite Context – Research work started since my Ph.D. thesis (2000–2003) – Pattern Trace Identification, Detection, and Enhancement in Java • Theories, methods, and tools, to evaluate and to improve the quality of object-oriented programs by promoting the use of idioms, design patterns, and architectural patterns 22/69
  • 23. Ptidej Tool Suite Requirements – Software tools • Support the analysis of the implementation, design, and architecture of object-oriented programs • Support the detection and introduction of patterns at the code, design, and architectural levels 23/69
  • 24. Ptidej Tool Suite Analysis – Domain concepts • “quality of object-oriented” • “promoting the use of idioms, design patterns, and architectural patterns” • “analysis of the implementation, design, and architecture of object-oriented programs” • “detection and introduction of patterns at the code, design, and architectural levels” 24/69
  • 25. Ptidej Tool Suite Analysis – Domain concepts • “quality of object-oriented” • “promoting the use of idioms, design patterns, and architectural patterns” • “analysis of the implementation, design, and architecture of object-oriented programs” • “detection and introduction of patterns at the code, design, and architectural levels” 25/69
  • 26. Ptidej Tool Suite Constraint – Apply patterns/best practices (existing or new) when developing the tools • Architectural • Design • Implementation – Self-imposed but sensible • “Eating your own dog food” (http://www.urbandictionary.com/define.php? term=eating%20your%20own%20dog%20food) 26/69
  • 27. Ptidej Tool Suite Related work – Various parsers (target languages) e.g., GCCXML – Various meta-model (sometimes implicit) • • • • Similar to UML meta-model (1997) Before OMG KDM (2003) Before Eclipse EMF (2004) Before OMG MOF (2006) – Various tools e.g., Rigi (H. M. Kienle and H. A. Müller: Rigi – An environment for software reverse engineering, exploration, visualization, and redocumentation. Sci. Comput. Program. 75(4): 247-263, 2010) 27/69
  • 28. Ptidej Tool Suite Related work ↑ Existing ☺ ↓ Too low-level e.g., GCCXML ↓ No “free” parsers e.g., UML meta-model ↓ Difficult to access / to use / to adapt e.g., Rigi 28/69
  • 29. Ptidej Tool Suite Related work – Pierre Cointe’s team in 2000 at École des Mines de Nantes, France – Fertile ground • Hervé Albin-Amiot was already developing a metamodel to describe design patterns – “Idioms and patterns Java: application to code synthesis and detection” (Ph.D. in 2003) – PDL (Pattern Description Language) 29/69
  • 30. Ptidej Tool Suite What to detect? In what to detect it? How to express it? 30/69
  • 31. Ptidej Tool Suite “Great software is not built, it is grown” —Bill de hÓra in 97 Things Every Software Architect Should Know 31/69
  • 32. Ptidej Tool Suite Design Patterns Models of OO programs PDL metamodel 32/69
  • 33. Ptidej Tool Suite PDL meta-model 33/69
  • 34. Ptidej Tool Suite + PDL meta-model Models of OO programs 34/69
  • 35. Ptidej Tool Suite + = PDL meta-model Models of OO programs PADL meta-model 35/69
  • 36. Ptidej Tool Suite PADL Pattern and Abstract-level Description Language 36/69
  • 37. Ptidej Tool Suite PADL Creators C++, C#, Java, JavaScript? PADL Pattern and Abstract-level Description Language 37/69
  • 38. Ptidej Tool Suite PADL Analyses • Binary Class Relationships • Systematic UML PADL Creators C++, C#, Java, JavaScript? PADL Pattern and Abstract-level Description Language 38/69
  • 39. Ptidej Tool Suite PADL Generators XMI… PADL Analyses • Binary Class Relationships • Systematic UML PADL Creators C++, C#, Java, JavaScript? PADL Pattern and Abstract-level Description Language 39/69
  • 40. Ptidej Tool Suite PADL Generators XMI… PADL Analyses • Binary Class Relationships • Systematic UML PADL Creators C++, C#, Java, JavaScript? PADL Serialisers DB4O, JOS… PADL Pattern and Abstract-level Description Language 40/69
  • 41. Ptidej Tool Suite PADL Generators XMI… PADL Analyses • Binary Class Relationships • Systematic UML PADL Design Motifs Anti-patterns, code smells, and µ-patterns PADL Creators C++, C#, Java, JavaScript? PADL Serialisers DB4O, JOS… PADL Pattern and Abstract-level Description Language 41/69
  • 42. Ptidej Tool Suite PADL Generators XMI… POM Primitives, Operations, Metrics PADL Analyses • Binary Class Relationships • Systematic UML PADL Design Motifs Anti-patterns, code smells, and µ-patterns PADL Creators C++, C#, Java, JavaScript? PADL Serialisers DB4O, JOS… PADL Pattern and Abstract-level Description Language 42/69
  • 43. Ptidej Tool Suite (Ptidej Solver) Identification of design motifs PADL Generators XMI… POM Primitives, Operations, Metrics PADL Analyses • Binary Class Relationships • Systematic UML PADL Design Motifs Anti-patterns, code smells, and µ-patterns PADL Creators C++, C#, Java, JavaScript? PADL Serialisers DB4O, JOS… PADL Pattern and Abstract-level Description Language 43/69
  • 44. Ptidej Tool Suite (Ptidej Solver) Identification of design motifs SAD Identification of anti-patterns PADL Generators XMI… POM Primitives, Operations, Metrics PADL Analyses • Binary Class Relationships • Systematic UML PADL Design Motifs Anti-patterns, code smells, and µ-patterns PADL Creators C++, C#, Java, JavaScript? PADL Serialisers DB4O, JOS… PADL Pattern and Abstract-level Description Language 44/69
  • 45. Ptidej Tool Suite Ptidej UI User interface (using reflection) (Ptidej Solver) Identification of design motifs SAD Identification of anti-patterns PADL Generators XMI… POM Primitives, Operations, Metrics PADL Analyses • Binary Class Relationships • Systematic UML PADL Design Motifs Anti-patterns, code smells, and µ-patterns PADL Creators C++, C#, Java, JavaScript? PADL Serialisers DB4O, JOS… PADL Pattern and Abstract-level Description Language 45/69
  • 46. Ptidej UI Viewer Standalone Swing displaying PADL (Another example of “Eating your own dog food” ☺) 46/69
  • 47. PADL Kernel, main interfaces provided to the users (SVG and JPG from Ptidej UI Viewer Standalone Swing) 47/69
  • 48. PADL Kernel, abstract-level models Describe models of programs, including design motifs 48/69
  • 49. PADL Kernel, elements Describe methods, fields… 49/69
  • 50. PADL Kernel, entities Describe classes, interfaces… 50/69
  • 51. PADL Kernel, relationships Describe inheritances, associations… 51/69
  • 52. Ptidej Tool Suite Advantages – Creators – BCRs – Extensibility – Reliability (Has been used in many studies) 52/69
  • 53. Ptidej Tool Suite Advantages – Available! ☺ • https://web.soccerlab.polymtl.ca/rptidej/ptidejlab/ Software/Ptidej 5 Workspace • Username: guestsvn • Password: g1u2e3s4t5 – See also • http://www.ptidej.net/material/inanutshell • http://www.ptidej.net/material/development/ • http://wiki.ptidej.net/doku.php 53/69
  • 54. Ptidej Tool Suite Advantages – Extensible e.g., C++ creator provide new/modified constituent • Factory design pattern • Builder design pattern – Including for the user interface 54/69
  • 55. Ptidej Tool Suite Limits – Coarse representation of method statements – Unsatisfactory support of non-typed, non-objectoriented programming languages • (Very) partial support for Smalltalk 55/69
  • 56. Ptidej Tool Suite Performance – Eclipse v3.1 – Google Chrome v1.0.154.53 • Quality of the model under tests 56/69
  • 57. Ptidej Tool Suite Academic Usage – Dozen of empirical studies e.g., S. Kpodjedo, F. Ricca, P. Galinier, G. Antoniol, and Y.-G. Guéhéneuc. MADMatch: Many-to-many Approximate Diagram Matching for Design Comparison. IEEE TSE, Feburary 2013 – Please see • http://www.ptidej.net/publications/ 57/69
  • 58. Ptidej Tool Suite Concrete Usage – Build a model from some C++ code (1/2) public static IIdiomLevelModel generateModelFromCppFilesUsingEclipse( final String aName, final String aSourceDirectory, final IModelListener aModelListener) { ICodeLevelModel codeLevelModel = null; try { final ICodeLevelModelCreator creator = new padl.creator.cppfile.eclipse.CppCreator(aSourceDirectory); codeLevelModel = CPPFactoryEclipse.getInstance().createCodeLevelModel(aName); if (aModelListener != null) { codeLevelModel.addModelListener(aModelListener); } codeLevelModel.create(creator); } catch (final CreationException e) { e.printStackTrace(ProxyConsole.getInstance().errorOutput()); } ... 58/69
  • 59. Specialised creator Ptidej Tool Suite Concrete Usage – Build a model from some C++ code (1/2) public static IIdiomLevelModel generateModelFromCppFilesUsingEclipse( final String aName, final String aSourceDirectory, final IModelListener aModelListener) { ICodeLevelModel codeLevelModel = null; try { final ICodeLevelModelCreator creator = new padl.creator.cppfile.eclipse.CppCreator(aSourceDirectory); codeLevelModel = CPPFactoryEclipse.getInstance().createCodeLevelModel(aName); if (aModelListener != null) { codeLevelModel.addModelListener(aModelListener); } codeLevelModel.create(creator); } catch (final CreationException e) { e.printStackTrace(ProxyConsole.getInstance().errorOutput()); } ... 59/69
  • 60. Specialised creator Ptidej Tool Suite Concrete Usage Specialised factory to allow new constituents – Build a model from some C++ code (1/2) public static IIdiomLevelModel generateModelFromCppFilesUsingEclipse( final String aName, final String aSourceDirectory, final IModelListener aModelListener) { ICodeLevelModel codeLevelModel = null; try { final ICodeLevelModelCreator creator = new padl.creator.cppfile.eclipse.CppCreator(aSourceDirectory); codeLevelModel = CPPFactoryEclipse.getInstance().createCodeLevelModel(aName); if (aModelListener != null) { codeLevelModel.addModelListener(aModelListener); } codeLevelModel.create(creator); } catch (final CreationException e) { e.printStackTrace(ProxyConsole.getInstance().errorOutput()); } ... 60/69
  • 61. Specialised creator Ptidej Tool Suite Concrete Usage Specialised factory to allow new constituents Builder design pattern – Build a model from some C++ code (1/2) public static IIdiomLevelModel generateModelFromCppFilesUsingEclipse( final String aName, final String aSourceDirectory, final IModelListener aModelListener) { ICodeLevelModel codeLevelModel = null; try { final ICodeLevelModelCreator creator = new padl.creator.cppfile.eclipse.CppCreator(aSourceDirectory); codeLevelModel = CPPFactoryEclipse.getInstance().createCodeLevelModel(aName); if (aModelListener != null) { codeLevelModel.addModelListener(aModelListener); } codeLevelModel.create(creator); } catch (final CreationException e) { e.printStackTrace(ProxyConsole.getInstance().errorOutput()); } ... 61/69
  • 62. Ptidej Tool Suite Concrete Usage – Build a model from some C++ code (2/2) public static IIdiomLevelModel generateModelFromCppFilesUsingEclipse( final String aName, final String aSourceDirectory, final IModelListener aModelListener) { ... IIdiomLevelModel idiomLevelModel = null; try { idiomLevelModel = (IIdiomLevelModel) new AACRelationshipsAnalysis().invoke(aCodeLevelModel); } catch (final UnsupportedSourceModelException e) { e.printStackTrace(ProxyConsole.getInstance().errorOutput()); } return idiomLevelModel; } 62/69
  • 63. Promotion of the model Ptidej Tool Suite Concrete Usage – Build a model from some C++ code (2/2) public static IIdiomLevelModel generateModelFromCppFilesUsingEclipse( final String aName, final String aSourceDirectory, final IModelListener aModelListener) { ... IIdiomLevelModel idiomLevelModel = null; try { idiomLevelModel = (IIdiomLevelModel) new AACRelationshipsAnalysis().invoke(aCodeLevelModel); } catch (final UnsupportedSourceModelException e) { e.printStackTrace(ProxyConsole.getInstance().errorOutput()); } return idiomLevelModel; } 63/69
  • 64. Ptidej Tool Suite Concrete Usage – Identify occurrence of the Composite DM final Problem problem = CompositeMotif.getProblem(Manager.build(idiomLevelModel)); final StringWriter writer = new StringWriter(); problem.setWriter(new PrintWriter(writer)); problem.automaticSolve(true); final Properties properties = new Properties(); properties.load(new ReaderInputStream(new StringReader(writer.getBuffer().toString()))); final OccurrenceBuilder solutionBuilder = OccurrenceBuilder.getInstance(); final Occurrence[] solutions = solutionBuilder.getCanonicalOccurrences(properties); 64/69
  • 65. Ptidej Tool Suite From a library of design motifs Concrete Usage – Identify occurrence of the Composite DM final Problem problem = CompositeMotif.getProblem(Manager.build(idiomLevelModel)); final StringWriter writer = new StringWriter(); problem.setWriter(new PrintWriter(writer)); problem.automaticSolve(true); final Properties properties = new Properties(); properties.load(new ReaderInputStream(new StringReader(writer.getBuffer().toString()))); final OccurrenceBuilder solutionBuilder = OccurrenceBuilder.getInstance(); final Occurrence[] solutions = solutionBuilder.getCanonicalOccurrences(properties); 65/69
  • 66. Ptidej Tool Suite Concrete Usage – Identify occurrence of the Blob anti-pattern final IDesignSmellDetection detection = (IDesignSmellDetection) new BlobDetection(); detection.setMetricsFileRepository(ClassFileRepository.getInstance(Repository.class)); detection.setModel(idiomLevelModel); detection.performDetection(); final String path = ...; detection.output(new PrintWriter(ProxyDisk.getInstance().fileTempOutput(path))); final Properties properties = new Properties(); properties.load(new ReaderInputStream(ProxyDisk.getInstance().fileTempInput(path))); final OccurrenceBuilder solutionBuilder = OccurrenceBuilder.getInstance(); final Occurrence[] solutions = solutionBuilder.getCanonicalOccurrences(properties); 66/69
  • 67. Ptidej Tool Suite From a library of anti-patterns Concrete Usage – Identify occurrence of the Blob anti-pattern final IDesignSmellDetection detection = (IDesignSmellDetection) new BlobDetection(); detection.setMetricsFileRepository(ClassFileRepository.getInstance(Repository.class)); detection.setModel(idiomLevelModel); detection.performDetection(); final String path = ...; detection.output(new PrintWriter(ProxyDisk.getInstance().fileTempOutput(path))); final Properties properties = new Properties(); properties.load(new ReaderInputStream(ProxyDisk.getInstance().fileTempInput(path))); final OccurrenceBuilder solutionBuilder = OccurrenceBuilder.getInstance(); final Occurrence[] solutions = solutionBuilder.getCanonicalOccurrences(properties); 67/69
  • 68. Ptidej Tool Suite Limitations and future work – Treatment and modelling of method bodies • Coarse grain multi-language support for method bodies currently available • Fine grain through meta-model extension – Treatment and modelling of non-typed, nonobject-oriented programming languages • Unsatisfactory support for Smalltalk • No support for PHP, JavaScript 68/69
  • 69. Ptidej Tool Suite Limitations and future work – Treatment and modelling of method bodies • Coarse grain multi-language support for method bodies currently available • Fine grain through meta-model extension – Treatment and modelling of non-typed, nonobject-oriented programming languages • Unsatisfactory support for Smalltalk • No support for PHP, JavaScript 69/69