SlideShare une entreprise Scribd logo
1  sur  30
Xbase:
Implementing Specific
Domain language for JAVA
ABSTRACT
❏ DSLs implemented with Xtext and similar tools focus on structural aspects
such as service specifications and entities.
❏ This approach introduces complex integration patterns and the DSL’s high
level of abstraction is compromised.
❏ We present Xbase as part of Xtext, an expression language.
❏ Xbase expressions provide both control structures and program expressions in
a uniform way.
❏ Xbase is statically typed and tightly integrated with the Java type system.
OUTLINE
➢ Summary
➢ Our Own View
➢ References
1. Introduction
2. The XText Framework
3. The Design of the Reusable
Language XBase
4. Application of XBase
5. Related Work
1. Introduction
❏ The simplicity and application-specific syntax of DSLs increases the
readability as well as the density of information.
❏ There are two different but converging approaches for designing DSLs.
1) External DSLs
❏ An external DSL is a completely independent language built from scratch.
❏ More popular examples for external DSLs are SQL or the Extended Backus-
Naur Form (EBNF) to easily interact with relational databases or representing
formal grammars, respectively.
2) Internal DSL
❏ Also called embedded DSL
❏ An internal DSL leverages a so called host language to solve domain-
specific problems.
❏ As internal DSLs are defined on top of a general purpose programming
language, their syntax is constrained to what the host language allows.
❏ The advantage is that no new language infrastructure needs to be
built, because the parser and compiler of the host language is used.
2. The Xtext Framework
❏ Xtext is an extensible language development framework covering all
aspects of language infrastructure such as parsers, linkers, compilers,
interpreters, intercepts and full-down IDE support based on Eclipse.
❏ Applications: academic and industrial purpose
2.1 A Simple Domain Model Language
❏ How to build DSLs using XText?
- grammar org.example.domainmodel DomainModel with
Org.eclipse.xtext.common.Terminal
- generate domainmodel
“http://www.example.org/Domainmodel/Domainmodel”
- Domainmodel :
elements+-Types*;
- Type:
Data Type | Entity;
- DataType:
‘datatype’ name =ID;
- Entity:
‘entity’name =ID(‘extends’ superType = [Entity])?’
{‘
features += Feature*
‘}’
- Feature:
name = ID ‘:’ type = [Type]
;
2.2 TOOL CHAIN ADAPTABILITY
❏ To allow for arbitrary adaptation of the default functionality, the Xtext
framework makes heavy use of dependency injection pattern.
❏ Dependency injection allows one to control which concrete
implementations are used in a language configuration. Thus it provide
default behavior for most aspect of language infrastructure.
2.3 Language Inheritance
❏ Xtext supports language inheritance which allows to reuse an existing
grammar.it is similar to object oriented languages, the symbols
(terminals and nonterminals) of the parent grammar can be used as if
they were defined in the inheriting grammar.
❏ Xbase expressions resemble Java’s expressions and statements in
terms of syntax and semantics.
❏ Xbase expressions support advanced concepts such as type inference,
extension methods.
❏ In addition, it provides the integration of the expression language with
an Eclipse IDE.
3. Design of the Reusable Expression
Language XBase
3.1 Expressions
❏ Expressions are the main language constructs that are used to express
behavior and computation of values.
3.1.1 Type Interface
❏ Xbase allows one to omit the redundant of types, because types can be
inferred from the expression on the right-hand side.
3.1.2 Lambda Expression
Xbase also captures the current scope such that any final variables and
parameters visible at construction time can be referred to in the
lambda expression’s body.
3.1.3 Operator Overloading
❏ The semantics and the applicability of operators is not hard-coded into
the language.
❏ Xbase language in a DSL definition, it is also possible to introduce new
operators and define a method mapping for them.
3.2 Extension Methods
❏ A method that can be invoked as if it were a member of a certain type,
although it is defined elsewhere.
❏ Argument of an extension method becomes the receiver.
❏ Xbase’s standard library comes with many useful extension, such as
java.lang.String, java.util.List, etc.
❏ An alternative is to have them looked up by a certain naming
convention.
3.3 Model Inference
❏ Constructor invocations, as a representation of arbitrary models. It
based on the AST of a DSL script.
❏ Xbase uses the type model during type and method resolution.
❏ For example, a property in the domain model language might be
translated to a Java field and two Java methods,
4. APPLICATION OF Xbase
❏ In this section we present two examples of how Xbase
can be applied to develop DSLs.
❏ We add support for operations, the Java type system, and
for building web services.
❏ In the second example we show how the Xtend programming language
is implemented based on Xbase.
4.1 Xtend
❏ Xtend is a statically typed, functional, and object-
oriented programming language for the JVM.
❏ Xtend is developed at Eclipse.org and is freely available under
the Eclipse Public License (EPL), similar to Xtext.
❏ Its primary goal is to provide a significantly concise notation
❏ The language improves on Java by removing the need for writing
redundant and superfluous information.
❏ Xtend’s template expressions are designed to concatenate strings.
❏ Xtend reuses the concepts and even the keywords of Java, such
that new users can feel comfortable immediately.
❏ Xtend classes can declare members, i.e., fields and methods.
❏ Xtend derives its name from its extensive support of extension
methods.
Multimethods in Xtends
1. class MultiMethods {
2. def dispatch overloaded(String s) {
3. return ’string’
4. }
5. def dispatch overloaded(Object s) {
6. return ’object’
7. }
8. }
Multi Methods in Xtend (JAVA code)
1. public class MultiMethods {
2. protected String overloaded(String s) {
3. return ”string”;
4. }
5. protected String overloaded(Object s) {
6. return ”object”;
7. }
8. public String overloaded(Object s) {
9. if (s instanceof String)
10. return overloaded((String)s);
11. else
12. return overloaded(s);
13. }
14. }
5. RELATED WORK
❏ The authors presents Xtext as a framework for implementing external
DSLs
5.1 External DSL Frameworks
❏ Several frameworks for external DSL development exist besides Xtext.
❏ The Meta Programming System (MPS) by JetBrains 10 is another DSL
development tool.
❏ Xtext, the use of projectional editing prevents the tooling from
stumbling over syntactic ambiguities in the DSL
5.2 INTERNAL DSLs
❏ In contrast to external DSLs, for which special editors and compilers
have to be developed
❏ For developing internal DSLs, some languages have proved to be well-
suited, due to their flexible syntax
5.2.1 Groovy
❏ Groovy is a dynamically typed language that runs on the Java Virtual
Machine
5.2.2 Scala
❏ Scala is a statically typed language for the JVM.
❏ It is a blend of functional and object-oriented concepts and is often
used as a host language for DSLs.
❏ These efforts demonstrate how general purpose languages are
enhanced to support the advantages of external DSLs.
6. CONCLUSIONS AND FUTURE WORK
❏ We discussed the main concepts of the design and implementation of the Xbase
language and demonstrated its application to two different languages.
❏ Xbase has been available for less than a year, Xbase has been already employed
in industry and open-source projects.
❏ For the future, the authors plan to Xbase expressions to other target languages,
such as JavaScript, C and Objective-C.
Summary
❏ Xbase language by giving an overview on design goals and some
examples for Xbase expressions.
❏ The authors take a look at some other work in applications of Xbase
field and relate it to Xbase.
❏ The authors illustrated Xbase expressions resemble Java’s expressions
and statements in terms of syntax and semantics.
❏ The authors present examples of how Xbase can be applied to develop
DSLs, an extension to the introductory Xtext and Xtend programming
language is implemented based on Xbase.
OUR OWN VIEW
Strength
❏ The Authors illustrated that how Xbase integrates with Java.
❏ This paper Xbase, Which can be integrated into Xtext language development
framework.
❏ The Authors discussed the main concept of the design and implementation
of Xbase
Weakness
❏ To support Xtext this Xbase Programming Language Designed.
❏ XBase could not add GUI capabilities fast enough. there was no de-factor
OOP standard for XBase object orientation
1. [12]J. Hughes. Why functional programming matters. In D.A. Turner, editor,
Research Topics in Functional Programming, pages 17–42. Addison Wesley, 1990.
2. [1]Hassan Chafi, Zach DeVito, Adriaan Moors, Tiark Rompf, Arvind Sujeeth, Pat
Hanrahan, Martin Odersky, and Kunle Olukotun. Language Virtualization for
Heterogeneous Parallel Computing. Technical report, EPFL, 2010.
REFERENCES
3. [13]Lennart C. L. Kats and Eelco Visser. The Spoofax language
workbench. Rules for declarative specification of languages and IDEs.
In Martin Rinard, editor, Proceedings of the 25th Annual ACM SIGPLAN
Conference on Object-Oriented Programming, Systems, Languages,
and Applications (OOPSLA), pages 444–463, October 2010.
4. [7] Holger Krahn, Bernhard Rumpe, and Steven V¨olkel. MontiCore: a
Framework for Compositional Development of Domain Specific
Languages. International Journal on Software Tools for Technology
Transfer (STTT), 12:353–372, September 2010.
“ Thank You..

Contenu connexe

Tendances

Xml processing-by-asfak
Xml processing-by-asfakXml processing-by-asfak
Xml processing-by-asfakAsfak Mahamud
 
Chapter1pp
Chapter1ppChapter1pp
Chapter1ppJ. C.
 
Object oriented vs. object based programming
Object oriented vs. object based  programmingObject oriented vs. object based  programming
Object oriented vs. object based programmingMohammad Kamrul Hasan
 
Introduction to object oriented language
Introduction to object oriented languageIntroduction to object oriented language
Introduction to object oriented languagefarhan amjad
 
principle of oop’s in cpp
principle of oop’s in cppprinciple of oop’s in cpp
principle of oop’s in cppgourav kottawar
 
Object oriented programming concepts
Object oriented programming conceptsObject oriented programming concepts
Object oriented programming conceptsrahuld115
 
Object Oriented Programming
Object Oriented ProgrammingObject Oriented Programming
Object Oriented ProgrammingHaris Bin Zahid
 
Object oriented programming concept
Object oriented programming conceptObject oriented programming concept
Object oriented programming conceptPina Parmar
 
Object oriented database concepts
Object oriented database conceptsObject oriented database concepts
Object oriented database conceptsTemesgenthanks
 
Concepts In Object Oriented Programming Languages
Concepts In Object Oriented Programming LanguagesConcepts In Object Oriented Programming Languages
Concepts In Object Oriented Programming Languagesppd1961
 
1 unit (oops)
1 unit (oops)1 unit (oops)
1 unit (oops)Jay Patel
 

Tendances (20)

CBOR - The Better JSON
CBOR - The Better JSONCBOR - The Better JSON
CBOR - The Better JSON
 
Xml databases
Xml databasesXml databases
Xml databases
 
Xml processing-by-asfak
Xml processing-by-asfakXml processing-by-asfak
Xml processing-by-asfak
 
Chapter1pp
Chapter1ppChapter1pp
Chapter1pp
 
Protocol Buffers
Protocol BuffersProtocol Buffers
Protocol Buffers
 
Object oriented vs. object based programming
Object oriented vs. object based  programmingObject oriented vs. object based  programming
Object oriented vs. object based programming
 
Introduction to object oriented language
Introduction to object oriented languageIntroduction to object oriented language
Introduction to object oriented language
 
Java stereams
Java stereamsJava stereams
Java stereams
 
Dart
DartDart
Dart
 
Oops
OopsOops
Oops
 
principle of oop’s in cpp
principle of oop’s in cppprinciple of oop’s in cpp
principle of oop’s in cpp
 
Object oriented programming concepts
Object oriented programming conceptsObject oriented programming concepts
Object oriented programming concepts
 
Memory models in c#
Memory models in c#Memory models in c#
Memory models in c#
 
Xml dom
Xml domXml dom
Xml dom
 
Object Oriented Programming
Object Oriented ProgrammingObject Oriented Programming
Object Oriented Programming
 
Object oriented programming concept
Object oriented programming conceptObject oriented programming concept
Object oriented programming concept
 
Characteristics of oop
Characteristics of oopCharacteristics of oop
Characteristics of oop
 
Object oriented database concepts
Object oriented database conceptsObject oriented database concepts
Object oriented database concepts
 
Concepts In Object Oriented Programming Languages
Concepts In Object Oriented Programming LanguagesConcepts In Object Oriented Programming Languages
Concepts In Object Oriented Programming Languages
 
1 unit (oops)
1 unit (oops)1 unit (oops)
1 unit (oops)
 

Similaire à Xbase implementing specific domain language for java

Similaire à Xbase implementing specific domain language for java (20)

Scam 08
Scam 08Scam 08
Scam 08
 
Stay fresh
Stay freshStay fresh
Stay fresh
 
Difference between xml and json
Difference between xml and jsonDifference between xml and json
Difference between xml and json
 
Unit 1 - TypeScript & Introduction to Angular CLI.pptx
Unit 1 - TypeScript & Introduction to Angular CLI.pptxUnit 1 - TypeScript & Introduction to Angular CLI.pptx
Unit 1 - TypeScript & Introduction to Angular CLI.pptx
 
Groovy DSL
Groovy DSLGroovy DSL
Groovy DSL
 
TI1220 Lecture 14: Domain-Specific Languages
TI1220 Lecture 14: Domain-Specific LanguagesTI1220 Lecture 14: Domain-Specific Languages
TI1220 Lecture 14: Domain-Specific Languages
 
Metamorphic Domain-Specific Languages
Metamorphic Domain-Specific LanguagesMetamorphic Domain-Specific Languages
Metamorphic Domain-Specific Languages
 
Introduction to JavaScript
Introduction to JavaScriptIntroduction to JavaScript
Introduction to JavaScript
 
Introduction to mean and mern || Event by DSC UNIDEB
Introduction to mean and mern || Event by DSC UNIDEBIntroduction to mean and mern || Event by DSC UNIDEB
Introduction to mean and mern || Event by DSC UNIDEB
 
An introduction to_programming_with_c__threads 2005
An introduction to_programming_with_c__threads 2005An introduction to_programming_with_c__threads 2005
An introduction to_programming_with_c__threads 2005
 
Type script
Type scriptType script
Type script
 
Copmuter Languages
Copmuter LanguagesCopmuter Languages
Copmuter Languages
 
Creating a textual domain specific language
Creating a textual domain specific languageCreating a textual domain specific language
Creating a textual domain specific language
 
Programming in Scala - Lecture One
Programming in Scala - Lecture OneProgramming in Scala - Lecture One
Programming in Scala - Lecture One
 
Language Server Protocol - Why the Hype?
Language Server Protocol - Why the Hype?Language Server Protocol - Why the Hype?
Language Server Protocol - Why the Hype?
 
DSL explained _
DSL explained _DSL explained _
DSL explained _
 
WTA-MODULE-4.pptx
WTA-MODULE-4.pptxWTA-MODULE-4.pptx
WTA-MODULE-4.pptx
 
oodb.ppt
oodb.pptoodb.ppt
oodb.ppt
 
AestasIT - Internal DSLs in Scala
AestasIT - Internal DSLs in ScalaAestasIT - Internal DSLs in Scala
AestasIT - Internal DSLs in Scala
 
Unit 1
Unit 1Unit 1
Unit 1
 

Plus de Yash Patel

noice pollution
noice pollutionnoice pollution
noice pollutionYash Patel
 
human population environment
human population environmenthuman population environment
human population environmentYash Patel
 
Introduction to marketing
Introduction to marketingIntroduction to marketing
Introduction to marketingYash Patel
 
Natural resources
Natural resources  Natural resources
Natural resources Yash Patel
 
Ecology and Ecosystem
Ecology and EcosystemEcology and Ecosystem
Ecology and EcosystemYash Patel
 
Internet stack protocol
Internet stack protocolInternet stack protocol
Internet stack protocolYash Patel
 
WATER POLLUTION
WATER  POLLUTIONWATER  POLLUTION
WATER POLLUTIONYash Patel
 
ENVIRONMENT AND ENVIRONMENT STUDIES
ENVIRONMENT AND ENVIRONMENT STUDIESENVIRONMENT AND ENVIRONMENT STUDIES
ENVIRONMENT AND ENVIRONMENT STUDIESYash Patel
 

Plus de Yash Patel (9)

noice pollution
noice pollutionnoice pollution
noice pollution
 
air pollution
air pollutionair pollution
air pollution
 
human population environment
human population environmenthuman population environment
human population environment
 
Introduction to marketing
Introduction to marketingIntroduction to marketing
Introduction to marketing
 
Natural resources
Natural resources  Natural resources
Natural resources
 
Ecology and Ecosystem
Ecology and EcosystemEcology and Ecosystem
Ecology and Ecosystem
 
Internet stack protocol
Internet stack protocolInternet stack protocol
Internet stack protocol
 
WATER POLLUTION
WATER  POLLUTIONWATER  POLLUTION
WATER POLLUTION
 
ENVIRONMENT AND ENVIRONMENT STUDIES
ENVIRONMENT AND ENVIRONMENT STUDIESENVIRONMENT AND ENVIRONMENT STUDIES
ENVIRONMENT AND ENVIRONMENT STUDIES
 

Dernier

VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...Suhani Kapoor
 
Unveiling Insights: The Role of a Data Analyst
Unveiling Insights: The Role of a Data AnalystUnveiling Insights: The Role of a Data Analyst
Unveiling Insights: The Role of a Data AnalystSamantha Rae Coolbeth
 
定制英国白金汉大学毕业证(UCB毕业证书) 成绩单原版一比一
定制英国白金汉大学毕业证(UCB毕业证书)																			成绩单原版一比一定制英国白金汉大学毕业证(UCB毕业证书)																			成绩单原版一比一
定制英国白金汉大学毕业证(UCB毕业证书) 成绩单原版一比一ffjhghh
 
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al BarshaAl Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al BarshaAroojKhan71
 
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% SecureCall me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% SecurePooja Nehwal
 
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Callshivangimorya083
 
Mature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptxMature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptxolyaivanovalion
 
Ravak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptxRavak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptxolyaivanovalion
 
April 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's AnalysisApril 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's Analysismanisha194592
 
Edukaciniai dropshipping via API with DroFx
Edukaciniai dropshipping via API with DroFxEdukaciniai dropshipping via API with DroFx
Edukaciniai dropshipping via API with DroFxolyaivanovalion
 
RA-11058_IRR-COMPRESS Do 198 series of 1998
RA-11058_IRR-COMPRESS Do 198 series of 1998RA-11058_IRR-COMPRESS Do 198 series of 1998
RA-11058_IRR-COMPRESS Do 198 series of 1998YohFuh
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
VidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptxVidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptxolyaivanovalion
 
04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationships04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationshipsccctableauusergroup
 
100-Concepts-of-AI by Anupama Kate .pptx
100-Concepts-of-AI by Anupama Kate .pptx100-Concepts-of-AI by Anupama Kate .pptx
100-Concepts-of-AI by Anupama Kate .pptxAnupama Kate
 
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...Suhani Kapoor
 
Data-Analysis for Chicago Crime Data 2023
Data-Analysis for Chicago Crime Data  2023Data-Analysis for Chicago Crime Data  2023
Data-Analysis for Chicago Crime Data 2023ymrp368
 
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdfMarket Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdfRachmat Ramadhan H
 
CebaBaby dropshipping via API with DroFX.pptx
CebaBaby dropshipping via API with DroFX.pptxCebaBaby dropshipping via API with DroFX.pptx
CebaBaby dropshipping via API with DroFX.pptxolyaivanovalion
 

Dernier (20)

VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...
 
Unveiling Insights: The Role of a Data Analyst
Unveiling Insights: The Role of a Data AnalystUnveiling Insights: The Role of a Data Analyst
Unveiling Insights: The Role of a Data Analyst
 
定制英国白金汉大学毕业证(UCB毕业证书) 成绩单原版一比一
定制英国白金汉大学毕业证(UCB毕业证书)																			成绩单原版一比一定制英国白金汉大学毕业证(UCB毕业证书)																			成绩单原版一比一
定制英国白金汉大学毕业证(UCB毕业证书) 成绩单原版一比一
 
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al BarshaAl Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
 
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% SecureCall me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
 
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
 
Mature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptxMature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptx
 
Ravak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptxRavak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptx
 
꧁❤ Aerocity Call Girls Service Aerocity Delhi ❤꧂ 9999965857 ☎️ Hard And Sexy ...
꧁❤ Aerocity Call Girls Service Aerocity Delhi ❤꧂ 9999965857 ☎️ Hard And Sexy ...꧁❤ Aerocity Call Girls Service Aerocity Delhi ❤꧂ 9999965857 ☎️ Hard And Sexy ...
꧁❤ Aerocity Call Girls Service Aerocity Delhi ❤꧂ 9999965857 ☎️ Hard And Sexy ...
 
April 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's AnalysisApril 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's Analysis
 
Edukaciniai dropshipping via API with DroFx
Edukaciniai dropshipping via API with DroFxEdukaciniai dropshipping via API with DroFx
Edukaciniai dropshipping via API with DroFx
 
RA-11058_IRR-COMPRESS Do 198 series of 1998
RA-11058_IRR-COMPRESS Do 198 series of 1998RA-11058_IRR-COMPRESS Do 198 series of 1998
RA-11058_IRR-COMPRESS Do 198 series of 1998
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
VidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptxVidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptx
 
04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationships04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationships
 
100-Concepts-of-AI by Anupama Kate .pptx
100-Concepts-of-AI by Anupama Kate .pptx100-Concepts-of-AI by Anupama Kate .pptx
100-Concepts-of-AI by Anupama Kate .pptx
 
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...
 
Data-Analysis for Chicago Crime Data 2023
Data-Analysis for Chicago Crime Data  2023Data-Analysis for Chicago Crime Data  2023
Data-Analysis for Chicago Crime Data 2023
 
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdfMarket Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
 
CebaBaby dropshipping via API with DroFX.pptx
CebaBaby dropshipping via API with DroFX.pptxCebaBaby dropshipping via API with DroFX.pptx
CebaBaby dropshipping via API with DroFX.pptx
 

Xbase implementing specific domain language for java

  • 2. ABSTRACT ❏ DSLs implemented with Xtext and similar tools focus on structural aspects such as service specifications and entities. ❏ This approach introduces complex integration patterns and the DSL’s high level of abstraction is compromised. ❏ We present Xbase as part of Xtext, an expression language. ❏ Xbase expressions provide both control structures and program expressions in a uniform way. ❏ Xbase is statically typed and tightly integrated with the Java type system.
  • 3. OUTLINE ➢ Summary ➢ Our Own View ➢ References 1. Introduction 2. The XText Framework 3. The Design of the Reusable Language XBase 4. Application of XBase 5. Related Work
  • 4. 1. Introduction ❏ The simplicity and application-specific syntax of DSLs increases the readability as well as the density of information. ❏ There are two different but converging approaches for designing DSLs. 1) External DSLs ❏ An external DSL is a completely independent language built from scratch. ❏ More popular examples for external DSLs are SQL or the Extended Backus- Naur Form (EBNF) to easily interact with relational databases or representing formal grammars, respectively.
  • 5. 2) Internal DSL ❏ Also called embedded DSL ❏ An internal DSL leverages a so called host language to solve domain- specific problems. ❏ As internal DSLs are defined on top of a general purpose programming language, their syntax is constrained to what the host language allows. ❏ The advantage is that no new language infrastructure needs to be built, because the parser and compiler of the host language is used.
  • 6. 2. The Xtext Framework ❏ Xtext is an extensible language development framework covering all aspects of language infrastructure such as parsers, linkers, compilers, interpreters, intercepts and full-down IDE support based on Eclipse. ❏ Applications: academic and industrial purpose
  • 7. 2.1 A Simple Domain Model Language ❏ How to build DSLs using XText? - grammar org.example.domainmodel DomainModel with Org.eclipse.xtext.common.Terminal - generate domainmodel “http://www.example.org/Domainmodel/Domainmodel” - Domainmodel : elements+-Types*;
  • 8. - Type: Data Type | Entity; - DataType: ‘datatype’ name =ID; - Entity: ‘entity’name =ID(‘extends’ superType = [Entity])?’ {‘ features += Feature* ‘}’ - Feature: name = ID ‘:’ type = [Type] ;
  • 9. 2.2 TOOL CHAIN ADAPTABILITY ❏ To allow for arbitrary adaptation of the default functionality, the Xtext framework makes heavy use of dependency injection pattern. ❏ Dependency injection allows one to control which concrete implementations are used in a language configuration. Thus it provide default behavior for most aspect of language infrastructure.
  • 10. 2.3 Language Inheritance ❏ Xtext supports language inheritance which allows to reuse an existing grammar.it is similar to object oriented languages, the symbols (terminals and nonterminals) of the parent grammar can be used as if they were defined in the inheriting grammar.
  • 11. ❏ Xbase expressions resemble Java’s expressions and statements in terms of syntax and semantics. ❏ Xbase expressions support advanced concepts such as type inference, extension methods. ❏ In addition, it provides the integration of the expression language with an Eclipse IDE. 3. Design of the Reusable Expression Language XBase
  • 12. 3.1 Expressions ❏ Expressions are the main language constructs that are used to express behavior and computation of values. 3.1.1 Type Interface ❏ Xbase allows one to omit the redundant of types, because types can be inferred from the expression on the right-hand side. 3.1.2 Lambda Expression Xbase also captures the current scope such that any final variables and parameters visible at construction time can be referred to in the lambda expression’s body.
  • 13. 3.1.3 Operator Overloading ❏ The semantics and the applicability of operators is not hard-coded into the language. ❏ Xbase language in a DSL definition, it is also possible to introduce new operators and define a method mapping for them.
  • 14. 3.2 Extension Methods ❏ A method that can be invoked as if it were a member of a certain type, although it is defined elsewhere. ❏ Argument of an extension method becomes the receiver. ❏ Xbase’s standard library comes with many useful extension, such as java.lang.String, java.util.List, etc. ❏ An alternative is to have them looked up by a certain naming convention.
  • 15. 3.3 Model Inference ❏ Constructor invocations, as a representation of arbitrary models. It based on the AST of a DSL script. ❏ Xbase uses the type model during type and method resolution. ❏ For example, a property in the domain model language might be translated to a Java field and two Java methods,
  • 16. 4. APPLICATION OF Xbase ❏ In this section we present two examples of how Xbase can be applied to develop DSLs. ❏ We add support for operations, the Java type system, and for building web services. ❏ In the second example we show how the Xtend programming language is implemented based on Xbase.
  • 17. 4.1 Xtend ❏ Xtend is a statically typed, functional, and object- oriented programming language for the JVM. ❏ Xtend is developed at Eclipse.org and is freely available under the Eclipse Public License (EPL), similar to Xtext. ❏ Its primary goal is to provide a significantly concise notation ❏ The language improves on Java by removing the need for writing redundant and superfluous information.
  • 18. ❏ Xtend’s template expressions are designed to concatenate strings. ❏ Xtend reuses the concepts and even the keywords of Java, such that new users can feel comfortable immediately. ❏ Xtend classes can declare members, i.e., fields and methods. ❏ Xtend derives its name from its extensive support of extension methods.
  • 19. Multimethods in Xtends 1. class MultiMethods { 2. def dispatch overloaded(String s) { 3. return ’string’ 4. } 5. def dispatch overloaded(Object s) { 6. return ’object’ 7. } 8. }
  • 20. Multi Methods in Xtend (JAVA code) 1. public class MultiMethods { 2. protected String overloaded(String s) { 3. return ”string”; 4. } 5. protected String overloaded(Object s) { 6. return ”object”; 7. }
  • 21. 8. public String overloaded(Object s) { 9. if (s instanceof String) 10. return overloaded((String)s); 11. else 12. return overloaded(s); 13. } 14. }
  • 22. 5. RELATED WORK ❏ The authors presents Xtext as a framework for implementing external DSLs 5.1 External DSL Frameworks ❏ Several frameworks for external DSL development exist besides Xtext. ❏ The Meta Programming System (MPS) by JetBrains 10 is another DSL development tool. ❏ Xtext, the use of projectional editing prevents the tooling from stumbling over syntactic ambiguities in the DSL
  • 23. 5.2 INTERNAL DSLs ❏ In contrast to external DSLs, for which special editors and compilers have to be developed ❏ For developing internal DSLs, some languages have proved to be well- suited, due to their flexible syntax 5.2.1 Groovy ❏ Groovy is a dynamically typed language that runs on the Java Virtual Machine
  • 24. 5.2.2 Scala ❏ Scala is a statically typed language for the JVM. ❏ It is a blend of functional and object-oriented concepts and is often used as a host language for DSLs. ❏ These efforts demonstrate how general purpose languages are enhanced to support the advantages of external DSLs.
  • 25. 6. CONCLUSIONS AND FUTURE WORK ❏ We discussed the main concepts of the design and implementation of the Xbase language and demonstrated its application to two different languages. ❏ Xbase has been available for less than a year, Xbase has been already employed in industry and open-source projects. ❏ For the future, the authors plan to Xbase expressions to other target languages, such as JavaScript, C and Objective-C.
  • 26. Summary ❏ Xbase language by giving an overview on design goals and some examples for Xbase expressions. ❏ The authors take a look at some other work in applications of Xbase field and relate it to Xbase. ❏ The authors illustrated Xbase expressions resemble Java’s expressions and statements in terms of syntax and semantics. ❏ The authors present examples of how Xbase can be applied to develop DSLs, an extension to the introductory Xtext and Xtend programming language is implemented based on Xbase.
  • 27. OUR OWN VIEW Strength ❏ The Authors illustrated that how Xbase integrates with Java. ❏ This paper Xbase, Which can be integrated into Xtext language development framework. ❏ The Authors discussed the main concept of the design and implementation of Xbase Weakness ❏ To support Xtext this Xbase Programming Language Designed. ❏ XBase could not add GUI capabilities fast enough. there was no de-factor OOP standard for XBase object orientation
  • 28. 1. [12]J. Hughes. Why functional programming matters. In D.A. Turner, editor, Research Topics in Functional Programming, pages 17–42. Addison Wesley, 1990. 2. [1]Hassan Chafi, Zach DeVito, Adriaan Moors, Tiark Rompf, Arvind Sujeeth, Pat Hanrahan, Martin Odersky, and Kunle Olukotun. Language Virtualization for Heterogeneous Parallel Computing. Technical report, EPFL, 2010. REFERENCES
  • 29. 3. [13]Lennart C. L. Kats and Eelco Visser. The Spoofax language workbench. Rules for declarative specification of languages and IDEs. In Martin Rinard, editor, Proceedings of the 25th Annual ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA), pages 444–463, October 2010. 4. [7] Holger Krahn, Bernhard Rumpe, and Steven V¨olkel. MontiCore: a Framework for Compositional Development of Domain Specific Languages. International Journal on Software Tools for Technology Transfer (STTT), 12:353–372, September 2010.