Top Banner
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. 10 Building Blocks for Enterprise JavaScript Applications Geertjan Wielenga @geertjanw Oracle
66

10 Building Blocks for Enterprise JavaScript

Jan 23, 2018

Download

Software

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: 10 Building Blocks for Enterprise JavaScript

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.

10 Building Blocks for Enterprise JavaScript Applications

Geertjan Wielenga @geertjanw Oracle

Page 2: 10 Building Blocks for Enterprise JavaScript

Copyright © 2014, Oracle and/or its affiliates. All rights reserved.

Page 3: 10 Building Blocks for Enterprise JavaScript

Copyright © 2014, Oracle and/or its affiliates. All rights reserved.

A metaphorfor our age!

The distractedsociety!

FacebookbeatsRembrandt!

(And the end of the worldis nigh.)

Page 4: 10 Building Blocks for Enterprise JavaScript

Copyright © 2014, Oracle and/or its affiliates. All rights reserved.

Actually...

They're usinga museum app.

And are findingout more aboutthe paintings theyhad been closelyfocused on a fewminutes earlier.

Page 5: 10 Building Blocks for Enterprise JavaScript

Copyright © 2014, Oracle and/or its affiliates. All rights reserved.

Browser platform Java platform

Page 6: 10 Building Blocks for Enterprise JavaScript

Copyright © 2014, Oracle and/or its affiliates. All rights reserved.

10 Building Blocks of Enterprise JavaScript1. Resist the hype.

2. Rediscover HTML5 as an application framework.

3. Compare responsive design between CSS and JavaScript.

4. Evaluate the framework vs. library approach.

5. Incorporate modularity.

6. Evaluate abstractions over JavaScript, CSS, and HTML.

7. Don't worry about ecosystem volatility.

8. Reorientate around WONTA instead of WORA.

9. Evaluate corporate frameworks.

10. Reconsider JavaScript as assembly language.

Page 7: 10 Building Blocks for Enterprise JavaScript

Copyright © 2014, Oracle and/or its affiliates. All rights reserved.

1. Resist the hype

Page 8: 10 Building Blocks for Enterprise JavaScript

Copyright © 2014, Oracle and/or its affiliates. All rights reserved.

Page 9: 10 Building Blocks for Enterprise JavaScript

Copyright © 2014, Oracle and/or its affiliates. All rights reserved.

● Data heavy monitoring systems.

● Behind the firewallmanagement systems.

● Large resolutionrequirements.

● All the usersin the same room.

Page 10: 10 Building Blocks for Enterprise JavaScript

Copyright © 2014, Oracle and/or its affiliates. All rights reserved.

1a. Consider supplementing with new devices

Page 11: 10 Building Blocks for Enterprise JavaScript

Copyright © 2014, Oracle and/or its affiliates. All rights reserved.

● Mobile appto receive urgent notificationsfor air traffic controlers.

● Web appto display reportsfor upper management.

● And keep the main systemexactly as it has always beensince that's how it makes sense.

Page 12: 10 Building Blocks for Enterprise JavaScript

Copyright © 2014, Oracle and/or its affiliates. All rights reserved.

2. Rediscover HTML5 as an application framework

Page 13: 10 Building Blocks for Enterprise JavaScript

Copyright © 2014, Oracle and/or its affiliates. All rights reserved.

Page 14: 10 Building Blocks for Enterprise JavaScript

Copyright © 2014, Oracle and/or its affiliates. All rights reserved.

HTML5: Not Documents Only, Not Multimedia Only● Originally, HTML was designed

as a language for semanticallydescribing scientific documents.

● HTML5 is a response todemands for multimedia experiences(animations, games, movies, and audio).

● However, it also includes built-in application-development features.● Semantic markup: <article>, <header>● New input types: e-mail, URL, color.● New Intellisense/Auto Completion.● Validation attributes, 'required' and 'pattern'.

Page 15: 10 Building Blocks for Enterprise JavaScript

Copyright © 2014, Oracle and/or its affiliates. All rights reserved.

Principles of HTML5

● New features should be based on HTML, CSS, and JavaScript.

● Need for external plugins, e.g., Flash,should be reduced.

● Error handling should be easierthan previous versions.

● Scripting should be replacedby more markup.

● HTML5 should be device independent.

Page 16: 10 Building Blocks for Enterprise JavaScript

Copyright © 2014, Oracle and/or its affiliates. All rights reserved.

<input id="country_name" name="mycountry" type="text" required list="country" />

<datalist id="country"> <option value="Afghanistan"> <option value="Albania"> <option value="Algeria"> <option value="Andorra"> <option value="Angola"></datalist>

Page 17: 10 Building Blocks for Enterprise JavaScript

Copyright © 2014, Oracle and/or its affiliates. All rights reserved.

Demos

Page 18: 10 Building Blocks for Enterprise JavaScript

Copyright © 2014, Oracle and/or its affiliates. All rights reserved.

3. Compare responsive design between CSS and JavaScript

Page 19: 10 Building Blocks for Enterprise JavaScript

Copyright © 2014, Oracle and/or its affiliates. All rights reserved.

Page 20: 10 Building Blocks for Enterprise JavaScript

Copyright © 2014, Oracle and/or its affiliates. All rights reserved.

CSS: Not Only Styling of Documents

● Originally, CSS was designedas a stylesheet language for describingthe look and feel of documents.

● Unlike previous versions, CSS3is modular: over 50 modulesmake up CSS3.

● “Media Query” is the most well known.● Tailer to different resolutions.● Enable responsive design.● But... also take a look at JavaScript for this.

Page 21: 10 Building Blocks for Enterprise JavaScript

Copyright © 2014, Oracle and/or its affiliates. All rights reserved.

CSS: Maybe Less Effective Than JavaScript

● CSS3 Media Queriesshow/hide elements from the DOM.

● JavaScript librariesload/unload elements from the DOM.● Response.js:

http://responsejs.com● Foundation Interchange:

http://foundation.zurb.com

Page 22: 10 Building Blocks for Enterprise JavaScript

Copyright © 2014, Oracle and/or its affiliates. All rights reserved.

Demos

Page 23: 10 Building Blocks for Enterprise JavaScript

Copyright © 2014, Oracle and/or its affiliates. All rights reserved.

4. Evaluate the framework vs. library approach

Page 24: 10 Building Blocks for Enterprise JavaScript

Copyright © 2014, Oracle and/or its affiliates. All rights reserved.

Page 25: 10 Building Blocks for Enterprise JavaScript

Copyright © 2014, Oracle and/or its affiliates. All rights reserved.

Page 26: 10 Building Blocks for Enterprise JavaScript

Copyright © 2014, Oracle and/or its affiliates. All rights reserved.

Page 27: 10 Building Blocks for Enterprise JavaScript

Copyright © 2014, Oracle and/or its affiliates. All rights reserved.

Different Libraries, Different Purposes• Application Frameworks & Libraries

Angular, Knockout, Backbone, Ext, React, Ember, and more• Component Libraries

JQuery UI, Sencha, PrimeFaces, and more• Module Systems

RequireJS, Browserfy, and more• Build Systems

Grunt, Gulp, Brunch, and more• Testing Frameworks

Protractor, Jasmine, Qunit, Karma, and more

Page 28: 10 Building Blocks for Enterprise JavaScript

Copyright © 2014, Oracle and/or its affiliates. All rights reserved.

Frameworkapproach:

Libraryapproach:

Page 29: 10 Building Blocks for Enterprise JavaScript

Copyright © 2014, Oracle and/or its affiliates. All rights reserved.

5. Incorporate modularity

Page 30: 10 Building Blocks for Enterprise JavaScript

Copyright © 2014, Oracle and/or its affiliates. All rights reserved.

Page 31: 10 Building Blocks for Enterprise JavaScript

Copyright © 2014, Oracle and/or its affiliates. All rights reserved.

Modularity: Not Natively Built into JavaScript, Right Now

● Consider and compare available modularity solutions● Require.js:

http://requirejs.org/● Browserify:

http://browserify.org/● SystemJS● ECMAScript 6 Modules

Page 32: 10 Building Blocks for Enterprise JavaScript

Copyright © 2014, Oracle and/or its affiliates. All rights reserved.

Demos

Page 33: 10 Building Blocks for Enterprise JavaScript

Copyright © 2014, Oracle and/or its affiliates. All rights reserved.

6. Evaluate abstractions overJavaScript, CSS, and HTML

Page 34: 10 Building Blocks for Enterprise JavaScript

Copyright © 2014, Oracle and/or its affiliates. All rights reserved.

Page 35: 10 Building Blocks for Enterprise JavaScript

Copyright © 2014, Oracle and/or its affiliates. All rights reserved.

HTML: Emmet

JavaScript: TypeScript, CoffeeScript

CSS: SASS, LESS

Page 36: 10 Building Blocks for Enterprise JavaScript

Copyright © 2014, Oracle and/or its affiliates. All rights reserved.

7. Don't worry about ecosystem volatility

Page 37: 10 Building Blocks for Enterprise JavaScript

Copyright © 2014, Oracle and/or its affiliates. All rights reserved.

Page 38: 10 Building Blocks for Enterprise JavaScript

Copyright © 2014, Oracle and/or its affiliates. All rights reserved.

Life in a Volatile Ecosystem

● Lifespan of your app equals lifespan of the framework you're using.● 1 ½ to 2 year lifespan.● Is the code hard to read, no worries, it'll be rewritten from scratch soon.● Don't worry so much about maintainability and backward compatibility.● Things change fast, the ecosystem is already different right now

than when this presentation started.

Page 39: 10 Building Blocks for Enterprise JavaScript

Copyright © 2014, Oracle and/or its affiliates. All rights reserved.

Page 40: 10 Building Blocks for Enterprise JavaScript

Copyright © 2014, Oracle and/or its affiliates. All rights reserved.

8. Reorientate around WONTA instead of WORA

Page 41: 10 Building Blocks for Enterprise JavaScript

Copyright © 2014, Oracle and/or its affiliates. All rights reserved.

Page 42: 10 Building Blocks for Enterprise JavaScript

Copyright © 2014, Oracle and/or its affiliates. All rights reserved.

Write Once, Never Touch Again

Page 43: 10 Building Blocks for Enterprise JavaScript

Copyright © 2014, Oracle and/or its affiliates. All rights reserved.

9. Evaluate corporate frameworks

Page 44: 10 Building Blocks for Enterprise JavaScript

Copyright © 2014, Oracle and/or its affiliates. All rights reserved.

Page 45: 10 Building Blocks for Enterprise JavaScript

Copyright © 2014, Oracle and/or its affiliates. All rights reserved.

Unexpected Organizations in Enterprise JavaScriptand open source software projects in general

● Microsoft – several● IBM – several● SalesForce – several● ING – github.com/Spectingular (AngularJS-based component framework.)● PayPal – krakenjs.com (Node.js/Express based application framework.)● Oracle – oraclejet.org (Toolkit of open source JavaScript libraries.)● And more.

Page 46: 10 Building Blocks for Enterprise JavaScript

Copyright © 2014, Oracle and/or its affiliates. All rights reserved.

Page 47: 10 Building Blocks for Enterprise JavaScript

Copyright © 2014, Oracle and/or its affiliates. All rights reserved.

Page 48: 10 Building Blocks for Enterprise JavaScript

Copyright © 2014, Oracle and/or its affiliates. All rights reserved.

Requirements First

• Responsive Design• Modularity• Single Page Application• Accessibility• Internationalization• Security & Performance Optimization• Conformance to Standards• Documentation & Support

Page 49: 10 Building Blocks for Enterprise JavaScript

Copyright © 2014, Oracle and/or its affiliates. All rights reserved.

Oracle IoT Cloud Service

Page 50: 10 Building Blocks for Enterprise JavaScript

Copyright © 2014, Oracle and/or its affiliates. All rights reserved.

Oracle JET: Free & Open Source Enterprise JavaScriptOracle JavaScript Extension Toolkit

• oraclejet.org, @oraclejet, github.com/oracle/oraclejet• Not a framework, not a library, but a toolkit• Collection of open source libraries, e.g., Require, Knockout, JQuery• Free and open source component library (Graphs, Charts, etc)• Architecture and templates• Enterprise solutions, e.g., accessibility• Actively used within Oracle, since about 3 years

Page 51: 10 Building Blocks for Enterprise JavaScript

Copyright © 2014, Oracle and/or its affiliates. All rights reserved.

Page 52: 10 Building Blocks for Enterprise JavaScript

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. Twitter: @oraclejet

Page 53: 10 Building Blocks for Enterprise JavaScript

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. Twitter: @oraclejet

Page 54: 10 Building Blocks for Enterprise JavaScript

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. Twitter: @oraclejet

Page 55: 10 Building Blocks for Enterprise JavaScript

Copyright © 2014, Oracle and/or its affiliates. All rights reserved.

Page 56: 10 Building Blocks for Enterprise JavaScript

Copyright © 2014, Oracle and/or its affiliates. All rights reserved.

Page 57: 10 Building Blocks for Enterprise JavaScript

Copyright © 2014, Oracle and/or its affiliates. All rights reserved.

Oracle JET: Free & Open Source Enterprise JavaScriptOracle JavaScript Extension Toolkit

• oraclejet.org, @oraclejet, github.com/oracle/oraclejet• Not a framework, not a library, but a toolkit• Collection of open source libraries, e.g., Require, Knockout, JQuery• Free and open source component library (Graphs, Charts, etc)• Architecture and templates• Enterprise solutions, e.g., accessibility• Actively used within Oracle, since about 3 years

Page 58: 10 Building Blocks for Enterprise JavaScript

Copyright © 2014, Oracle and/or its affiliates. All rights reserved.

10. Reconsider JavaScript as assembly language

Page 59: 10 Building Blocks for Enterprise JavaScript

Copyright © 2014, Oracle and/or its affiliates. All rights reserved.

Page 60: 10 Building Blocks for Enterprise JavaScript

Copyright © 2014, Oracle and/or its affiliates. All rights reserved.

Page 61: 10 Building Blocks for Enterprise JavaScript

Copyright © 2014, Oracle and/or its affiliates. All rights reserved.

Write in Java – Let Framework Create JavaScript

● https://github.com/jashkenas/coffeescript/wiki/list-of-languages-that-compile-to-js● Vaadin: http://vaadin.com● DukeScript: http://dukescript.com

● Framework for creating applications for all devices from single codebase.● Plain Java applications that internally use JavaScript and HTML.● Business logic in Java and view in HTML.● Maven archetypes in Maven central.

Page 62: 10 Building Blocks for Enterprise JavaScript

Copyright © 2014, Oracle and/or its affiliates. All rights reserved.

Write in Java – Let Framework Create JavaScript

Page 63: 10 Building Blocks for Enterprise JavaScript

Copyright © 2014, Oracle and/or its affiliates. All rights reserved.

Write in Java – Let Framework Create JavaScript

Page 64: 10 Building Blocks for Enterprise JavaScript

Copyright © 2014, Oracle and/or its affiliates. All rights reserved.

10 Building Blocks of Enterprise JavaScript1. Resist the hype.

2. Rediscover HTML5 as an application framework.

3. Compare responsive design between CSS and JavaScript.

4. Evaluate the framework vs. library approach.

5. Incorporate modularity.

6. Evaluate abstractions over JavaScript, CSS, and HTML.

7. Don't worry about ecosystem volatility.

8. Reorientate around WONTA instead of WORA.

9. Evaluate corporate frameworks.

10. Reconsider JavaScript as assembly language.

Page 65: 10 Building Blocks for Enterprise JavaScript

Copyright © 2014, Oracle and/or its affiliates. All rights reserved.

Contact Details

@geertjanw

[email protected]

blogs.oracle.com/geertjan

Page 66: 10 Building Blocks for Enterprise JavaScript

Copyright © 2014, Oracle and/or its affiliates. All rights reserved.

The BigTrak ChallengeSimply complete the Oracle Stand (G6) course to be entered into our prize draw to win a BigTrak!

Visit the Oracle Stand to Win…

@Java | #Oracle | #Cloud