xtext eclipse demo camp berlin
DESCRIPTION
Slides for my talk on Domain Specific Languages at the Eclipse DemoCamp in Berlin.TRANSCRIPT
Peter Friese, itemis@peterfriese
@xtext(c) 2009 Peter Friese. Distributed under the EDL V1.0 - http://www.eclipse.org/org/documents/edl-v10.php
More info: http://www.peterfriese.de / http://www.itemis.com
➊Peter Friese, itemis
@peterfriese@xtext
(c) 2009 Peter Friese. Distributed under the EDL V1.0 - http://www.eclipse.org/org/documents/edl-v10.phpMore info: http://www.peterfriese.de / http://www.itemis.com
➊ ➋Peter Friese, itemis
@peterfriese@xtext
(c) 2009 Peter Friese. Distributed under the EDL V1.0 - http://www.eclipse.org/org/documents/edl-v10.phpMore info: http://www.peterfriese.de / http://www.itemis.com
➊ ➋ ➌Peter Friese, itemis
@peterfriese@xtext
(c) 2009 Peter Friese. Distributed under the EDL V1.0 - http://www.eclipse.org/org/documents/edl-v10.phpMore info: http://www.peterfriese.de / http://www.itemis.com
➊ ➋ ➌Peter Friese, itemis
@peterfriese@xtext
(c) 2009 Peter Friese. Distributed under the EDL V1.0 - http://www.eclipse.org/org/documents/edl-v10.phpMore info: http://www.peterfriese.de / http://www.itemis.com
Right tool for the job?
?
Your trusty swiss army knife!
You’d want to core a few more apples...
... for an apple cake.
Still the best tool for the job?
Better use this one.
and this one:
A DSL is...
A specific toolfor a specific job
A specific toolfor a specific job
Think about your job!
Feel like this?
...
because
you
need
to
write
THIS?
THIS?
Wrong Level of Abstraction!http://www.flickr.com/photos/rykerstribe/3222969466/
@SuppressWarnings("serial")@Entity@Table(name = "CUSTOMER_INFO")public class CustomerInfo implements Serializable {
@Id @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "idSeq") @SequenceGenerator(name = "idSeq", sequenceName = "CUST_SEQ", allocationSize = 1) @Column(name = "CUST_ID", nullable = false) private String customerId;
public void setCustomerId(String customerId) { this.customerId = customerId; }
public String getCustomerId() { return customerId; }
@Column(name = "EMAIL", nullable = false, length = 128) private String emailAddress;
public String getEmailAddress() { return emailAddress; }
public void setEmailAddress(String emailAddress) { String oldValue = emailAddress; this.emailAddress = emailAddress; firePropertyChangedEvent("emailAddress", oldValue, this.emailAddress); }
@SuppressWarnings("serial")@Entity@Table(name = "CUSTOMER_INFO")public class CustomerInfo implements Serializable {
@Id @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "idSeq") @SequenceGenerator(name = "idSeq", sequenceName = "CUST_SEQ", allocationSize = 1) @Column(name = "CUST_ID", nullable = false) private String customerId;
public void setCustomerId(String customerId) { this.customerId = customerId; }
public String getCustomerId() { return customerId; }
@Column(name = "EMAIL", nullable = false, length = 128) private String emailAddress;
public String getEmailAddress() { return emailAddress; }
public void setEmailAddress(String emailAddress) { String oldValue = emailAddress; this.emailAddress = emailAddress; firePropertyChangedEvent("emailAddress", oldValue, this.emailAddress); }
entity CustomerInfo (id=CUST_ID, sequenceName=CUST_SEQ) { String emailAddress (notNull, length = 128)}
Bean(POJO) DAO
entity CustomerInfo (id=CUST_ID, sequenceName=CUST_SEQ) { String emailAddress (notNull, length = 128)}
DemoCreating an Entity DSL in 3 Simple Steps
➊Create a DSL
Define the Grammar
Compile the Grammar
Start the Runtime Workbench
Start Using the DSL
➋
Pimp My Write➋
➋
Create a Label Provider
Add a Generator
➌
Adding a Builder
∑
Concentrate on Essentials
Higher Efficiency
Better Maintainability
http://www.flickr.com/photos/flyforfun/2638180406/
No More Boring Code
Individual
Sven Efftinge
JanKöhnlein
HeikoBehrens
DennisHübner
MoritzEysholdt
PeterFriese
MichaelClay
PatrickSchönbach
KnutWannheden
SebastianZarnekow
Committers