SlideShare ist ein Scribd-Unternehmen logo
1 von 17
Downloaden Sie, um offline zu lesen
User-Interface
   Programmierung mit
      externen DSLs
       Sven Efftinge, Jan Köhnlein (itemis AG)




                                                 1




Ausgangslage




• DB-Anwendung
• Oracle DB
• OracleForms
                                                 2
Zielarchitektur



• Oracle DB
• Java Rich Client
• JPA
• Spring
• Swing / JGoodies Forms   3




Mengengerüst
 • 1722 Tabellen
 • 19572 Spalten
 • über 300 Forms

Aufgabe
  • Abstraktionen finden
  • Code vereinfachen
                           4
Domänenmodel
                                                                                          5




@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);
!   }
                                                                                          6
!   @Column(name = quot;RG_NR_BKR_IDENTIFIKATORquot;, nullable = false, length = 1)
!   private Long rgNrBkrIdentifikator;

!   public Long getRgNrBkrIdentifikator() {
@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);
!   }
                                                                                          6
!   @Column(name = quot;RG_NR_BKR_IDENTIFIKATORquot;, nullable = false, length = 1)
!   private Long rgNrBkrIdentifikator;

!   public Long getRgNrBkrIdentifikator() {
!   !   return rgNrBkrIdentifikator;
!   }

!   public void setRgNrBkrIdentifikator(final Long rgNrBkrIdentifikator) {
!   !   Long oldValue = this.rgNrBkrIdentifikator;


         External DSL mit TMF Xtext
!   !   this.rgNrBkrIdentifikator = rgNrBkrIdentifikator;
!   !   firePropertyChangeEvent(quot;rgNrBkrIdentifikatorquot;, oldValue,
!   !   !   !  this.rgNrBkrIdentifikator);
!   }

    @Column(name = quot;REFERENZCODE_KONTO_NRquot;,BUCHUNGSKREISE_F
!                                           nullable = false, length = 45)
!   private String referenzcodeKontoNr;

    entity BuchungskreiseF
!    public String getReferenzcodeKontoNr() {
     ! (id=bkrId sequenceName=BKR_SEQ) {
!        return referenzcodeKontoNr;
!   }


         String kontoNr
!   public void setReferenzcodeKontoNr(final String referenzcodeKontoNr) {
!   !   String oldValue = this.referenzcodeKontoNr;
                                                 RG_NR_BKR_IDENTIFIKATOR
!   !   this.referenzcodeKontoNr = referenzcodeKontoNr;
!   !   firePropertyChangeEvent(quot;referenzcodeKontoNrquot;, oldValue,
         Long rgNrBkrIdentifikator
!   !   !   !  this.referenzcodeKontoNr);
!   }


         String referenzcodeKontoNr
!   @Column(name = quot;PC_NR_RGquot;, nullable = false, length = 45)
!   private String pcNrRg;

!   public String getPcNrRg() {
    }
!    !  return pcNrRg;
!   }

!   public void setPcNrRg(final String pcNrRg) {
!   !   String oldValue = this.pcNrRg;
!   !   this.pcNrRg = pcNrRg;
                                                                                          7
!   !   firePropertyChangeEvent(quot;pcNrRgquot;, oldValue, this.pcNrRg);
!   }

!   @Column(name = quot;PC_NR_PVAquot;, nullable = false, length = 45)
!   private String pcNrPva;
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


                                                                                                                                             8




                                                                                                                                             9
Formulare

            10




            11
public class PersonenForm extends
Form<Personen> {




                                                         11




               public class PersonenForm extends
               Form<Personen> {




             public class PersonenHauptSubForm extends
         SubForm<Personen> {




                                                         11
public class PersonenForm extends
        Form<Personen> {




                                                                     public class PersonenHauptSubForm extends
                                                                 SubForm<Personen> {




    private JComponent
    vornameTextField;




                                                                                                                 11




        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);




                                                                                                                 11
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);

!




                                                                                                                                                                      11




                                     GUI-Builder
                                                                                                                                      •   WYSIWYG

                                                                                                                                      •   teilweise mit Databinding


                                                                                                                                      •   zu viele Freiheitsgrade

                                                                                                                                      •   Referenz auf Java-Code,
                                                                                                                                          nicht auf Domain-DSL




                                                                                                                                                                      12
Graphische GUI-DSL




                     13




Graphische GUI-DSL




                     13
ID          NAME    PROP1    DATE    ATTR1
ID        NAME   PROP1        DATE   ATTR1




                                                                                                                                                        Referenzen
                                          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)) {
                                                                      !                 !




                                                                                                                                                                                      14




                                        Validierung
                                                                                                                                                                                      15
16




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;
!!!}
! ! });




                                                                                  17
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;
!!!}
! ! });




                                                                                  17




Framework-Code
Nullpointer abfragen



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;
!!!}
! ! });




                                                                                  17
Framework-Code
Nullpointer abfragen
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;
!!!}
! ! });




                                                                                  17




Framework-Code
Nullpointer abfragen
Static imports
Bibliotheks Methoden definieren und benutzen
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;
!!!}
! ! });




                                                                                  17
Internal DSL mit Java
 !   void checkEsrMsg() {
 !   ! if (!checkPcKontoNrPruefziffer(parseLong(_this.getEsrNr())))
 !   ! ! error(quot;validation.esr.msgquot;,desc.esrNr());
 !   }




     • Junit-like
     • fängt Nullpointer-Exceptions



                                                                      18




Warum Abstrahieren?


                                                                      19
Anzahl Zeichen im Vergleich (nur Entity-DSL)
                                         29248 (DSL)
  Mit DSL                              + 49948 (Codegenerator)
                                       + 170 * Anzahl Entitäten
  Ohne DSL                             7303 * Anzahl Entitäten
300 TZ

240 TZ

                   11 Entitäten
180 TZ

120 TZ

 60 TZ

  0 TZ
         0                               20                       40
                                                                       20




         Software Life-Cycle Costs (Schach 2002)


                     2% 5%
                             6%
                                                 Requirements
                                  5%
                                                 Specification
                                                 Design
                                   7%

                                                 Coding
                                   8%            Unit Testing
                                                 Integration
             67%

                                                 Maintenance




                                                                       21
Fragen?



          22

Weitere ähnliche Inhalte

Was ist angesagt?

Clean code and Code Smells
Clean code and Code SmellsClean code and Code Smells
Clean code and Code SmellsMario Sangiorgio
 
Benchmarking Perl (Chicago UniForum 2006)
Benchmarking Perl (Chicago UniForum 2006)Benchmarking Perl (Chicago UniForum 2006)
Benchmarking Perl (Chicago UniForum 2006)brian d foy
 
Groovy DSLs, from Beginner to Expert - Guillaume Laforge and Paul King - Spri...
Groovy DSLs, from Beginner to Expert - Guillaume Laforge and Paul King - Spri...Groovy DSLs, from Beginner to Expert - Guillaume Laforge and Paul King - Spri...
Groovy DSLs, from Beginner to Expert - Guillaume Laforge and Paul King - Spri...Guillaume Laforge
 
Benchmarking Perl Lightning Talk (NPW 2007)
Benchmarking Perl Lightning Talk (NPW 2007)Benchmarking Perl Lightning Talk (NPW 2007)
Benchmarking Perl Lightning Talk (NPW 2007)brian d foy
 
Fantastic DSL in Python
Fantastic DSL in PythonFantastic DSL in Python
Fantastic DSL in Pythonkwatch
 
Functional Programming with Groovy
Functional Programming with GroovyFunctional Programming with Groovy
Functional Programming with GroovyArturo Herrero
 
Mixing functional and object oriented approaches to programming in C#
Mixing functional and object oriented approaches to programming in C#Mixing functional and object oriented approaches to programming in C#
Mixing functional and object oriented approaches to programming in C#Mark Needham
 
What did you miss in Java from 9-13?
What did you miss in Java from 9-13?What did you miss in Java from 9-13?
What did you miss in Java from 9-13?relix1988
 
Reading the .explain() Output
Reading the .explain() OutputReading the .explain() Output
Reading the .explain() OutputMongoDB
 
Agile 2012 Simple Design Applied
Agile 2012 Simple Design AppliedAgile 2012 Simple Design Applied
Agile 2012 Simple Design AppliedDeclan Whelan
 
Querydsl fin jug - june 2012
Querydsl   fin jug - june 2012Querydsl   fin jug - june 2012
Querydsl fin jug - june 2012Timo Westkämper
 
03 introduction to graph databases
03   introduction to graph databases03   introduction to graph databases
03 introduction to graph databasesNeo4j
 
A Critical Look at Fixtures
A Critical Look at FixturesA Critical Look at Fixtures
A Critical Look at FixturesActsAsCon
 
Hacker News vs. Slashdot—Reputation Systems in Crowdsourced Technology News
Hacker News vs. Slashdot—Reputation Systems in Crowdsourced Technology NewsHacker News vs. Slashdot—Reputation Systems in Crowdsourced Technology News
Hacker News vs. Slashdot—Reputation Systems in Crowdsourced Technology NewsChristoph Matthies
 
Refactoring group 1 - chapter 3,4,6
Refactoring   group 1 - chapter 3,4,6Refactoring   group 1 - chapter 3,4,6
Refactoring group 1 - chapter 3,4,6Duy Lâm
 

Was ist angesagt? (20)

Clean code
Clean codeClean code
Clean code
 
Simple Design
Simple DesignSimple Design
Simple Design
 
Clean code
Clean codeClean code
Clean code
 
Clean code and Code Smells
Clean code and Code SmellsClean code and Code Smells
Clean code and Code Smells
 
Benchmarking Perl (Chicago UniForum 2006)
Benchmarking Perl (Chicago UniForum 2006)Benchmarking Perl (Chicago UniForum 2006)
Benchmarking Perl (Chicago UniForum 2006)
 
Groovy DSLs, from Beginner to Expert - Guillaume Laforge and Paul King - Spri...
Groovy DSLs, from Beginner to Expert - Guillaume Laforge and Paul King - Spri...Groovy DSLs, from Beginner to Expert - Guillaume Laforge and Paul King - Spri...
Groovy DSLs, from Beginner to Expert - Guillaume Laforge and Paul King - Spri...
 
Benchmarking Perl Lightning Talk (NPW 2007)
Benchmarking Perl Lightning Talk (NPW 2007)Benchmarking Perl Lightning Talk (NPW 2007)
Benchmarking Perl Lightning Talk (NPW 2007)
 
Clean code
Clean codeClean code
Clean code
 
Fantastic DSL in Python
Fantastic DSL in PythonFantastic DSL in Python
Fantastic DSL in Python
 
Functional Programming with Groovy
Functional Programming with GroovyFunctional Programming with Groovy
Functional Programming with Groovy
 
Clean coding-practices
Clean coding-practicesClean coding-practices
Clean coding-practices
 
Mixing functional and object oriented approaches to programming in C#
Mixing functional and object oriented approaches to programming in C#Mixing functional and object oriented approaches to programming in C#
Mixing functional and object oriented approaches to programming in C#
 
What did you miss in Java from 9-13?
What did you miss in Java from 9-13?What did you miss in Java from 9-13?
What did you miss in Java from 9-13?
 
Reading the .explain() Output
Reading the .explain() OutputReading the .explain() Output
Reading the .explain() Output
 
Agile 2012 Simple Design Applied
Agile 2012 Simple Design AppliedAgile 2012 Simple Design Applied
Agile 2012 Simple Design Applied
 
Querydsl fin jug - june 2012
Querydsl   fin jug - june 2012Querydsl   fin jug - june 2012
Querydsl fin jug - june 2012
 
03 introduction to graph databases
03   introduction to graph databases03   introduction to graph databases
03 introduction to graph databases
 
A Critical Look at Fixtures
A Critical Look at FixturesA Critical Look at Fixtures
A Critical Look at Fixtures
 
Hacker News vs. Slashdot—Reputation Systems in Crowdsourced Technology News
Hacker News vs. Slashdot—Reputation Systems in Crowdsourced Technology NewsHacker News vs. Slashdot—Reputation Systems in Crowdsourced Technology News
Hacker News vs. Slashdot—Reputation Systems in Crowdsourced Technology News
 
Refactoring group 1 - chapter 3,4,6
Refactoring   group 1 - chapter 3,4,6Refactoring   group 1 - chapter 3,4,6
Refactoring group 1 - chapter 3,4,6
 

Ähnlich wie Domain-Specific Languages in der Praxis

Living With Legacy Code
Living With Legacy CodeLiving With Legacy Code
Living With Legacy CodeRowan Merewood
 
Polyglot persistence with Spring Data
Polyglot persistence with Spring DataPolyglot persistence with Spring Data
Polyglot persistence with Spring DataCorneil du Plessis
 
Using DAOs without implementing them
Using DAOs without implementing themUsing DAOs without implementing them
Using DAOs without implementing thembenfante
 
Best of build 2021 - C# 10 & .NET 6
Best of build 2021 -  C# 10 & .NET 6Best of build 2021 -  C# 10 & .NET 6
Best of build 2021 - C# 10 & .NET 6Moaid Hathot
 
Kicking off with Zend Expressive and Doctrine ORM (PHP UK 2017)
Kicking off with Zend Expressive and Doctrine ORM (PHP UK 2017)Kicking off with Zend Expressive and Doctrine ORM (PHP UK 2017)
Kicking off with Zend Expressive and Doctrine ORM (PHP UK 2017)James Titcumb
 
Lesson07-UsernamePasswordAuthenticationFilter.pdf
Lesson07-UsernamePasswordAuthenticationFilter.pdfLesson07-UsernamePasswordAuthenticationFilter.pdf
Lesson07-UsernamePasswordAuthenticationFilter.pdfScott Anderson
 
Introduction to source{d} Engine and source{d} Lookout
Introduction to source{d} Engine and source{d} Lookout Introduction to source{d} Engine and source{d} Lookout
Introduction to source{d} Engine and source{d} Lookout source{d}
 
Go OO! - Real-life Design Patterns in PHP 5
Go OO! - Real-life Design Patterns in PHP 5Go OO! - Real-life Design Patterns in PHP 5
Go OO! - Real-life Design Patterns in PHP 5Stephan Schmidt
 
Buenos Aires Drools Expert Presentation
Buenos Aires Drools Expert PresentationBuenos Aires Drools Expert Presentation
Buenos Aires Drools Expert PresentationMark Proctor
 
Kicking off with Zend Expressive and Doctrine ORM (Sunshine PHP 2017)
Kicking off with Zend Expressive and Doctrine ORM (Sunshine PHP 2017)Kicking off with Zend Expressive and Doctrine ORM (Sunshine PHP 2017)
Kicking off with Zend Expressive and Doctrine ORM (Sunshine PHP 2017)James Titcumb
 
course slides -- powerpoint
course slides -- powerpointcourse slides -- powerpoint
course slides -- powerpointwebhostingguy
 
PHP 8: Process & Fixing Insanity
PHP 8: Process & Fixing InsanityPHP 8: Process & Fixing Insanity
PHP 8: Process & Fixing InsanityGeorgePeterBanyard
 
MDSD with Eclipse @ JUG Hamburg
MDSD with Eclipse @ JUG HamburgMDSD with Eclipse @ JUG Hamburg
MDSD with Eclipse @ JUG HamburgSebastian Zarnekow
 

Ähnlich wie Domain-Specific Languages in der Praxis (20)

Kick Start Jpa
Kick Start JpaKick Start Jpa
Kick Start Jpa
 
Living With Legacy Code
Living With Legacy CodeLiving With Legacy Code
Living With Legacy Code
 
Polyglot persistence with Spring Data
Polyglot persistence with Spring DataPolyglot persistence with Spring Data
Polyglot persistence with Spring Data
 
Using DAOs without implementing them
Using DAOs without implementing themUsing DAOs without implementing them
Using DAOs without implementing them
 
Best of build 2021 - C# 10 & .NET 6
Best of build 2021 -  C# 10 & .NET 6Best of build 2021 -  C# 10 & .NET 6
Best of build 2021 - C# 10 & .NET 6
 
Classes and Inheritance
Classes and InheritanceClasses and Inheritance
Classes and Inheritance
 
Kicking off with Zend Expressive and Doctrine ORM (PHP UK 2017)
Kicking off with Zend Expressive and Doctrine ORM (PHP UK 2017)Kicking off with Zend Expressive and Doctrine ORM (PHP UK 2017)
Kicking off with Zend Expressive and Doctrine ORM (PHP UK 2017)
 
Lesson07-UsernamePasswordAuthenticationFilter.pdf
Lesson07-UsernamePasswordAuthenticationFilter.pdfLesson07-UsernamePasswordAuthenticationFilter.pdf
Lesson07-UsernamePasswordAuthenticationFilter.pdf
 
Django
DjangoDjango
Django
 
Introduction to source{d} Engine and source{d} Lookout
Introduction to source{d} Engine and source{d} Lookout Introduction to source{d} Engine and source{d} Lookout
Introduction to source{d} Engine and source{d} Lookout
 
Dev Day Andreas Roth.pdf
Dev Day Andreas Roth.pdfDev Day Andreas Roth.pdf
Dev Day Andreas Roth.pdf
 
Go OO! - Real-life Design Patterns in PHP 5
Go OO! - Real-life Design Patterns in PHP 5Go OO! - Real-life Design Patterns in PHP 5
Go OO! - Real-life Design Patterns in PHP 5
 
Buenos Aires Drools Expert Presentation
Buenos Aires Drools Expert PresentationBuenos Aires Drools Expert Presentation
Buenos Aires Drools Expert Presentation
 
Having Fun with Play
Having Fun with PlayHaving Fun with Play
Having Fun with Play
 
Kicking off with Zend Expressive and Doctrine ORM (Sunshine PHP 2017)
Kicking off with Zend Expressive and Doctrine ORM (Sunshine PHP 2017)Kicking off with Zend Expressive and Doctrine ORM (Sunshine PHP 2017)
Kicking off with Zend Expressive and Doctrine ORM (Sunshine PHP 2017)
 
course slides -- powerpoint
course slides -- powerpointcourse slides -- powerpoint
course slides -- powerpoint
 
PHP 8: Process & Fixing Insanity
PHP 8: Process & Fixing InsanityPHP 8: Process & Fixing Insanity
PHP 8: Process & Fixing Insanity
 
MDSD with Eclipse @ JUG Hamburg
MDSD with Eclipse @ JUG HamburgMDSD with Eclipse @ JUG Hamburg
MDSD with Eclipse @ JUG Hamburg
 
Os Leonard
Os LeonardOs Leonard
Os Leonard
 
Ejb3 Dan Hinojosa
Ejb3 Dan HinojosaEjb3 Dan Hinojosa
Ejb3 Dan Hinojosa
 

Mehr von Sven Efftinge

Parsing Expression With Xtext
Parsing Expression With XtextParsing Expression With Xtext
Parsing Expression With XtextSven Efftinge
 
Language Engineering With Xtext
Language Engineering With XtextLanguage Engineering With Xtext
Language Engineering With XtextSven Efftinge
 
Auto-GWT : Better GWT Programming with Xtend
Auto-GWT : Better GWT Programming with XtendAuto-GWT : Better GWT Programming with Xtend
Auto-GWT : Better GWT Programming with XtendSven Efftinge
 
Functional programming with Xtend
Functional programming with XtendFunctional programming with Xtend
Functional programming with XtendSven Efftinge
 
Codegeneration With Xtend
Codegeneration With XtendCodegeneration With Xtend
Codegeneration With XtendSven Efftinge
 
Domain Specific Languages (EclipseCon 2012)
Domain Specific Languages (EclipseCon 2012)Domain Specific Languages (EclipseCon 2012)
Domain Specific Languages (EclipseCon 2012)Sven Efftinge
 
Xtend @ EclipseCon 2012
Xtend @ EclipseCon 2012Xtend @ EclipseCon 2012
Xtend @ EclipseCon 2012Sven Efftinge
 
This Is Not Your Father's Java
This Is Not Your Father's JavaThis Is Not Your Father's Java
This Is Not Your Father's JavaSven Efftinge
 
Getting the most out of Java [Nordic Coding-2010]
Getting the most out of Java [Nordic Coding-2010]Getting the most out of Java [Nordic Coding-2010]
Getting the most out of Java [Nordic Coding-2010]Sven Efftinge
 
Xtext at MDD Day 2010
Xtext at MDD Day 2010Xtext at MDD Day 2010
Xtext at MDD Day 2010Sven Efftinge
 
Dependency Injection for Eclipse developers
Dependency Injection for Eclipse developersDependency Injection for Eclipse developers
Dependency Injection for Eclipse developersSven Efftinge
 
Challenges In Dsl Design
Challenges In Dsl DesignChallenges In Dsl Design
Challenges In Dsl DesignSven Efftinge
 
Code Generation in Agile Projects
Code Generation in Agile ProjectsCode Generation in Agile Projects
Code Generation in Agile ProjectsSven Efftinge
 
Bessere Softwareentwicklung (Itemis Wintercon)
Bessere Softwareentwicklung (Itemis Wintercon)Bessere Softwareentwicklung (Itemis Wintercon)
Bessere Softwareentwicklung (Itemis Wintercon)Sven Efftinge
 

Mehr von Sven Efftinge (20)

Parsing Expression With Xtext
Parsing Expression With XtextParsing Expression With Xtext
Parsing Expression With Xtext
 
Language Engineering With Xtext
Language Engineering With XtextLanguage Engineering With Xtext
Language Engineering With Xtext
 
Future of Xtext
Future of XtextFuture of Xtext
Future of Xtext
 
Auto-GWT : Better GWT Programming with Xtend
Auto-GWT : Better GWT Programming with XtendAuto-GWT : Better GWT Programming with Xtend
Auto-GWT : Better GWT Programming with Xtend
 
Functional programming with Xtend
Functional programming with XtendFunctional programming with Xtend
Functional programming with Xtend
 
Codegeneration With Xtend
Codegeneration With XtendCodegeneration With Xtend
Codegeneration With Xtend
 
Gwt and Xtend
Gwt and XtendGwt and Xtend
Gwt and Xtend
 
Domain Specific Languages (EclipseCon 2012)
Domain Specific Languages (EclipseCon 2012)Domain Specific Languages (EclipseCon 2012)
Domain Specific Languages (EclipseCon 2012)
 
Xtend @ EclipseCon 2012
Xtend @ EclipseCon 2012Xtend @ EclipseCon 2012
Xtend @ EclipseCon 2012
 
Eclipse Xtend
Eclipse XtendEclipse Xtend
Eclipse Xtend
 
This Is Not Your Father's Java
This Is Not Your Father's JavaThis Is Not Your Father's Java
This Is Not Your Father's Java
 
Getting the most out of Java [Nordic Coding-2010]
Getting the most out of Java [Nordic Coding-2010]Getting the most out of Java [Nordic Coding-2010]
Getting the most out of Java [Nordic Coding-2010]
 
Xtext at MDD Day 2010
Xtext at MDD Day 2010Xtext at MDD Day 2010
Xtext at MDD Day 2010
 
Dependency Injection for Eclipse developers
Dependency Injection for Eclipse developersDependency Injection for Eclipse developers
Dependency Injection for Eclipse developers
 
Xtext Webinar
Xtext WebinarXtext Webinar
Xtext Webinar
 
Challenges In Dsl Design
Challenges In Dsl DesignChallenges In Dsl Design
Challenges In Dsl Design
 
Code Generation in Agile Projects
Code Generation in Agile ProjectsCode Generation in Agile Projects
Code Generation in Agile Projects
 
Xtext Eclipse Con
Xtext Eclipse ConXtext Eclipse Con
Xtext Eclipse Con
 
Generic Editor
Generic EditorGeneric Editor
Generic Editor
 
Bessere Softwareentwicklung (Itemis Wintercon)
Bessere Softwareentwicklung (Itemis Wintercon)Bessere Softwareentwicklung (Itemis Wintercon)
Bessere Softwareentwicklung (Itemis Wintercon)
 

Kürzlich hochgeladen

DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 

Kürzlich hochgeladen (20)

DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 

Domain-Specific Languages in der Praxis

  • 1. User-Interface Programmierung mit externen DSLs Sven Efftinge, Jan Köhnlein (itemis AG) 1 Ausgangslage • DB-Anwendung • Oracle DB • OracleForms 2
  • 2. Zielarchitektur • Oracle DB • Java Rich Client • JPA • Spring • Swing / JGoodies Forms 3 Mengengerüst • 1722 Tabellen • 19572 Spalten • über 300 Forms Aufgabe • Abstraktionen finden • Code vereinfachen 4
  • 3. Domänenmodel 5 @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); ! } 6 ! @Column(name = quot;RG_NR_BKR_IDENTIFIKATORquot;, nullable = false, length = 1) ! private Long rgNrBkrIdentifikator; ! public Long getRgNrBkrIdentifikator() {
  • 4. @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); ! } 6 ! @Column(name = quot;RG_NR_BKR_IDENTIFIKATORquot;, nullable = false, length = 1) ! private Long rgNrBkrIdentifikator; ! public Long getRgNrBkrIdentifikator() { ! ! return rgNrBkrIdentifikator; ! } ! public void setRgNrBkrIdentifikator(final Long rgNrBkrIdentifikator) { ! ! Long oldValue = this.rgNrBkrIdentifikator; External DSL mit TMF Xtext ! ! this.rgNrBkrIdentifikator = rgNrBkrIdentifikator; ! ! firePropertyChangeEvent(quot;rgNrBkrIdentifikatorquot;, oldValue, ! ! ! ! this.rgNrBkrIdentifikator); ! } @Column(name = quot;REFERENZCODE_KONTO_NRquot;,BUCHUNGSKREISE_F ! nullable = false, length = 45) ! private String referenzcodeKontoNr; entity BuchungskreiseF ! public String getReferenzcodeKontoNr() { ! (id=bkrId sequenceName=BKR_SEQ) { ! return referenzcodeKontoNr; ! } String kontoNr ! public void setReferenzcodeKontoNr(final String referenzcodeKontoNr) { ! ! String oldValue = this.referenzcodeKontoNr; RG_NR_BKR_IDENTIFIKATOR ! ! this.referenzcodeKontoNr = referenzcodeKontoNr; ! ! firePropertyChangeEvent(quot;referenzcodeKontoNrquot;, oldValue, Long rgNrBkrIdentifikator ! ! ! ! this.referenzcodeKontoNr); ! } String referenzcodeKontoNr ! @Column(name = quot;PC_NR_RGquot;, nullable = false, length = 45) ! private String pcNrRg; ! public String getPcNrRg() { } ! ! return pcNrRg; ! } ! public void setPcNrRg(final String pcNrRg) { ! ! String oldValue = this.pcNrRg; ! ! this.pcNrRg = pcNrRg; 7 ! ! firePropertyChangeEvent(quot;pcNrRgquot;, oldValue, this.pcNrRg); ! } ! @Column(name = quot;PC_NR_PVAquot;, nullable = false, length = 45) ! private String pcNrPva;
  • 5. 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 8 9
  • 6. Formulare 10 11
  • 7. public class PersonenForm extends Form<Personen> { 11 public class PersonenForm extends Form<Personen> { public class PersonenHauptSubForm extends SubForm<Personen> { 11
  • 8. public class PersonenForm extends Form<Personen> { public class PersonenHauptSubForm extends SubForm<Personen> { private JComponent vornameTextField; 11 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); 11
  • 9. 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); ! 11 GUI-Builder • WYSIWYG • teilweise mit Databinding • zu viele Freiheitsgrade • Referenz auf Java-Code, nicht auf Domain-DSL 12
  • 10. Graphische GUI-DSL 13 Graphische GUI-DSL 13
  • 11. ID NAME PROP1 DATE ATTR1 ID NAME PROP1 DATE ATTR1 Referenzen 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)) { ! ! 14 Validierung 15
  • 12. 16 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; !!!} ! ! }); 17
  • 13. 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; !!!} ! ! }); 17 Framework-Code Nullpointer abfragen 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; !!!} ! ! }); 17
  • 14. Framework-Code Nullpointer abfragen 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; !!!} ! ! }); 17 Framework-Code Nullpointer abfragen Static imports Bibliotheks Methoden definieren und benutzen 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; !!!} ! ! }); 17
  • 15. Internal DSL mit Java ! void checkEsrMsg() { ! ! if (!checkPcKontoNrPruefziffer(parseLong(_this.getEsrNr()))) ! ! ! error(quot;validation.esr.msgquot;,desc.esrNr()); ! } • Junit-like • fängt Nullpointer-Exceptions 18 Warum Abstrahieren? 19
  • 16. Anzahl Zeichen im Vergleich (nur Entity-DSL) 29248 (DSL) Mit DSL + 49948 (Codegenerator) + 170 * Anzahl Entitäten Ohne DSL 7303 * Anzahl Entitäten 300 TZ 240 TZ 11 Entitäten 180 TZ 120 TZ 60 TZ 0 TZ 0 20 40 20 Software Life-Cycle Costs (Schach 2002) 2% 5% 6% Requirements 5% Specification Design 7% Coding 8% Unit Testing Integration 67% Maintenance 21
  • 17. Fragen? 22