Trivadis TechEvent 2016 Kill three birds with one stone (Eclipse Scout) by Christian Mötzing

31
BASEL BERN BRUGG DÜSSELDORF FRANKFURT A.M. FREIBURG I.BR. GENEVA HAMBURG COPENHAGEN LAUSANNE MUNICH STUTTGART VIENNA ZURICH Kill three birds with one stone Mobile, Web and Desktop application in one take with Eclipse Scout Christian Mötzing Consultant AD Stuttgart

Transcript of Trivadis TechEvent 2016 Kill three birds with one stone (Eclipse Scout) by Christian Mötzing

Page 1: Trivadis TechEvent 2016 Kill three birds with one stone (Eclipse Scout) by Christian Mötzing

BASEL BERN BRUGG DÜSSELDORF FRANKFURT A.M. FREIBURG I.BR. GENEVA

HAMBURG COPENHAGEN LAUSANNE MUNICH STUTTGART VIENNA ZURICH

Kill three birds with one stoneMobile, Web and Desktop application in one take with Eclipse Scout

Christian MötzingConsultant – AD Stuttgart

Page 2: Trivadis TechEvent 2016 Kill three birds with one stone (Eclipse Scout) by Christian Mötzing

En

terp

rise • boring

• enableswork

• legacy

• conservativeuse oftechnology

Web • fancy

• life-style

• trending

• infinite budget

• geek playground

Application Types

AD – Eclipse Scout2 30.09.2016

from … to …

Page 3: Trivadis TechEvent 2016 Kill three birds with one stone (Eclipse Scout) by Christian Mötzing

En

terp

rise • boring

• enables work

• legacy

• conservativeuse oftechnology

Enterprise Applications

AD – Eclipse Scout3 30.09.2016

Can‘t change every day

Usability

Accessability

limiting factors

– Skill

– License

– Maturity

– …

Page 4: Trivadis TechEvent 2016 Kill three birds with one stone (Eclipse Scout) by Christian Mötzing

AD – Eclipse Scout4 30.09.2016

Eclipse Scout

Page 5: Trivadis TechEvent 2016 Kill three birds with one stone (Eclipse Scout) by Christian Mötzing

Eclipse Scout

AD – Eclipse Scout5 30.09.2016

OpenSource (initiated in 2010)

Claims

– Quality

– Time to Market

– Costs

– Future Proof (16 years development, no rewrites, state of the art)

Source: https://wiki.eclipse.org/images/8/87/100601_eclipse_banking_day_scout.pdf

Page 6: Trivadis TechEvent 2016 Kill three birds with one stone (Eclipse Scout) by Christian Mötzing

How to deliver these claims

AD – Eclipse Scout6 30.09.2016

Good framework structure, testing

facilities included, proven technologiesQuality

Time to

Market

Cost

Future

Proof

High productivity through eclipse

integration, steep learning curve

Built-in architecture plan, decoupling

Page 7: Trivadis TechEvent 2016 Kill three birds with one stone (Eclipse Scout) by Christian Mötzing

Excursion: Learning Curves

AD – Eclipse Scout7 30.09.2016

Experience

Le

arn

ing

Experience

Le

arn

ing

Steep Shallow

Page 8: Trivadis TechEvent 2016 Kill three birds with one stone (Eclipse Scout) by Christian Mötzing

How to deliver these claims

AD – Eclipse Scout8 30.09.2016

Good framework structure, testing

facilities included, proven technologiesQuality

Time to

Market

Cost

Future

Proof

High productivity through eclipse

integration, steep learning curve

Built-in architecture plan, decoupling

proven technologies

productivity

decoupling

Page 9: Trivadis TechEvent 2016 Kill three birds with one stone (Eclipse Scout) by Christian Mötzing

How does Eclipse Scout decouple?

AD – Eclipse Scout9 30.09.2016

UI Server Business Logic

Server

Database

Server

communication communication

„Don‘t depend on

ANY

UI technology.“Source: https://wiki.eclipse.org/images/e/e8/160202b_Scout_OOP.pdf

Pure Java UI No Technology

Page 10: Trivadis TechEvent 2016 Kill three birds with one stone (Eclipse Scout) by Christian Mötzing

Architectural Decoupling

AD – Eclipse Scout10 30.09.2016

Source: Scout Technical Guide 6.0

1 example.app

2 example.app.server

3 example.app.shared

4 example.app.client

5 example.app.ui.html

6 example.app.server.app.dev

7 example.app.ui.html.app.dev

8 example.app.server.app.war

9 example.app.ui.html.app.war

Page 11: Trivadis TechEvent 2016 Kill three birds with one stone (Eclipse Scout) by Christian Mötzing

Programming Paradigm Decoupling

AD – Eclipse Scout11 30.09.2016

Application code is pure Java

– No UI technology references

– No service technology references

– No dependency injection specifics

„Don‘t depend on

ANY

UI technology.“Source: https://wiki.eclipse.org/images/e/e8/160202b_Scout_OOP.pdf

Page 12: Trivadis TechEvent 2016 Kill three birds with one stone (Eclipse Scout) by Christian Mötzing

UI: Define a Field on a Form

AD – Eclipse Scout12 30.09.2016

1 public FirstNameField getFirstNameField() {

2 return getFieldByClass(FirstNameField.class);

3 }

4

5 @Order(30)

6 public class FirstNameField extends AbstractStringField {

7 @Override

8 protected String getConfiguredLabel() {

9 return TEXTS.get("FirstName");

10 }

11 }

Page 13: Trivadis TechEvent 2016 Kill three birds with one stone (Eclipse Scout) by Christian Mötzing

UI: Define a Data Object

AD – Eclipse Scout13 30.09.2016

1 @Generated(value = "org.eclipse...client.person.PersonForm")

2 public class PersonFormData extends AbstractFormData {

3 public FirstName getFirstName() {

4 return getFieldByClass(FirstName.class);

5 }

6

7 public static class FirstName extends

AbstractValueFieldData<String> {

8 private static final long serialVersionUID = 1L;

9 }

FormData FormData

UI Service SQL

Page 14: Trivadis TechEvent 2016 Kill three birds with one stone (Eclipse Scout) by Christian Mötzing

Service: Define a Service

AD – Eclipse Scout14 30.09.2016

1 @ApplicationScoped

2 @TunnelToServer

3 public interface IPersonService {

4

5 PersonFormData create(PersonFormData formData);

6

7 PersonFormData load(PersonFormData formData);

8

9 PersonFormData store(PersonFormData formData);

10 }

11

12 public class PersonService implements IPersonService {

13 }

Page 15: Trivadis TechEvent 2016 Kill three birds with one stone (Eclipse Scout) by Christian Mötzing

Service: Persisting Data

AD – Eclipse Scout15 30.09.2016

1 @Override

2 public PersonFormData store(PersonFormData formData) {

3 SQL.insert(SQLs.PERSON_INSERT, formData);

4 return formData;

5 }

6

7 // SQL.java

8 String PERSON_UPDATE = ""

+ "UPDATE PERSON "

+ "SET first_name = :firstName, "

+ " last_name = :lastName, „

+ "WHERE person_id = :personId";

9

Page 16: Trivadis TechEvent 2016 Kill three birds with one stone (Eclipse Scout) by Christian Mötzing

UI: Input Validation

AD – Eclipse Scout16 30.09.2016

1 public class FirstNameField extends AbstractStringField {

2 private String PATTERN = "^[A-Z][a-z]+$";

3 @Override

4 protected int getConfiguredMaxLength() {

5 return 64;

6 }

7 @Override

8 protected String execValidateValue(String rawValue) {

9 if (rawValue != null &&

!Pattern.matches(PATTERN, rawValue)) {

10 throw new

VetoException(TEXTS.get("BadFirstName"));

11 }

12 return rawValue;

13 }

14 }

Page 17: Trivadis TechEvent 2016 Kill three birds with one stone (Eclipse Scout) by Christian Mötzing

UI: Form Validation

AD – Eclipse Scout17 30.09.2016

1 // on field inside form

2 @Override

3 protected void execChangedValue() {

4 validateAddressFields();

5 }

6 }

7

8 // on form

9 protected void validateAddressFields() {

10 boolean hasStreet =

StringUtility.hasText(getStreetField().getValue());

11 // if you provide a street, then you must provide a city

13 getCityField().setMandatory(hasStreet);

14 }

Page 18: Trivadis TechEvent 2016 Kill three birds with one stone (Eclipse Scout) by Christian Mötzing

Programming Paradigm Decoupling (2nd time)

AD – Eclipse Scout18 30.09.2016

Application code is pure Java

– No UI technology references

– No service technology references

– No dependency injection specifics

„Don‘t depend on

ANY

UI technology.“Source: https://wiki.eclipse.org/images/e/e8/160202b_Scout_OOP.pdf

No CDI (JSR346)

No standard internationalization

No standard tools (like Apache Commons

StringUtils)

Page 19: Trivadis TechEvent 2016 Kill three birds with one stone (Eclipse Scout) by Christian Mötzing

Technology behind framework is not visible

AD – Eclipse Scout19 30.09.2016

Source: Scout Technical Guide 6.0

Even Services use a „Service Tunnel“ not REST or SOAP

Page 20: Trivadis TechEvent 2016 Kill three birds with one stone (Eclipse Scout) by Christian Mötzing

AD – Eclipse Scout20 30.09.2016

What could have been the Demo

Page 21: Trivadis TechEvent 2016 Kill three birds with one stone (Eclipse Scout) by Christian Mötzing

Desktop

AD – Eclipse Scout21 30.09.2016

Source: http://www.eclipse.org/scout/

Page 22: Trivadis TechEvent 2016 Kill three birds with one stone (Eclipse Scout) by Christian Mötzing

Web

AD – Eclipse Scout22 30.09.2016

Source: http://www.eclipse.org/scout/

Page 23: Trivadis TechEvent 2016 Kill three birds with one stone (Eclipse Scout) by Christian Mötzing

Mobile

AD – Eclipse Scout23 30.09.2016Source: http://www.eclipse.org/scout/

Page 24: Trivadis TechEvent 2016 Kill three birds with one stone (Eclipse Scout) by Christian Mötzing

What about that „killing three birds with one stone“ part

AD – Eclipse Scout24 30.09.2016

Scout 5.0

• SWING

• SWT

• RAP

Scout 6.0

• HTML5

• CSS

• JavaScript

Page 25: Trivadis TechEvent 2016 Kill three birds with one stone (Eclipse Scout) by Christian Mötzing

AD – Eclipse Scout25 30.09.2016

The actual Demo

Page 26: Trivadis TechEvent 2016 Kill three birds with one stone (Eclipse Scout) by Christian Mötzing

What else comes with Eclipse Scout

AD – Eclipse Scout26 30.09.2016

Internationalization

Security

Theming & Styling (with CSS3 + Less)

IDE integration (Eclipse only)

Aim for a long life (Enterprise Applications > 10 years)

Yet to be proven publicly since only in market for 6 years.

Page 27: Trivadis TechEvent 2016 Kill three birds with one stone (Eclipse Scout) by Christian Mötzing

Migrating other Applications to Eclipse Scout

AD – Eclipse Scout27 30.09.2016

UI

Services

Data Model

UI

Services

Data ModelSQLs, Tables

Service Logic

?

Page 28: Trivadis TechEvent 2016 Kill three birds with one stone (Eclipse Scout) by Christian Mötzing

Conclusion

AD – Eclipse Scout28 30.09.2016

The Good

– Framework with the best UI abstraction I have seen to date

– High productivity (not verified by me on longterm)

– You get a good standard UI without (any) HTML or CSS knowledge

The Bad

– High abstraction means customization is more complex

– Skills are pretty unique to framework

Page 29: Trivadis TechEvent 2016 Kill three birds with one stone (Eclipse Scout) by Christian Mötzing

AD – Eclipse Scout29 30.09.2016

Demo: https://scout.bsi-software.com/contacts/

Docs: https://github.com/BSI-Business-Systems-Integration-AG/org.eclipse.scout.docs

Project: https://eclipse.org/scout/

Page 30: Trivadis TechEvent 2016 Kill three birds with one stone (Eclipse Scout) by Christian Mötzing

Session Feedback – now

AD – Eclipse Scout30 09.09.2016

Please use the Trivadis Events mobile app to give feedback on each session

Use "My schedule" if you have registered for a session

Otherwise use "Agenda" and the search function

If the mobile app does not work (or if you have a Windows smartphone), use your

smartphone browser

– URL: http://trivadis.quickmobileplatform.eu/

– User name: <your_loginname> (such as “svv”)

– Password: sent by e-mail...

Page 31: Trivadis TechEvent 2016 Kill three birds with one stone (Eclipse Scout) by Christian Mötzing

Christian Mötzing

Consultant

Tel. +49 711 903 632 342

[email protected]

30.09.2016 AD – Eclipse Scout31