Software Automation
with Eclipse Modeling




                           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
Some Typical Situations
          in
Software Development
Boring code
Accidental complexity
Wrong level of abstraction
Anatomy of Modern Software




         Software artifact
Anatomy of Modern Software




    manually written code      Frameworks




                   Libraries
Anatomy of Modern Software


                   manually written
                       code

                                      Frameworks

 schematic code (manually written)



                      Libraries
The Result?
More and more code to write
More and more code to write
More and more code to write
Problems
Problems
Problems




Can we solve them with models?
Yes, we can!
Code Generation Helps

 Model
                  manually written
                      code
Generator
                                     Frameworks

    schematic code (generated)




                      Libraries
MDSD

Metamodel




 <<instanceof>>



                              generated     manually written
 Model             Model
                              code              code

                  Generator




                                          Platform
MDSD with UML

     Metamodel




<<instanceof>>



                                generated     manually written
       Model         Model
                                code              code
                    Generator




        UML                                 Platform
Demo
@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)
	
}
entity CustomerInfo
	 (id=CUST_ID, sequenceName=CUST_SEQ)
{
	
	 String emailAddress (notNull, length = 128)
	
}




               Bean
                         DAO
              (POJO)
∑
Concentrate on
  Essentials
Higher Efficiency
Better Maintainability




http://www.flickr.com/photos/flyforfun/2638180406/
No More Boring Code
Some



       Users
Deutsche Börse
 Systems AG
Deutsche Börse
 Systems AG
APG Affichage
APG Affichage
Fraunhofer IWES
Fraunhofer IWES
BMW Car IT
BMW Car IT
Twitter: @xtext
http://www.xtext.org

Software Automation with Eclipse Modeling