SlideShare ist ein Scribd-Unternehmen logo
1 von 50
Developing a new Epsilon
EMC Driver:
CSV Pro
Horacio Hoyos
@HoracioHoyosR
Epsilon Architecture
CSV Pro Driver
• A EMC Driver for Comma Separated Value (CSV)
with added functionality
• Each row is an element
• Each column is an attribute
• NEW:
• One column to identify type
• One column used as index – optimized search
Overview
• Two Eclipse plugins
• One for the EMC driver implementation
• org.eclipse.epsilon.emc.csvpro
• Implement IModel interface
• Provide Property Getter and Setter
• Provide optimized select operations
• Can run outside eclipse
• One for the driver’s Eclipse-based development tools
• org.eclipse.epsilon.emc.csvpro.dt
• Source code available under
https://git.eclipse.org/c/epsilon/org.eclipse.epsilon
.git/tree/examples
EMC Driver Overview
General architecture and implementation
Epsilon EOL Engine Overview
for (e in m!Row.all()) {
e.name.println();
e.name = “Epsilon”;
}
Model identifier All of Type
Get property ‘name’
of the element
Set property ‘name’
of the element
Activities
• Provide an implementation of the IModel interface
• Retrieve the model
• Get all elements of the model
• Get all elements of the model by type
• Provide an implementation of IPropertyGetter
• Retrieve the value of a property
• Provide an implementation of IPropertySetter
• Set the value of a property
IModel Overview
Alternatives
• Provide a custom implementation of the data
model - e.g. custom file parser
• CSV, Bibtex, FileSystem, etc…
• Use the data model engine/framework – e.g. wrap
existing file parser
• Databases, EMF, XML, etc…
CSV Pro EMC Driver
org.eclipse.epsilon.emc.csvpro
Implementing IModel
• Easy: extend CachedModel
(org.eclipse.epsilon.eol.models.Cached
Model<ModelElementType>)
• Cached model improves performance
• Basic implementation of most methods
• Hard: Implement all the interface
Implementing IModel
• How to represent the data?
• Existing: Each Row is a Map <property: value>, the
model is a list of maps
• Alternative: Each Row is an Integer (representing line
number), the model is a Map <property: List<values>>,
list of values indexed by row
• Implement IPropertyGetter and IPropertyGetter
• Advice: Extend the existing abstract implementations
Implementing IModel
public class CsvProModel extends CachedModel<Integer> {
private Map<String, List<String>> data;
private List<Integer> rows; // Keep track of rows add/delete
@Override
protected Collection<? extends Integer> allContentsFromModel() {
return rows;
}
@Override
protected Object getCacheKeyForType(String type) throws
EolModelElementTypeNotFoundException {
return type;
}
…
Implementing IModel
@Override
protected Collection<Integer> getAllOfTypeFromModel(String type)
throws EolModelElementTypeNotFoundException {
if (!"Row".equals(type)) {
throw new EolModelElementTypeNotFoundException(
this.name, type);
}
return allContents();
}
@Override
protected Collection<Integer> getAllOfKindFromModel(String kind)
throws EolModelElementTypeNotFoundException {
return getAllOfTypeFromModel(kind);
}
Implementing IModel
• Property Getter
private class CsvPropertyGetter extends
AbstractPropertyGetter {
@Override
public Object invoke(Object object,
String property) throws EolRuntimeException {
assert object instanceof Integer;
return data.get(property).get((int) object);
}
}
private Map<String, List<String>> data;
Implementing IModel
• Property Setter
private class CsvPropertySetter extends
AbstractPropertySetter {
@Override
public void invoke(Object value) throws
EolRuntimeException {
data.get(property).set((int) object,
value.toString());
}
}
private Map<String, List<String>> data;
CSV Pro Eclipse-based
Development Tools
org.eclipse.epsilon.emc.csvpro.dt
In a nutshell
• Provide a dialog
to configure the
model
Overview
• CSV Pro Configuration Dialog
• Easy (50 Lines of Code)
• Some SWT knowledge
• Heavily reuse EOL’s DT facilities
• Advise: extend
AbstractCachedModelConfigurationDialog
Activities
Already in place
Add file browser
Add CSV options
Implement Configuration Dialog
public class CsvModelConfigurationDialogue
extends AbstractCachedModelConfigurationDialog {
private Text fileText;
private Text fieldSeparatorText;
private Button knownHeadersBtn;
private Button varargsHeadersBtn;
@Override
protected String getModelName() {
return "CSV Pro model";
}
@Override
protected String getModelType() {
return "CSV Pro";
}
…
Implement Configuration Dialog
@Override
protected void createGroups(Composite control) {
super.createGroups(control);
createFileGroup(control);
createLoadStoreOptionsGroup(control);
createCsvGroup(control);
}
Implement Configuration Dialog
private void createFileGroup(Composite parent) {
final Composite groupContent =
createGroupContainer(parent, "Files", 3);
final Label modelFileLabel = new Label(groupContent,
SWT.NONE);
modelFileLabel.setText("Model file: ");
fileText = new Text(groupContent, SWT.BORDER);
fileText.setLayoutData(
new GridData(GridData.FILL_HORIZONTAL));
final Button browseFile = new Button(groupContent,
SWT.NONE);
browseFile.setText("Browse Workspace...");
browseFile.addListener(SWT.Selection,
new BrowseWorkspaceForModelsListener(fileText,
"CSV files in the workspace",
"Select a CSV file"));
}
Implement Configuration Dialog
protected void createCsvGroup(Composite parent) {
final Composite groupContent = createGroupContainer(parent,
"CSV", 4);
final Label modelFieldSeparatorLabel = new
Label(groupContent, SWT.NONE);
modelFieldSeparatorLabel.setText("Field Separator: ");
fieldSeparatorText = new Text(groupContent, SWT.BORDER);
fieldSeparatorText.setLayoutData(new
GridData(GridData.HORIZONTAL_ALIGN_BEGINNING));
knownHeadersBtn = new Button(groupContent, SWT.CHECK);
knownHeadersBtn.setText("Known Headers");
…
varargsHeadersBtn = new Button(groupContent, SWT.CHECK);
varargsHeadersBtn.setText("Varargs Headers");
}
Hook Model to Epsilon
• We need to tell Epsilon there is a new model type
available
• The name of the model type
• The class that implements the model
• The configuration dialog
• An icon for the launch dialog
• Use org.eclipse.epsilon.common.dt.modelType
Extension Point
• Added using the MANIFEST.MF (Extension tab)
Hook Model to Epsilon
Must match getModelName() Must match getModelType()
@Override
protected String getModelName() {
return "CSV model";
}
@Override
protected String getModelType() {
return "CSV";
}
Hook Model to Epsilon
• Save the user options in a properties object
@Override
protected void storeProperties() {
super.storeProperties();
properties.setProperty(CsvProModel.PROPERTY_FILE,
fileText.getText());
properties.setProperty(
CsvProModel.PROPERTY_FIELD_SEPARATOR,
fieldSeparatorText.getText());
properties.setProperty(
CsvProModel.PROPERTY_HAS_KNOWN_HEADERS,
String.valueOf(knownHeadersBtn.getSelection()));
…
Implementing IModel
• With a configuration in place, we can finish the model
implementation
• Implement load (read additional properties), loadModel
(parse text file) and owns
@Override
public void load(StringProperties properties,
IRelativePathResolver resolver)
throws EolModelLoadingException {
super.load(properties, resolver);
this.file = resolver.resolve(
properties.getProperty(PROPERTY_FILE));
this.fieldSeparator =
properties.getProperty(PROPERTY_FIELD_SEPARATOR);
Cont…
this.knownHeaders =
properties.getBooleanProperty(
PROPERTY_HAS_KNOWN_HEADERS,true);
this.varargsHeaders =
properties.getBooleanProperty(
PROPERTY_HAS_VARARGS_HEADERS,false);
load();
}
@Override
public boolean owns(Object instance) {
return rows.contains(instance);
}
private List<Integer> rows;
Cont…
@Override
protected void loadModel() throws EolModelLoadingException {
…
List<String> keys = Arrays.asList(lines.get(0)
.split(this.fieldSeparator));
for (String k : keys) {
data.put(k, new ArrayList<String>());
}
List<String> values;
for (int i=1; i < lines.size(); i++) {
int index = i-1;
rows.add(index);
values = Arrays.asList(lines.get(i)
.split(this.fieldSeparator));
for (int f=0; f<keys.size(); f++) {
data.get(keys.get(f)).add(values.get(f));
}
}
private Map<String, List<String>> data;
Demo Time
See all is working!
Adding support for types
Support Types
• Modify the DT plugin to pick a field to define the
type
• Add a new label+text to specify field name
• Optional: Parse the CSV file to present headers as
dropdown for selection
• Modify the CSV Pro Model to support types
• Identify types during model loading
• Modify getAllOfTypeFromModel() to support types
• Modify getAllOfKindFromModel() to support types
• Row is a super type of all types
Support Types
• Modify the DT plugin to pick a field to define the
type
Add this
Support Types
• Modify the CSV Pro Model to support types
for (int f=0; f<keys.size(); f++) {
List<String> datavals = data.get(keys.get(f));
if (useTypeColum) {
if (f == typeColum) {
List<Integer> typed =
typedElements.get(values.get(f));
if (typed == null) {
typed = new ArrayList<Integer>();
typedElements.put(values.get(f), typed);
}
typed.add(index);
}
}
datavals.add(values.get(f));
}
Demo Time
See all is working!
Execution optimization
Select operation optimization
Select Operation Overview
m!Row.all().select(r | r.id == "531-52-7468");
for (Object element : list) {
if (element.id = "531-52-7468") {
return element;
}
}
SELECT * FROM ROWS WHERE id = "531-52-7468"
optimize
Epsilon optimization overview
• To provide optimized execution:
• Inform what operations can be optimized
• Provide an implementation of these operations
• Operations that can be optimized
• Collections returned by the model (e.g. from
selectAllOfTypeFromModel) should implement
IAbstractOperationContributor
• Or, the model implements
IAbstractOperationContributor and keep track of
“owned” collections
• Operation implementation
• Extend the operations to be optimized
Optimize select by “id”
• Provide an optimization of the select operation if
the filter field is the id
• Allow the user to specify what column to use for
optimized searches
• Add a data structure to the model that allows fast search
by id (e.g. map)
• Provide a wrapping collection to implement
IAbstractOperationContributor
• Provide a SelectOperation that identifies a select by id
and uses the data model to optimize execution
Optimize select by “id”
• Allow the user to specify what column to use for
optimized searches
Optimize select by “id”
• Add a data structure to the model that allows fast
search by id
private TreeMap<String, Integer> rows;
…
if (useIndexColum && (f == indexColum)) {
rows.put(values.get(f), index);
}
…
Optimize select by “id”
• Provide a wrapping collection to implement
IAbstractOperationContributor
• One possibility is to use the delegate pattern
public class CsvProCollection implements List<Integer>,
IAbstractOperationContributor {
List<Integer> delegate;
…
public boolean contains(Object o) {
return delegate.contains(o);
}
…
@Override
public AbstractOperation getAbstractOperation(String name) {
if ("select".equals(name)) {
return new CsvProCollectionSelectOperation();
}
…
Optimize select by “id”
m!Row.all().select(r | r.id == "531-52-7468");
public Object execute(Object target,
Variable iterator,
Expression ast, IEolContext context,
boolean returnOnFirstMatch)
throws EolRuntimeException {}
asttarget iterator
• SelectOperation that identifies a select by id
Optimize select by “id”
m!Row.all().select(r | r.id == "531-52-7468");
iterator
Assuming SSN has some ordering,
we want to support ==, >, >=, <=, <,
<>. So ast must be:
• EqualsOperatorExpression
• GreaterThanOperatorExpression
• Etc.
FirstOperand
PropertyCallExpression
TargetExpression
r.id
PropertyNameExpression
iterator
matches
“id “ column name
matches
ast
Optimize select by “id”
if (!(ast instanceof EqualsOperatorExpression ||
ast instanceof GreaterThanOperatorExpression ||
ast instanceof GreaterEqualOperatorExpression ||
ast instanceof LessEqualOperatorExpression ||
ast instanceof LessThanOperatorExpression ||
ast instanceof NotEqualsOperatorExpression)) {
return false;
}
Assuming SSN has some ordering, we want to
support ==, >, >=, <=, <, <>. So ast must be:
• EqualsOperatorExpression
• GreaterThanOperatorExpression
• Etc.
final OperatorExpression opExp =
(OperatorExpression) ast;
final Expression rawLOperand =
opExp.getFirstOperand();
if (!(rawLOperand instanceof PropertyCallExpression))
{
return false;
}
Optimize select by “id”
PropertyCallExpression
r.id
final PropertyCallExpression lOperand =
(PropertyCallExpression) rawLOperand;
final Expression rawTargetExpression =
lOperand.getTargetExpression();
if (!(lOperand.getTargetExpression()
instanceof NameExpression)) {
return false;
}
final NameExpression nameExpression =
(NameExpression) rawTargetExpression;
if (!iterator.getName()
.equals(nameExpression.getName())) {
return false;
}
Optimize select by “id”
TargetExpression
r.id
iterator
matches
final NameExpression propertyNameExpression =
lOperand.getPropertyNameExpression();
if (!index.equals(propertyNameExpression.getName())) {
return false;
}
Optimize select by “id”
r.id
PropertyNameExpression
“id “ column name
matches
Demo Time
See all is working!

Weitere ähnliche Inhalte

Was ist angesagt?

Productive Programming in Java 8 - with Lambdas and Streams
Productive Programming in Java 8 - with Lambdas and Streams Productive Programming in Java 8 - with Lambdas and Streams
Productive Programming in Java 8 - with Lambdas and Streams Ganesh Samarthyam
 
Java SE 8 - New Features
Java SE 8 - New FeaturesJava SE 8 - New Features
Java SE 8 - New FeaturesNaveen Hegde
 
Java 8 presentation
Java 8 presentationJava 8 presentation
Java 8 presentationVan Huong
 
Lambda Expressions in Java
Lambda Expressions in JavaLambda Expressions in Java
Lambda Expressions in JavaErhan Bagdemir
 
Functional Programming In Practice
Functional Programming In PracticeFunctional Programming In Practice
Functional Programming In PracticeMichiel Borkent
 
Programming with Lambda Expressions in Java
Programming with Lambda Expressions in Java Programming with Lambda Expressions in Java
Programming with Lambda Expressions in Java langer4711
 
Lambda Expressions in Java 8
Lambda Expressions in Java 8Lambda Expressions in Java 8
Lambda Expressions in Java 8icarter09
 
Scaffolding with JMock
Scaffolding with JMockScaffolding with JMock
Scaffolding with JMockValerio Maggio
 
Introduction to Java 8
Introduction to Java 8Introduction to Java 8
Introduction to Java 8Knoldus Inc.
 
Modern Programming in Java 8 - Lambdas, Streams and Date Time API
Modern Programming in Java 8 - Lambdas, Streams and Date Time APIModern Programming in Java 8 - Lambdas, Streams and Date Time API
Modern Programming in Java 8 - Lambdas, Streams and Date Time APIGanesh Samarthyam
 

Was ist angesagt? (20)

Java 8 features
Java 8 featuresJava 8 features
Java 8 features
 
Productive Programming in Java 8 - with Lambdas and Streams
Productive Programming in Java 8 - with Lambdas and Streams Productive Programming in Java 8 - with Lambdas and Streams
Productive Programming in Java 8 - with Lambdas and Streams
 
Java8
Java8Java8
Java8
 
Java SE 8 - New Features
Java SE 8 - New FeaturesJava SE 8 - New Features
Java SE 8 - New Features
 
Java 8 presentation
Java 8 presentationJava 8 presentation
Java 8 presentation
 
Major Java 8 features
Major Java 8 featuresMajor Java 8 features
Major Java 8 features
 
Java 8 Intro - Core Features
Java 8 Intro - Core FeaturesJava 8 Intro - Core Features
Java 8 Intro - Core Features
 
Lambda Expressions in Java
Lambda Expressions in JavaLambda Expressions in Java
Lambda Expressions in Java
 
Java 8 Lambda and Streams
Java 8 Lambda and StreamsJava 8 Lambda and Streams
Java 8 Lambda and Streams
 
Functional Programming In Practice
Functional Programming In PracticeFunctional Programming In Practice
Functional Programming In Practice
 
Java 8 features
Java 8 featuresJava 8 features
Java 8 features
 
Scala coated JVM
Scala coated JVMScala coated JVM
Scala coated JVM
 
Programming with Lambda Expressions in Java
Programming with Lambda Expressions in Java Programming with Lambda Expressions in Java
Programming with Lambda Expressions in Java
 
Java SE 8 best practices
Java SE 8 best practicesJava SE 8 best practices
Java SE 8 best practices
 
Java 7 New Features
Java 7 New FeaturesJava 7 New Features
Java 7 New Features
 
Java 8 lambda
Java 8 lambdaJava 8 lambda
Java 8 lambda
 
Lambda Expressions in Java 8
Lambda Expressions in Java 8Lambda Expressions in Java 8
Lambda Expressions in Java 8
 
Scaffolding with JMock
Scaffolding with JMockScaffolding with JMock
Scaffolding with JMock
 
Introduction to Java 8
Introduction to Java 8Introduction to Java 8
Introduction to Java 8
 
Modern Programming in Java 8 - Lambdas, Streams and Date Time API
Modern Programming in Java 8 - Lambdas, Streams and Date Time APIModern Programming in Java 8 - Lambdas, Streams and Date Time API
Modern Programming in Java 8 - Lambdas, Streams and Date Time API
 

Ähnlich wie Developing a new Epsilon EMC driver

JavaScript - Chapter 12 - Document Object Model
  JavaScript - Chapter 12 - Document Object Model  JavaScript - Chapter 12 - Document Object Model
JavaScript - Chapter 12 - Document Object ModelWebStackAcademy
 
Functional programming in kotlin with Arrow [Sunnytech 2018]
Functional programming in kotlin with Arrow [Sunnytech 2018]Functional programming in kotlin with Arrow [Sunnytech 2018]
Functional programming in kotlin with Arrow [Sunnytech 2018]Emmanuel Nhan
 
A la découverte de TypeScript
A la découverte de TypeScriptA la découverte de TypeScript
A la découverte de TypeScriptDenis Voituron
 
APPLICATION TO DOCUMENT ALL THE DETAILS OF JAVA CLASSES OF A PROJECT AT ONCE...
APPLICATION TO DOCUMENT ALL THE  DETAILS OF JAVA CLASSES OF A PROJECT AT ONCE...APPLICATION TO DOCUMENT ALL THE  DETAILS OF JAVA CLASSES OF A PROJECT AT ONCE...
APPLICATION TO DOCUMENT ALL THE DETAILS OF JAVA CLASSES OF A PROJECT AT ONCE...DEEPANSHU GUPTA
 
New features and enhancement
New features and enhancementNew features and enhancement
New features and enhancementRakesh Madugula
 
Text field and textarea
Text field and textareaText field and textarea
Text field and textareamyrajendra
 
Rich Internet Applications con JavaFX e NetBeans
Rich Internet Applications  con JavaFX e NetBeans Rich Internet Applications  con JavaFX e NetBeans
Rich Internet Applications con JavaFX e NetBeans Fabrizio Giudici
 
dotNet Miami - June 21, 2012: Richie Rump: Entity Framework: Code First and M...
dotNet Miami - June 21, 2012: Richie Rump: Entity Framework: Code First and M...dotNet Miami - June 21, 2012: Richie Rump: Entity Framework: Code First and M...
dotNet Miami - June 21, 2012: Richie Rump: Entity Framework: Code First and M...dotNet Miami
 
Entity Framework: Code First and Magic Unicorns
Entity Framework: Code First and Magic UnicornsEntity Framework: Code First and Magic Unicorns
Entity Framework: Code First and Magic UnicornsRichie Rump
 
11. session 11 functions and objects
11. session 11   functions and objects11. session 11   functions and objects
11. session 11 functions and objectsPhúc Đỗ
 
Templates presentation
Templates presentationTemplates presentation
Templates presentationmalaybpramanik
 
Intake 38 data access 5
Intake 38 data access 5Intake 38 data access 5
Intake 38 data access 5Mahmoud Ouf
 

Ähnlich wie Developing a new Epsilon EMC driver (20)

JavaScript - Chapter 12 - Document Object Model
  JavaScript - Chapter 12 - Document Object Model  JavaScript - Chapter 12 - Document Object Model
JavaScript - Chapter 12 - Document Object Model
 
What is new in Java 8
What is new in Java 8What is new in Java 8
What is new in Java 8
 
Functional programming in kotlin with Arrow [Sunnytech 2018]
Functional programming in kotlin with Arrow [Sunnytech 2018]Functional programming in kotlin with Arrow [Sunnytech 2018]
Functional programming in kotlin with Arrow [Sunnytech 2018]
 
A la découverte de TypeScript
A la découverte de TypeScriptA la découverte de TypeScript
A la découverte de TypeScript
 
APPLICATION TO DOCUMENT ALL THE DETAILS OF JAVA CLASSES OF A PROJECT AT ONCE...
APPLICATION TO DOCUMENT ALL THE  DETAILS OF JAVA CLASSES OF A PROJECT AT ONCE...APPLICATION TO DOCUMENT ALL THE  DETAILS OF JAVA CLASSES OF A PROJECT AT ONCE...
APPLICATION TO DOCUMENT ALL THE DETAILS OF JAVA CLASSES OF A PROJECT AT ONCE...
 
Scala in Places API
Scala in Places APIScala in Places API
Scala in Places API
 
New features and enhancement
New features and enhancementNew features and enhancement
New features and enhancement
 
Intake 37 ef2
Intake 37 ef2Intake 37 ef2
Intake 37 ef2
 
2CPP15 - Templates
2CPP15 - Templates2CPP15 - Templates
2CPP15 - Templates
 
Text field and textarea
Text field and textareaText field and textarea
Text field and textarea
 
Rich Internet Applications con JavaFX e NetBeans
Rich Internet Applications  con JavaFX e NetBeans Rich Internet Applications  con JavaFX e NetBeans
Rich Internet Applications con JavaFX e NetBeans
 
srgoc
srgocsrgoc
srgoc
 
dotNet Miami - June 21, 2012: Richie Rump: Entity Framework: Code First and M...
dotNet Miami - June 21, 2012: Richie Rump: Entity Framework: Code First and M...dotNet Miami - June 21, 2012: Richie Rump: Entity Framework: Code First and M...
dotNet Miami - June 21, 2012: Richie Rump: Entity Framework: Code First and M...
 
Templates2
Templates2Templates2
Templates2
 
Entity Framework: Code First and Magic Unicorns
Entity Framework: Code First and Magic UnicornsEntity Framework: Code First and Magic Unicorns
Entity Framework: Code First and Magic Unicorns
 
2CPP16 - STL
2CPP16 - STL2CPP16 - STL
2CPP16 - STL
 
11. session 11 functions and objects
11. session 11   functions and objects11. session 11   functions and objects
11. session 11 functions and objects
 
Templates presentation
Templates presentationTemplates presentation
Templates presentation
 
XAML/C# to HTML/JS
XAML/C# to HTML/JSXAML/C# to HTML/JS
XAML/C# to HTML/JS
 
Intake 38 data access 5
Intake 38 data access 5Intake 38 data access 5
Intake 38 data access 5
 

Kürzlich hochgeladen

A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityMorshed Ahmed Rahath
 
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptxJIT KUMAR GUPTA
 
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...Call Girls Mumbai
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptMsecMca
 
Bridge Jacking Design Sample Calculation.pptx
Bridge Jacking Design Sample Calculation.pptxBridge Jacking Design Sample Calculation.pptx
Bridge Jacking Design Sample Calculation.pptxnuruddin69
 
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxS1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxSCMS School of Architecture
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdfKamal Acharya
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXssuser89054b
 
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best ServiceTamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Servicemeghakumariji156
 
DeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesDeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesMayuraD1
 
Rums floating Omkareshwar FSPV IM_16112021.pdf
Rums floating Omkareshwar FSPV IM_16112021.pdfRums floating Omkareshwar FSPV IM_16112021.pdf
Rums floating Omkareshwar FSPV IM_16112021.pdfsmsksolar
 
+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...
+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...
+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...Health
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfJiananWang21
 
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxHOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxSCMS School of Architecture
 
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments""Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"mphochane1998
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayEpec Engineered Technologies
 
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills KuwaitKuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwaitjaanualu31
 
Air Compressor reciprocating single stage
Air Compressor reciprocating single stageAir Compressor reciprocating single stage
Air Compressor reciprocating single stageAbc194748
 
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptxA CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptxmaisarahman1
 

Kürzlich hochgeladen (20)

A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna Municipality
 
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
 
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.ppt
 
Bridge Jacking Design Sample Calculation.pptx
Bridge Jacking Design Sample Calculation.pptxBridge Jacking Design Sample Calculation.pptx
Bridge Jacking Design Sample Calculation.pptx
 
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxS1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdf
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best ServiceTamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
 
DeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesDeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakes
 
Rums floating Omkareshwar FSPV IM_16112021.pdf
Rums floating Omkareshwar FSPV IM_16112021.pdfRums floating Omkareshwar FSPV IM_16112021.pdf
Rums floating Omkareshwar FSPV IM_16112021.pdf
 
+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...
+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...
+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdf
 
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxHOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
 
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments""Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
 
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills KuwaitKuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
 
Air Compressor reciprocating single stage
Air Compressor reciprocating single stageAir Compressor reciprocating single stage
Air Compressor reciprocating single stage
 
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptxA CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
 

Developing a new Epsilon EMC driver

  • 1. Developing a new Epsilon EMC Driver: CSV Pro Horacio Hoyos @HoracioHoyosR
  • 3. CSV Pro Driver • A EMC Driver for Comma Separated Value (CSV) with added functionality • Each row is an element • Each column is an attribute • NEW: • One column to identify type • One column used as index – optimized search
  • 4. Overview • Two Eclipse plugins • One for the EMC driver implementation • org.eclipse.epsilon.emc.csvpro • Implement IModel interface • Provide Property Getter and Setter • Provide optimized select operations • Can run outside eclipse • One for the driver’s Eclipse-based development tools • org.eclipse.epsilon.emc.csvpro.dt • Source code available under https://git.eclipse.org/c/epsilon/org.eclipse.epsilon .git/tree/examples
  • 5. EMC Driver Overview General architecture and implementation
  • 6. Epsilon EOL Engine Overview for (e in m!Row.all()) { e.name.println(); e.name = “Epsilon”; } Model identifier All of Type Get property ‘name’ of the element Set property ‘name’ of the element
  • 7. Activities • Provide an implementation of the IModel interface • Retrieve the model • Get all elements of the model • Get all elements of the model by type • Provide an implementation of IPropertyGetter • Retrieve the value of a property • Provide an implementation of IPropertySetter • Set the value of a property
  • 9. Alternatives • Provide a custom implementation of the data model - e.g. custom file parser • CSV, Bibtex, FileSystem, etc… • Use the data model engine/framework – e.g. wrap existing file parser • Databases, EMF, XML, etc…
  • 10. CSV Pro EMC Driver org.eclipse.epsilon.emc.csvpro
  • 11. Implementing IModel • Easy: extend CachedModel (org.eclipse.epsilon.eol.models.Cached Model<ModelElementType>) • Cached model improves performance • Basic implementation of most methods • Hard: Implement all the interface
  • 12. Implementing IModel • How to represent the data? • Existing: Each Row is a Map <property: value>, the model is a list of maps • Alternative: Each Row is an Integer (representing line number), the model is a Map <property: List<values>>, list of values indexed by row • Implement IPropertyGetter and IPropertyGetter • Advice: Extend the existing abstract implementations
  • 13. Implementing IModel public class CsvProModel extends CachedModel<Integer> { private Map<String, List<String>> data; private List<Integer> rows; // Keep track of rows add/delete @Override protected Collection<? extends Integer> allContentsFromModel() { return rows; } @Override protected Object getCacheKeyForType(String type) throws EolModelElementTypeNotFoundException { return type; } …
  • 14. Implementing IModel @Override protected Collection<Integer> getAllOfTypeFromModel(String type) throws EolModelElementTypeNotFoundException { if (!"Row".equals(type)) { throw new EolModelElementTypeNotFoundException( this.name, type); } return allContents(); } @Override protected Collection<Integer> getAllOfKindFromModel(String kind) throws EolModelElementTypeNotFoundException { return getAllOfTypeFromModel(kind); }
  • 15. Implementing IModel • Property Getter private class CsvPropertyGetter extends AbstractPropertyGetter { @Override public Object invoke(Object object, String property) throws EolRuntimeException { assert object instanceof Integer; return data.get(property).get((int) object); } } private Map<String, List<String>> data;
  • 16. Implementing IModel • Property Setter private class CsvPropertySetter extends AbstractPropertySetter { @Override public void invoke(Object value) throws EolRuntimeException { data.get(property).set((int) object, value.toString()); } } private Map<String, List<String>> data;
  • 17. CSV Pro Eclipse-based Development Tools org.eclipse.epsilon.emc.csvpro.dt
  • 18. In a nutshell • Provide a dialog to configure the model
  • 19. Overview • CSV Pro Configuration Dialog • Easy (50 Lines of Code) • Some SWT knowledge • Heavily reuse EOL’s DT facilities • Advise: extend AbstractCachedModelConfigurationDialog
  • 20. Activities Already in place Add file browser Add CSV options
  • 21. Implement Configuration Dialog public class CsvModelConfigurationDialogue extends AbstractCachedModelConfigurationDialog { private Text fileText; private Text fieldSeparatorText; private Button knownHeadersBtn; private Button varargsHeadersBtn; @Override protected String getModelName() { return "CSV Pro model"; } @Override protected String getModelType() { return "CSV Pro"; } …
  • 22. Implement Configuration Dialog @Override protected void createGroups(Composite control) { super.createGroups(control); createFileGroup(control); createLoadStoreOptionsGroup(control); createCsvGroup(control); }
  • 23. Implement Configuration Dialog private void createFileGroup(Composite parent) { final Composite groupContent = createGroupContainer(parent, "Files", 3); final Label modelFileLabel = new Label(groupContent, SWT.NONE); modelFileLabel.setText("Model file: "); fileText = new Text(groupContent, SWT.BORDER); fileText.setLayoutData( new GridData(GridData.FILL_HORIZONTAL)); final Button browseFile = new Button(groupContent, SWT.NONE); browseFile.setText("Browse Workspace..."); browseFile.addListener(SWT.Selection, new BrowseWorkspaceForModelsListener(fileText, "CSV files in the workspace", "Select a CSV file")); }
  • 24. Implement Configuration Dialog protected void createCsvGroup(Composite parent) { final Composite groupContent = createGroupContainer(parent, "CSV", 4); final Label modelFieldSeparatorLabel = new Label(groupContent, SWT.NONE); modelFieldSeparatorLabel.setText("Field Separator: "); fieldSeparatorText = new Text(groupContent, SWT.BORDER); fieldSeparatorText.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING)); knownHeadersBtn = new Button(groupContent, SWT.CHECK); knownHeadersBtn.setText("Known Headers"); … varargsHeadersBtn = new Button(groupContent, SWT.CHECK); varargsHeadersBtn.setText("Varargs Headers"); }
  • 25. Hook Model to Epsilon • We need to tell Epsilon there is a new model type available • The name of the model type • The class that implements the model • The configuration dialog • An icon for the launch dialog • Use org.eclipse.epsilon.common.dt.modelType Extension Point • Added using the MANIFEST.MF (Extension tab)
  • 26. Hook Model to Epsilon Must match getModelName() Must match getModelType() @Override protected String getModelName() { return "CSV model"; } @Override protected String getModelType() { return "CSV"; }
  • 27. Hook Model to Epsilon • Save the user options in a properties object @Override protected void storeProperties() { super.storeProperties(); properties.setProperty(CsvProModel.PROPERTY_FILE, fileText.getText()); properties.setProperty( CsvProModel.PROPERTY_FIELD_SEPARATOR, fieldSeparatorText.getText()); properties.setProperty( CsvProModel.PROPERTY_HAS_KNOWN_HEADERS, String.valueOf(knownHeadersBtn.getSelection())); …
  • 28. Implementing IModel • With a configuration in place, we can finish the model implementation • Implement load (read additional properties), loadModel (parse text file) and owns @Override public void load(StringProperties properties, IRelativePathResolver resolver) throws EolModelLoadingException { super.load(properties, resolver); this.file = resolver.resolve( properties.getProperty(PROPERTY_FILE)); this.fieldSeparator = properties.getProperty(PROPERTY_FIELD_SEPARATOR);
  • 30. Cont… @Override protected void loadModel() throws EolModelLoadingException { … List<String> keys = Arrays.asList(lines.get(0) .split(this.fieldSeparator)); for (String k : keys) { data.put(k, new ArrayList<String>()); } List<String> values; for (int i=1; i < lines.size(); i++) { int index = i-1; rows.add(index); values = Arrays.asList(lines.get(i) .split(this.fieldSeparator)); for (int f=0; f<keys.size(); f++) { data.get(keys.get(f)).add(values.get(f)); } } private Map<String, List<String>> data;
  • 31. Demo Time See all is working!
  • 33. Support Types • Modify the DT plugin to pick a field to define the type • Add a new label+text to specify field name • Optional: Parse the CSV file to present headers as dropdown for selection • Modify the CSV Pro Model to support types • Identify types during model loading • Modify getAllOfTypeFromModel() to support types • Modify getAllOfKindFromModel() to support types • Row is a super type of all types
  • 34. Support Types • Modify the DT plugin to pick a field to define the type Add this
  • 35. Support Types • Modify the CSV Pro Model to support types for (int f=0; f<keys.size(); f++) { List<String> datavals = data.get(keys.get(f)); if (useTypeColum) { if (f == typeColum) { List<Integer> typed = typedElements.get(values.get(f)); if (typed == null) { typed = new ArrayList<Integer>(); typedElements.put(values.get(f), typed); } typed.add(index); } } datavals.add(values.get(f)); }
  • 36. Demo Time See all is working!
  • 38. Select Operation Overview m!Row.all().select(r | r.id == "531-52-7468"); for (Object element : list) { if (element.id = "531-52-7468") { return element; } } SELECT * FROM ROWS WHERE id = "531-52-7468" optimize
  • 39. Epsilon optimization overview • To provide optimized execution: • Inform what operations can be optimized • Provide an implementation of these operations • Operations that can be optimized • Collections returned by the model (e.g. from selectAllOfTypeFromModel) should implement IAbstractOperationContributor • Or, the model implements IAbstractOperationContributor and keep track of “owned” collections • Operation implementation • Extend the operations to be optimized
  • 40. Optimize select by “id” • Provide an optimization of the select operation if the filter field is the id • Allow the user to specify what column to use for optimized searches • Add a data structure to the model that allows fast search by id (e.g. map) • Provide a wrapping collection to implement IAbstractOperationContributor • Provide a SelectOperation that identifies a select by id and uses the data model to optimize execution
  • 41. Optimize select by “id” • Allow the user to specify what column to use for optimized searches
  • 42. Optimize select by “id” • Add a data structure to the model that allows fast search by id private TreeMap<String, Integer> rows; … if (useIndexColum && (f == indexColum)) { rows.put(values.get(f), index); } …
  • 43. Optimize select by “id” • Provide a wrapping collection to implement IAbstractOperationContributor • One possibility is to use the delegate pattern public class CsvProCollection implements List<Integer>, IAbstractOperationContributor { List<Integer> delegate; … public boolean contains(Object o) { return delegate.contains(o); } … @Override public AbstractOperation getAbstractOperation(String name) { if ("select".equals(name)) { return new CsvProCollectionSelectOperation(); } …
  • 44. Optimize select by “id” m!Row.all().select(r | r.id == "531-52-7468"); public Object execute(Object target, Variable iterator, Expression ast, IEolContext context, boolean returnOnFirstMatch) throws EolRuntimeException {} asttarget iterator • SelectOperation that identifies a select by id
  • 45. Optimize select by “id” m!Row.all().select(r | r.id == "531-52-7468"); iterator Assuming SSN has some ordering, we want to support ==, >, >=, <=, <, <>. So ast must be: • EqualsOperatorExpression • GreaterThanOperatorExpression • Etc. FirstOperand PropertyCallExpression TargetExpression r.id PropertyNameExpression iterator matches “id “ column name matches ast
  • 46. Optimize select by “id” if (!(ast instanceof EqualsOperatorExpression || ast instanceof GreaterThanOperatorExpression || ast instanceof GreaterEqualOperatorExpression || ast instanceof LessEqualOperatorExpression || ast instanceof LessThanOperatorExpression || ast instanceof NotEqualsOperatorExpression)) { return false; } Assuming SSN has some ordering, we want to support ==, >, >=, <=, <, <>. So ast must be: • EqualsOperatorExpression • GreaterThanOperatorExpression • Etc.
  • 47. final OperatorExpression opExp = (OperatorExpression) ast; final Expression rawLOperand = opExp.getFirstOperand(); if (!(rawLOperand instanceof PropertyCallExpression)) { return false; } Optimize select by “id” PropertyCallExpression r.id
  • 48. final PropertyCallExpression lOperand = (PropertyCallExpression) rawLOperand; final Expression rawTargetExpression = lOperand.getTargetExpression(); if (!(lOperand.getTargetExpression() instanceof NameExpression)) { return false; } final NameExpression nameExpression = (NameExpression) rawTargetExpression; if (!iterator.getName() .equals(nameExpression.getName())) { return false; } Optimize select by “id” TargetExpression r.id iterator matches
  • 49. final NameExpression propertyNameExpression = lOperand.getPropertyNameExpression(); if (!index.equals(propertyNameExpression.getName())) { return false; } Optimize select by “id” r.id PropertyNameExpression “id “ column name matches
  • 50. Demo Time See all is working!

Hinweis der Redaktion

  1. Lets examine an EOL expression: A loop over all elements of type Row. Print the name attribute of each row The model identifier tells the engine what model to use (from configuration – discussed later) Get all elements of the given type Get the value of a property Set the value of a property All elements by type is used by ETL, EVL, etc… to apply a rule to all elements of the context of the rule
  2. There are two alternatives to providing a driver. Provide a custom implementation of the date model. You code the Java to interact with the model Use an existing engine/framework to work with the data. The framework provides the functionality, the driver is just a proxy.
  3. First decision is how to represent the data. Own data structure, maps, lists, etc.. Extend the property managers, unless you need to
  4. Our elements would be Integers that represent the line number of each row Data stores the information of each colum. To get a value for a row the List can be indexed by row number Since we extended CachedModel, it is important to implement getCacheKeyForType. The simplest is to just return the type.
  5. We only support the ROW type getAllOfKindFromModel just calls all of type, we don’t support inheritance. In a driver with a metamodel that supports inheritance then all of kind will be different. For example suing instanceOf if the framework provides a Java implementation.
  6. We use an inner class that has access to the data
  7. We use an inner class that has access to the data Note that this very simple implementation does not have any type checking, object ownership, property validation, etc.. IT IS VERY FRAGILE Remember to return instances of these classes in your getPropertySetter/Getter methods
  8. We need to allow the user to provide information about the model. DO NOT EXPLAIN THE FIELDS HERE
  9. What needs to be configured? Identification, cache and load/store exists from AbstractCachedModelConfigurationDialog We need a browser to select the CSV file WE need some additional CSV options
  10. One Text field for the file location One Text field for the separator Two buttons, headers and varargs The getModelName/Type is important, later it needs to match the extension point configuration
  11. Next we will see a bit of the SWT code that is involved.
  12. BrowseWorkspaceForModelsListener is provided by the dt tools
  13. Field separator because CSV can use dot, space, tab, semicolon, etc. Headers are the 1st of the file that indicates the name of each colum Varargs Headers if a row can have more columns than the headers
  14. We need to inform the Epsilon Framework that there is a new type of model. We use Eclipse support (OSGI)
  15. The user can now use the launch configuration to provide the model information. We need to save the information so then we can use it to load the model.
  16. Create the constants in the model Class. When loading the model we have access to the properties object. Next we use these properties to load the model. Finish the implementation of the model
  17. We also add an implementation of “owns”
  18. With out going into much detail, we read all the lines in the file. Use the first line to get the property names, then store the data in the Map
  19. Maybe debug to follow code?
  20. Not showing the details of the implementation
  21. Not showing the details of the implementation
  22. Maybe debug to follow code?
  23. Suppose you want to find an element that matches a particular attribute value, e.g. find some one by id (social security number) When you do a select operation, there is a for loop behind the scenes If supported by the model data, this could be optimized, e.g. in a database by doing a direct SELECT on the DB, thus delegating the search to the backend
  24. Not going to show details, it is identical to type column selection
  25. All interface methods delegated to the delegate list. WE optimize select operation, we could add others.
  26. Lets analyze the select operation to determine if we can optimize it Execute is the method in the SelectOperation class we want to overwrite Target should be a CsvProCollection
  27. Lets analyze the select operation to determine if we can optimize it
  28. For further details look at the code!
  29. Maybe debug to follow code?