Modeling Industry Data
          with
Eclipse Modeling Project
       Sven Efftinge (itemis AG)
     Dr. Jan Koehnlein (it...
Frameworks and Tools
used to design, use and process
Domain-Specific Languages
EMF
GMF

      EMF
GMF         TMF

      EMF
GMF         TMF

      EMF

M2M
GMF         TMF

      EMF

M2M         M2T
Experiences made in
 a real world project
Initial Situation




• DB-Application
• Oracle DB
• Oracle Forms
Goal


• Oracle DB
• Java Rich Client
• JPA
• Spring
• Swing / JGoodies Forms
Quantities
• 1722 tables
Quantities
• 1722 tables
• 19572 columns
Quantities
• 1722 tables
• 19572 columns
• over 300 Forms
Quantities
• 1722 tables
• 19572 columns
• over 300 Forms

Our job
Quantities
• 1722 tables
• 19572 columns
• over 300 Forms

Our job
• Find suitable abstractions
Quantities
• 1722 tables
• 19572 columns
• over 300 Forms

Our job
• Find suitable abstractions
• Simplify code
Domain Model
@SuppressWarnings(quot;serialquot;)
@Entity
 Entity
@Table(name = quot;BUCHUNGSKREISE_Fquot;)
               BUCHUNGSKREIS...
@SuppressWarnings(quot;serialquot;)
@Entity
 Entity
@Table(name = quot;BUCHUNGSKREISE_Fquot;)
               BUCHUNGSKREIS...
External DSL with TMF Xtext

entity BuchungskreiseF
  (id=bkrId sequenceName=BKR_SEQ) {

    String kontoNr (notNull, leng...
External DSL with TMF Xtext

entity BuchungskreiseF
  (id=bkrId sequenceName=BKR_SEQ) {

    String kontoNr

    Long rgNr...
External DSL with TMF Xtext
                          BUCHUNGSKREISE_F

entity BuchungskreiseF
  (id=bkrId sequenceName=BK...
entity BuchungskreiseF
  (id=bkrId sequenceName=BKR_SEQ) {
}
entity BuchungskreiseF
              (id=bkrId sequenceName=BKR_SEQ) {
            }




                              TAB...
Number of Characters (Domain model DSL)
                           30.000 (DSL)
                         + 50.000 (code ge...
Views
public class PersonenForm extends
Form<Personen> {
public class PersonenForm extends
Form<Personen> {
public class PersonenForm extends
     Form<Personen> {




    public class PersonenHauptSubForm extends
SubForm<Personen...
public class PersonenForm extends
Form<Personen> {




                                        public class PersonenHauptS...
public class PersonenForm extends
   Form<Personen> {




                                           public class Personen...
public class PersonenForm extends
Form<Personen> {




                                                             public...
public class PersonenForm extends
        Form<Personen> {




                                                           ...
public class PersonenForm extends
Form<Personen> {




                                                                   ...
public class PersonenForm extends
        Form<Personen> {




                                                           ...
public class PersonenForm extends
Form<Personen> {




                                                                   ...
Why not GUI-Builder?
         •   No control over generated
             code

         •   Too many details

         •  ...
Graphical GUI-DSL with GMF
Graphical GUI-DSL with GMF
ID          NAME    PROP1    DATE    ATTR1
ID        NAME   PROP1        DATE   ATTR1




                                ...
Validation
addValidator(new Validator<Institutionen>() {
	 	 	 @Override
	 	 	 public ValidationResult validate(final Institutionen i...
Eliminate framework code




addValidator(new Validator<Institutionen>() {
	 	 	 @Override
	 	 	 public ValidationResult v...
Eliminate framework code
Avoid repetitive null pointer checks



addValidator(new Validator<Institutionen>() {
	 	 	 @Over...
Eliminate framework code
Avoid repetitive null pointer checks
Use static imports

addValidator(new Validator<Institutionen...
Eliminate framework code
Avoid repetitive null pointer checks
Use static imports
Use and define library methods
addValidato...
Internal DSL in Java
	   @Check
    void checkEsrMsg() {
	   	 if (!checkKontoNrPruefziffer(parseLong(_this.getEsrNr())))
...
Why do we want to

abstract?
Software Life-Cycle Costs (Schach 2002)




                            Requirements
                            Specificat...
Software Life-Cycle Costs (Schach 2002)


         2%

                            Requirements
                          ...
Software Life-Cycle Costs (Schach 2002)


         2% 5%

                            Requirements
                       ...
Software Life-Cycle Costs (Schach 2002)


         2% 5%
                 6%
                            Requirements
    ...
Software Life-Cycle Costs (Schach 2002)


         2% 5%
                 6%
                            Requirements
    ...
Software Life-Cycle Costs (Schach 2002)


         2% 5%
                 6%
                            Requirements
    ...
Software Life-Cycle Costs (Schach 2002)


         2% 5%
                 6%
                            Requirements
    ...
Software Life-Cycle Costs (Schach 2002)


         2% 5%
                 6%
                            Requirements
    ...
Software maintenance - proportional costs
Software maintenance - proportional costs
Software Rots
Finance related applications
    of Eclipse Modeling
Questions ?
Eclipse Banking Day
Eclipse Banking Day
Eclipse Banking Day
Eclipse Banking Day
Upcoming SlideShare
Loading in...5
×

Eclipse Banking Day

1,180

Published on

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
1,180
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
66
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Eclipse Banking Day

  1. 1. Modeling Industry Data with Eclipse Modeling Project Sven Efftinge (itemis AG) Dr. Jan Koehnlein (itemis AG)
  2. 2. Frameworks and Tools used to design, use and process Domain-Specific Languages
  3. 3. EMF
  4. 4. GMF EMF
  5. 5. GMF TMF EMF
  6. 6. GMF TMF EMF M2M
  7. 7. GMF TMF EMF M2M M2T
  8. 8. Experiences made in a real world project
  9. 9. Initial Situation • DB-Application • Oracle DB • Oracle Forms
  10. 10. Goal • Oracle DB • Java Rich Client • JPA • Spring • Swing / JGoodies Forms
  11. 11. Quantities • 1722 tables
  12. 12. Quantities • 1722 tables • 19572 columns
  13. 13. Quantities • 1722 tables • 19572 columns • over 300 Forms
  14. 14. Quantities • 1722 tables • 19572 columns • over 300 Forms Our job
  15. 15. Quantities • 1722 tables • 19572 columns • over 300 Forms Our job • Find suitable abstractions
  16. 16. Quantities • 1722 tables • 19572 columns • over 300 Forms Our job • Find suitable abstractions • Simplify code
  17. 17. Domain Model
  18. 18. @SuppressWarnings(quot;serialquot;) @Entity Entity @Table(name = quot;BUCHUNGSKREISE_Fquot;) BUCHUNGSKREISE_F public class BuchungskreiseF extends AbstractEntity implements Serializable { @SuppressWarnings(quot;unusedquot;) @Id Id @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = quot;bkrIdSeqquot;) @SequenceGenerator(name = quot;bkrIdSeqquot;, sequenceName = quot;BKR_SEQquot;, allocationSize = 1) BKR_SEQ @Column(name = quot;BKR_IDquot;, nullable = false BKR_ID false) private Long bkrId bkrId; public Long getBkrId() { return bkrId; } public void setBkrId(final Long bkrId) { this.bkrId = bkrId; } @Column(name = quot;KONTO_NRquot;, nullable = false length = 45 KONTO_NR false, 45) private String kontoNr; kontoNr public String getKontoNr() { return kontoNr; } public void setKontoNr(final String kontoNr) { String oldValue = this.kontoNr; this.kontoNr = kontoNr; firePropertyChangeEvent(quot;kontoNrquot;, oldValue, this.kontoNr); }
  19. 19. @SuppressWarnings(quot;serialquot;) @Entity Entity @Table(name = quot;BUCHUNGSKREISE_Fquot;) BUCHUNGSKREISE_F public class BuchungskreiseF extends AbstractEntity implements Serializable { @SuppressWarnings(quot;unusedquot;) @Id Id @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = quot;bkrIdSeqquot;) @SequenceGenerator(name = quot;bkrIdSeqquot;, sequenceName = quot;BKR_SEQquot;, allocationSize = 1) BKR_SEQ @Column(name = quot;BKR_IDquot;, nullable = false BKR_ID false) private Long bkrId bkrId; public Long getBkrId() { return bkrId; } public void setBkrId(final Long bkrId) { this.bkrId = bkrId; } @Column(name = quot;KONTO_NRquot;, nullable = false length = 45 KONTO_NR false, 45) private String kontoNr; kontoNr public String getKontoNr() { return kontoNr; } public void setKontoNr(final String kontoNr) { String oldValue = this.kontoNr; this.kontoNr = kontoNr; firePropertyChangeEvent(quot;kontoNrquot;, oldValue, this.kontoNr); }
  20. 20. External DSL with TMF Xtext entity BuchungskreiseF (id=bkrId sequenceName=BKR_SEQ) { String kontoNr (notNull, length=45) Long rgNrBkrIdentifikator (notNull, length=1) String referenzcodeKontoNr (notNull, length=45) }
  21. 21. External DSL with TMF Xtext entity BuchungskreiseF (id=bkrId sequenceName=BKR_SEQ) { String kontoNr Long rgNrBkrIdentifikator String referenzcodeKontoNr }
  22. 22. External DSL with TMF Xtext BUCHUNGSKREISE_F entity BuchungskreiseF (id=bkrId sequenceName=BKR_SEQ) { String kontoNr RG_NR_BKR_IDENTIFIKATOR Long rgNrBkrIdentifikator String referenzcodeKontoNr }
  23. 23. entity BuchungskreiseF (id=bkrId sequenceName=BKR_SEQ) { }
  24. 24. entity BuchungskreiseF (id=bkrId sequenceName=BKR_SEQ) { } TABLE BUCHUNGSKREISE_F ID NAME PROP1 DATE ATTR1 ID NAME PROP1 DATE ATTR1 ID NAME PROP1 DATE ATTR1 ID NAME PROP1 DATE ATTR1 ID NAME PROP1 DATE ATTR1 ID NAME PROP1 DATE ATTR1 ID NAME PROP1 DATE ATTR1 ID NAME PROP1 DATE ATTR1 Database Schema
  25. 25. Number of Characters (Domain model DSL) 30.000 (DSL) + 50.000 (code generator) With DSL + 170 / Entity 7000 / Entity Without DSL 300 TZ 240 TZ 11 Entities 180 TZ 120 TZ 60 TZ 0 TZ 0 20 40
  26. 26. Views
  27. 27. public class PersonenForm extends Form<Personen> {
  28. 28. public class PersonenForm extends Form<Personen> {
  29. 29. public class PersonenForm extends Form<Personen> { public class PersonenHauptSubForm extends SubForm<Personen> {
  30. 30. public class PersonenForm extends Form<Personen> { public class PersonenHauptSubForm extends SubForm<Personen> {
  31. 31. public class PersonenForm extends Form<Personen> { public class PersonenHauptSubForm extends SubForm<Personen> { private JComponent vornameTextField;
  32. 32. public class PersonenForm extends Form<Personen> { public class PersonenHauptSubForm extends SubForm<Personen> { private JComponent vornameTextField;
  33. 33. public class PersonenForm extends Form<Personen> { public class PersonenHauptSubForm extends SubForm<Personen> { @Override protected void initComponents() { ... vornameTextField = builder.createTextField(desc.vorname(), private JComponent vornameTextField; Editable.PROPERTY_DEFAULT, MANDATORY); gepardBuilder.setNoLeadingBlanks (vornameTextField);
  34. 34. public class PersonenForm extends Form<Personen> { public class PersonenHauptSubForm extends SubForm<Personen> { @Override protected void initComponents() { ... vornameTextField = private JComponent builder.createTextField(desc.vorname(), vornameTextField; Editable.PROPERTY_DEFAULT, MANDATORY); gepardBuilder.setNoLeadingBlanks (vornameTextField);
  35. 35. public class PersonenForm extends Form<Personen> { public class PersonenHauptSubForm extends SubForm<Personen> { @Override protected JComponent buildPanel() { TwoColumnsPanelBuilder builder = @Override protected void initComponents() { ... TwoColumnsPanelBuilder.instance(getBuilderFactory(), vornameTextField = private JComponent builder.createTextField(desc.vorname(), vornameTextField; Editable.PROPERTY_DEFAULT, MANDATORY); gepardBuilder.setNoLeadingBlanks getResourceMap()); (vornameTextField); ... builder.add(quot;vornamequot;, vornameTextField);
  36. 36. public class PersonenForm extends Form<Personen> { public class PersonenHauptSubForm extends SubForm<Personen> { @Override protected void initComponents() { @Override ... protected JComponent buildPanel() { TwoColumnsPanelBuilder builder = vornameTextField = private JComponent builder.createTextField(desc.vorname(), TwoColumnsPanelBuilder.instance(getBuilderFactory(), vornameTextField; getResourceMap()); Editable.PROPERTY_DEFAULT, MANDATORY); ... builder.add(quot;vornamequot;, vornameTextField); gepardBuilder.setNoLeadingBlanks (vornameTextField);
  37. 37. Why not GUI-Builder? • No control over generated code • Too many details • Do not directly leverage information from the domain models
  38. 38. Graphical GUI-DSL with GMF
  39. 39. Graphical GUI-DSL with GMF
  40. 40. ID NAME PROP1 DATE ATTR1 ID NAME PROP1 DATE ATTR1 Referencing ID NAME PROP1 DATE ATTR1 ID NAME PROP1 DATE ATTR1 ID NAME PROP1 DATE ATTR1 ID NAME PROP1 DATE ATTR1 ID NAME PROP1 DATE ATTR1 ID NAME PROP1 DATE ATTR1 model : gepard; import quot;platform:/resource/com.affichage.it21.gp.dao/src/main/model/types.daoquot; com.affichage.it21.gp.dao { flaechen { readOnly entity WaehrungF (id =(rvLowValue)) { } readOnly entity GepardVerwendungPvF (id =(pvOid)) { temporal manyToOne GeschpartnerAllBsF geschpartner (joinColum } } verkauf { readOnly entity GepardVerwendungKdvtF (id =(kdvtId)) { temporal notNull manyToOne GeschpartnerAllBsF geschpartner (j notNull Number istLangfrist (castTo=Boolean) notNull Number istLokaldispo (castTo=Boolean) } } gepard { readOnly entity AbcKundenF (id = (rvLowValue)) {
  41. 41. Validation
  42. 42. addValidator(new Validator<Institutionen>() { @Override public ValidationResult validate(final Institutionen institution) { final ValidationResult result = new ValidationResult(); if (institution != null && institution.getEsrNr() != null && !CheckUtils.checkPcKontoNrPruefziffer( Long.parseLong(institution.getEsrNr())) { result.add(new SimpleValidationMessage( getResourceMap().getString(quot;validation.esr.msgquot;), Severity.ERROR, getModel(Institutionen.DESC.esrNr()))); } return result; } });
  43. 43. Eliminate framework code addValidator(new Validator<Institutionen>() { @Override public ValidationResult validate(final Institutionen institution) { final ValidationResult result = new ValidationResult(); if (institution != null && institution.getEsrNr() != null && !CheckUtils.checkPcKontoNrPruefziffer( Long.parseLong(institution.getEsrNr())) { result.add(new SimpleValidationMessage( getResourceMap().getString(quot;validation.esr.msgquot;), Severity.ERROR, getModel(Institutionen.DESC.esrNr()))); } return result; } });
  44. 44. Eliminate framework code Avoid repetitive null pointer checks addValidator(new Validator<Institutionen>() { @Override public ValidationResult validate(final Institutionen institution) { final ValidationResult result = new ValidationResult(); if (institution != null && institution.getEsrNr() != null && !CheckUtils.checkPcKontoNrPruefziffer( Long.parseLong(institution.getEsrNr())) { result.add(new SimpleValidationMessage( getResourceMap().getString(quot;validation.esr.msgquot;), Severity.ERROR, getModel(Institutionen.DESC.esrNr()))); } return result; } });
  45. 45. Eliminate framework code Avoid repetitive null pointer checks Use static imports addValidator(new Validator<Institutionen>() { @Override public ValidationResult validate(final Institutionen institution) { final ValidationResult result = new ValidationResult(); if (institution != null && institution.getEsrNr() != null && !CheckUtils.checkPcKontoNrPruefziffer( Long.parseLong(institution.getEsrNr())) { result.add(new SimpleValidationMessage( getResourceMap().getString(quot;validation.esr.msgquot;), Severity.ERROR, getModel(Institutionen.DESC.esrNr()))); } return result; } });
  46. 46. Eliminate framework code Avoid repetitive null pointer checks Use static imports Use and define library methods addValidator(new Validator<Institutionen>() { @Override public ValidationResult validate(final Institutionen institution) { final ValidationResult result = new ValidationResult(); if (institution != null && institution.getEsrNr() != null && !CheckUtils.checkPcKontoNrPruefziffer( Long.parseLong(institution.getEsrNr())) { result.add(new SimpleValidationMessage( error(quot;validation.esr.msgquot;, desc.esrNr()); getResourceMap().getString(quot;validation.esr.msgquot;), Severity.ERROR, getModel(Institutionen.DESC.esrNr()))); } return result; } });
  47. 47. Internal DSL in Java @Check void checkEsrMsg() { if (!checkKontoNrPruefziffer(parseLong(_this.getEsrNr()))) error(quot;validation.esr.msgquot;,desc.esrNr()); } • Junit-like • catches null pointer exceptions
  48. 48. Why do we want to abstract?
  49. 49. Software Life-Cycle Costs (Schach 2002) Requirements Specification Design Coding Unit Testing Integration Maintenance
  50. 50. Software Life-Cycle Costs (Schach 2002) 2% Requirements Specification Design Coding Unit Testing Integration Maintenance
  51. 51. Software Life-Cycle Costs (Schach 2002) 2% 5% Requirements Specification Design Coding Unit Testing Integration Maintenance
  52. 52. Software Life-Cycle Costs (Schach 2002) 2% 5% 6% Requirements Specification Design Coding Unit Testing Integration Maintenance
  53. 53. Software Life-Cycle Costs (Schach 2002) 2% 5% 6% Requirements 5% Specification Design Coding Unit Testing Integration Maintenance
  54. 54. Software Life-Cycle Costs (Schach 2002) 2% 5% 6% Requirements 5% Specification Design 7% Coding Unit Testing Integration Maintenance
  55. 55. Software Life-Cycle Costs (Schach 2002) 2% 5% 6% Requirements 5% Specification Design 7% Coding 8% Unit Testing Integration Maintenance
  56. 56. Software Life-Cycle Costs (Schach 2002) 2% 5% 6% Requirements 5% Specification Design 7% Coding 8% Unit Testing Integration 67% Maintenance
  57. 57. Software maintenance - proportional costs
  58. 58. Software maintenance - proportional costs
  59. 59. Software Rots
  60. 60. Finance related applications of Eclipse Modeling
  61. 61. Questions ?
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×