The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
ย
Slovenian Oracle User Group
1. Copyright ยฉ 2014, Oracle and/or its affiliates. All rights reserved.Copyright ยฉ 2014, Oracle and/or its affiliates. All rights reserved.
JavaScript in the Enterprise
for Java Developers
Geertjan Wielenga
@geertjanw
Oracle
3. Copyright ยฉ 2014, Oracle and/or its affiliates. All rights reserved.
A metaphor
for our age!
The distracted
society!
Facebook
beats
Rembrandt!
(And the end
of the world
is nigh.)
4. Copyright ยฉ 2014, Oracle and/or its affiliates. All rights reserved.
Actually...
They're using
a museum app.
And are finding
out more about
the paintings they
had been closely
focused on a few
minutes earlier.
5. Copyright ยฉ 2014, Oracle and/or its affiliates. All rights reserved.
Browser platform Java platform
7. Copyright ยฉ 2014, Oracle and/or its affiliates. All rights reserved.
10 Building Blocks of Enterprise JavaScript
1. 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.
8. Copyright ยฉ 2014, Oracle and/or its affiliates. All rights reserved.
1. Resist the hype
10. Copyright ยฉ 2014, Oracle and/or its affiliates. All rights reserved.
โ Data heavy
monitoring systems.
โ Behind the firewall
management systems.
โ Large resolution
requirements.
โ All the users
in the same room.
11. Copyright ยฉ 2014, Oracle and/or its affiliates. All rights reserved.
1a. Consider supplementing
with new devices
12. Copyright ยฉ 2014, Oracle and/or its affiliates. All rights reserved.
โ Mobile app
to receive urgent notifications
for air traffic controlers.
โ Web app
to display reports
for upper management.
โ And keep the main system
exactly as it has always been
since that's how it makes sense.
13. Copyright ยฉ 2014, Oracle and/or its affiliates. All rights reserved.
2. Rediscover HTML5 as an
application framework
15. 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 semantically
describing scientific documents.
โ
HTML5 is a response to
demands 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'.
16. 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 easier
than previous versions.
โ
Scripting should be replaced
by more markup.
โ
HTML5 should be device independent.
21. Copyright ยฉ 2014, Oracle and/or its affiliates. All rights reserved.
CSS: Not Only Styling of Documents
โ
Originally, CSS was designed
as a stylesheet language for describing
the look and feel of documents.
โ
Unlike previous versions, CSS3
is modular: over 50 modules
make 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.
22. Copyright ยฉ 2014, Oracle and/or its affiliates. All rights reserved.
CSS: Maybe Less Effective Than JavaScript
โ
CSS3 Media Queries
show/hide elements from the DOM.
โ
JavaScript libraries
load/unload elements from the DOM.
โ
Response.js:
http://responsejs.com
โ
Foundation Interchange:
http://foundation.zurb.com
23. Copyright ยฉ 2014, Oracle and/or its affiliates. All rights reserved.
Demos
24. Copyright ยฉ 2014, Oracle and/or its affiliates. All rights reserved.
4. Evaluate the
framework vs. library approach
28. 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
29. Copyright ยฉ 2014, Oracle and/or its affiliates. All rights reserved.
Framework
approach:
Library
approach:
30. Copyright ยฉ 2014, Oracle and/or its affiliates. All rights reserved.
5. Incorporate modularity
32. 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
33. Copyright ยฉ 2014, Oracle and/or its affiliates. All rights reserved.
Demos
34. Copyright ยฉ 2014, Oracle and/or its affiliates. All rights reserved.
6. Evaluate abstractions over
JavaScript, CSS, and HTML
39. 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.
46. Copyright ยฉ 2014, Oracle and/or its affiliates. All rights reserved.
Unexpected Organizations in Enterprise JavaScript
and open source software projects in general
โ
Microsoft โ several
โ
IBM โ several
โ
SalesForce โ several
โ
SAP โ SAP UI5 and Fiori
โ
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.)
49. 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
50. Copyright ยฉ 2014, Oracle and/or its affiliates. All rights reserved.
Oracle JET: Free & Open Source Enterprise JavaScript
Oracle 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 and enterprise solutions, e.g., accessibility
โข
Actively used within Oracle, since about 3 years
57. Copyright ยฉ 2014, Oracle and/or its affiliates. All rights reserved.
Oracle JET: Free & Open Source Enterprise JavaScript
Oracle 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 and enterprise solutions, e.g., accessibility
โข
Actively used within Oracle, since about 3 years
58. Copyright ยฉ 2014, Oracle and/or its affiliates. All rights reserved.
10. Reconsider JavaScript
as assembly language
61. 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.
62. Copyright ยฉ 2014, Oracle and/or its affiliates. All rights reserved.
Write in Java โ Let Framework Create JavaScript
63. Copyright ยฉ 2014, Oracle and/or its affiliates. All rights reserved.
Write in Java โ Let Framework Create JavaScript
64. Copyright ยฉ 2014, Oracle and/or its affiliates. All rights reserved.
10 Building Blocks of Enterprise JavaScript
1. 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.
65. Copyright ยฉ 2014, Oracle and/or its affiliates. All rights reserved.
Contact Details
@geertjanw
@oraclejet
geertjan.wielenga@oracle.com
blogs.oracle.com/geertjan