2017-11 DZone Guide To Web Development Vol. II PDF
2017-11 DZone Guide To Web Development Vol. II PDF
Web
Development
Frameworks & Responsive Design
VOLU ME I I
and older ones are evolving to adapt to the most recent 9 Checklist: Implementing Effective User Password Management:
trends. The tech industry leaders are contributing back to Do’s and Don’ts
BY GABRIELE TOMASSETTI
the community with exciting new ideas and technology
almost daily, and everyone seems pretty focused on 12 A View to Vue.js
BY RAYMOND CAMDEN
delivering the best experience possible to the end user. It’s
a vibrant market, and while some argue that it’s lost focus 14 5 Dev Practices to Ensure Stellar Website Introduction
and generated a lot of noise, I tend to disagree. BY AMIR ROZENBERG
We have some exciting research findings, proving that Ashley Slate SALES
DESIGN DIRECTOR Kara Phelps
Matt O’Brian CONTENT AND COMMUNITY MANAGER
the web is evolving fast, and web developers are quick to
Billy Davis DIRECTOR OF BUSINESS DEV.
TypeScript with Redux if you want to introduce type Miranda Casey Chris Brumfield
SALES MANAGER
MARKETING SPECIALIST
safety on your application. And much, much more. Ana Jones
Julian Morris ACCOUNT MANAGER
MARKETING SPECIALIST
Tom Martin
I hope you enjoy reading the content as much as I did, and ACCOUNT MANAGER
that you find our research useful. I’ll just leave a final word of
Want your solution to be featured in coming guides? Special thanks to our
appreciation to our sponsors and contributors and let you Please contact [email protected] for submission information. topic experts, Zone
dive deep into yet another excellent guide. Happy reading. Leaders, trusted DZone
Like to contribute content to coming guides? Most Valuable Bloggers,
Please contact [email protected] for consideration. and dedicated users
BY HERNANI CEQUEIRA for all their help and
Interested in becoming a dzone research partner? feedback in making this
DISTINGUISHED ENGINEER, DZONE Please contact [email protected] for information. guide a great success.
and you get a thriving and growing community the Chrome developer tools, check them out and become
familiar with the ways they can help in the development
of web developers. We asked 406 members of this
process. Mozilla also has an excellent reputation for
community for their thoughts on the field and the
encouraging open source development, offering an
suite of technologies available. expansive set of documentation and their own developer
browser in which devs can edit and write HTML, CSS, and
JavaScript code. But, while Chrome and Mozilla remain
ANGULAR IS THE DOMINANT CLIENT-SIDE
great options for developers, other browsers remain in
FRAMEWORK
wide use outside of IT, and should thus be tested against
DATA Angular currently sits atop the frameworks hierarchy,
during the development process.
with 79% of respondents using it to create applications,
compared to 64% last year, and 62% of respondents said
they’re interested in using it further or learning more about A SHIFT TOWARD NOSQL DATABASES
this framework. Additionally, TypeScript is one of the most DATA MySQL and Oracle DB both saw decreased use since
favored “flavors” of JavaScript right now, with a 52% use rate last year’s survey, with MySQL falling from a 61% use rate
among respondents, up from 32% last year. This growth in 2016 to 57% in 2017, and Oracle DB from 38% to 32%. In
among Angular users sits in stark opposition to React, which opposition to this decrease, NoSQL databases MongoDB
has stayed static year-over-year in terms of user growth, and Redis increased in popularity, from a 42% - 46% and
coming in at 30% over our last two community surveys. 19% - 24% use rate, respectively.
IMPLICATIONS While the Google team did a great job with IMPLICATIONS As more companies and organizations,
Angular, the main reason for its resounding success could even those outside the development space, create web
be that it is the only true framework designed to create full applications to interact with users, their data is growing.
web applications. Out of its main competitors, React and This requires a more easily scalable solution, such as
Backbone (though often included under the “frameworks” NoSQL databases. NoSQL is also more agile due to its more
category) are in fact libraries, and Vue.js, while it can dynamic, schema-less data model, and is probably seeing
be used as a framework, was designed to create User a boon from the growth of Agile development processes.
Interfaces. TypeScript seems to be growing in popularity Redis in particular is known as a light-weight solution,
due to its being a superset of JavaScript, allowing which can second as a messaging queue, a helpful feature
developers to make improvements, such as type safety, to for web developers working with UI/UX.
the most widely-used web development language today.
RECOMMENDATIONS While NoSQL databases are
RECOMMENDATIONS Become familiar with the Angular not perfect, they are currently the best option for web
framework, and the TypeScript iteration of the JavaScript developers, as they allow for agility and scalability in
language. Backed by Google, this framework will only development. If your team is not yet using a non-relational
continue to improve and become easier to use, and database, testing out options such as MongoDB and Redis
developers should take advantage. should be on your radar.
Key
• 18% of respondents work at organizations
with more than 10,000 employees; 18% work
at organizations between 1,000 and 10,000
Research
employees; and 22% work at organizations
between 100 and 1,000 employees.
Findings
develop enterprise business apps; and 24%
develop native mobile applications.
FRAMEWORKS
BY G . R YA N S PA I N The Angular JavaScript framework was the most popular
P R O D U C T I O N C O O R D I N ATO R , DZO N E in our 2016 Web Development survey, and this year its
popularity has only increased. While use of Angular 1
DEMOGRAPHICS decreased slightly from 59% to 57%, use of Angular 2
406 software professionals completed DZone’s increased from 33% to 46%. Overall, respondents who have
used some form of Angular increased from 64% in 2016
2017 Web Development survey. Respondent
to 79% this year. React, the next most popular framework
demographics are as follows:
behind the Angulars, remained unchanged year over year
• 40% of respondents identify as developers at 30%. Vue, on the other hand, increased dramatically
or engineers, 19% identify as developer team from results in 2016, going from 3% to 10%. React, while
leads, and 15% identify as software architects. its response was static from last year, is the framework
respondents have the most interest in trying, with 58% of
• The average respondent has 12 years of responses (up 8% from last year). Angular 2 had a minor
experience as an IT professional. 60% of boost in interest as well, increasing from 50% to 54% since
respondents have 10 years of experience or last year’s survey. On average, respondents have used 1.633
more; 21% have 20 years or more. client-side frameworks for web development.
Which browsers do you actively develop for? Which databases are you using with your web apps?
39% PostgreSQL
40% Internet Explorer
32% SQL Server
32% Safari
32% Oracle DB
27% Edge
24% Redis
1% Tor 8% Other
0 20 40 60 80 100 0 10 20 30 40 50 60
said they use JavaScript for web development, 78% said mobile devices, the most popular individual devices were
they use HTML/CSS, and 72% said they use Java. 54% of the iPhone 7 (37%), the iPhone 6 and the Samsung Galaxy
respondents said they use all three of these, and only 5% of s7 (both 33%). 46% of respondents said they target at least
respondents said they don’t use any. Next up were PHP and one iPhone, and 42% target at least one Samsung phone;
Python, with 22% and 21% respectively. When asked about 53% said they target at least one mobile device.
what languages respondents’ organizations used, results
were nearly identical, but PHP (29%) and Python (27%) BACKEND AND BEHIND THE SCENES
were occasionally recognized as languages used for web The most popular databases behind web applications
development elsewhere in a respondent’s organization. among respondents were MySQL (57%), MongoDB (46%),
ASP.NET received some recognition as well, being used and PostgreSQL (39%). For web servers, respondents
in 23% of respondents’ companies, while only 15% of preferred Apache Tomcat (57%) and Apache Web Server
respondents said they use it themselves. Respondents (54%), with third place going to NGINX (41%). Respondents
who need to push real-time/streaming data from their
said they use an average of 3.44 different languages when
server overwhelmingly said they use the WebSocket API
developing for the web, and said their organizations use
(71%) over other methods like HTTP streaming (35%) and
an average of 3.77. For JavaScript, most respondents said
polling (27%); HTTP streaming did gain a 9% increase from
they use ECMAScript (62%) or TypeScript (52%), with only
the 2016 results, while WebSocket dropped 6%. For web
14% of respondents answering that they have used third-
app testing, Selenium was heavily used (56%), followed by
place CoffeeScript.
Jasmine (26%) and PhantomJS (25%). npm (63%) dominated
over package managers Bower (29%—a 7% drop from 2016)
BROWSERS AND DEVICES and Webpack (28%—an 8% increase).
Google Chrome remains the browser most actively
developed for—95% of respondents said they develop with
Google’s browser particularly in mind (compared to 96% Which languages are you currently building for
last year). Mozilla Firefox and Internet Explorer, the next web apps?
two most popular browsers to target, had more significant
90
decreases from last year’s responses, with Firefox JavaScript
dropping from 77% to 72%, and IE dropping from 51% to 84
80 HTML/CSS
40%. Even with fewer respondents actively developing for
78 Java
Internet Explorer, the increase in responses for Microsoft
Edge was underwhelming, changing from 25% to 27%. For 72
60
Do you work more in the front-end or back-end of
your web application?
11%
Front-end 11% 40
32
PHP
Python
20 22 22
ASP.NET
15 Ruby
Other
Full Stack 52% 8 7
Go
7
0
QUICK VIEW
Using TypeScript
01 Even though Redux comes with its
own annotations, adding your own
can help restrict possible issues.
with Redux
more effective.
Redux is a library that provides a way to manage The interesting part here is the reducer function counter.
application state in one place. Not every application The signature of this function is critical: it accepts a state (of
any shape), an action (which must have a “type” field), and
needs help with this, but for many applications,
returns a state of the same shape as the original. Get this
it can simplify access to this global state without
wrong, and your program can break in subtle ways.
causing incidental complexity by restricting the ways
it can be updated and accessed. If only there was some way to enforce this signature to
prevent this.
Redux is all well and good by itself, but using
We can start by defining the shape of our state:
TypeScript, we can add type annotations to greatly
increase the type-safety of Redux-based React type AppState = number
TYPING REACT-REDUX
With our state and dispatch types, we can make a React
integration that much more type-safe as well.
Redux is all well and good by itself,
When writing a component with providers — as we do when
but using TypeScript, we can add type we use react-Redux’s connect — I like to split its props into
parts based on who provides them.
interface DispatchProps {
increment: () => void
decrement: () => void
}
import { createStore, combineReducers } from ‘Redux’
import * as counter from ‘./reducers/counter’ class MyComponent extends React.PureComponent<StateProps &
import * as todos from ‘./reducers/todos’ DispatchProps, {}> {
// ...
type AppState = { }
counter: counter.State, This will let us annotate the functions that we’ll be
todos: todos.State providing to connect:
} import { connect } from ‘react-Redux’
Firstly, our reducers are now strongly typed, right down to •• The dispatch provider is similarly annotated to
their accepted actions — no sign of an any type anywhere, accept AppDispatch and return DispatchProps. Using
nor is it possible to forget to return the state. AppDispatch ensures that our calls to dispatch can only
be made with valid messages — if we misspell a type or
In addition, dispatch functions will only accept valid actions miss an argument, the compiler (or our editor tooling)
(provided that they have been annotated as described above). will catch it and tell us.
I find that this obviates the need for a separate action-
generating function as many Redux guides recommend. We SUMMARY
could, of course, provide such a function: Although Redux comes with its own types for the above, they
lean heavily on TypeScript’s any type. By providing our own
const incrementAction = (): IncrementAction => ({ implementations of the State, Action, and Dispatch types we
type: ‘INCREMENT’ can gain vastly increased type safety.
}
users to have a password longer than 8 characters is dangerous. If it is too the idea that practicing typing a password facilitates remembering it. It does
long users will bypass them with repeatable patterns like toolongtoolong. not work and it is annoying to people that use password managers.
Most cite the key advantages of a single code base and consistent user
Why is 33
experience across platforms. These advantages also create a multiplier
effect on testing:
the Answer?
2. Visual validation across CSS break points, and
3. Use traffic analytics to determine appropriate lab size So why is 33 the answer? Thirty-three is
4. Extend functional test automation to include visual verification the number of web platforms required to
across break points achieve 80% market coverage. But think
about applying a “current, beta, last”
5. Embrace TDD and then progressively test every build, every approach across five browser platforms, and
merge, every night don’t forget about mobile devices. So, full
6. Deliver fast feedback coverage requires adding in thirty-two mobile
devices. Turns out the answer isn’t 33, it is 55!
While much has been written about the need to automate and the de
facto automation framework of choice — Selenium — more work is WRITTEN BY CARLO CADET
needed to define guidelines on building the right strategy. DIRECTOR OF PRODUCT MARKETING, PERFECTO
The team grew test automation by 50%. By implementing more automation and parallel • Analyze fast, fix fast: provide developers
execution, regression duration dropped from 160 hours to less than 12 hours, a 94% acceleration. the artifacts to reproduce and trouble shoot
issues
Next up was scaling browser coverage. Testing coverage went from the latest version of
two browsers using one Windows OS to supporting all five-leading browsers running the • Continuous testing in production:
current, beta, and one prior version, now totaling 36 browsers, a 17x improvement. Proactively monitor the real customer
experience
This acceleration enabled shorter sprints and shifted testing earlier. Regression testing
was previously executed once, maybe twice per sprint. Today, the team is receiving faster
NOTABLE CUSTOMERS
feedback with smoke tests executed every build and full nightly regression runs.
• Elevate • Paychex
Partnering with Perfecto resulted in a faster time-to-market and better quality at the same budget.
• R&V • ING
The team is well on its way towards delivering flawless user experiences. • Verizon • Kaiser Permanente
QUICK VIEW
A View to Vue.js
02 Vue provides a simple and
intuitive syntax for data binding
and dynamic expressions.
BY RAYMOND CAMDEN
DEVELOPER ADVOCATE, IBM
If you’re like me, you’ve likely been bombarded over First, a bit of HTML. (The HTML has been simplified to save space,
the past few years by Angular and React content. including removing the script tag to load Vue itself.)
<div id=”app”>
<input v-model=”term” type=”search”>
<button @click=”search”>Search</button>
</p>
<div v-for=”result in results”>
<img :src=”result.artworkUrl100”>
<b>Artist:</b> {{result.artistName}}<br/>
<b>Track:</b> {{result.trackName}}<br/>
<br clear=”left”>
</div>
</div>
The first input field uses a similar syntax to the first example,
using v-model to tell Vue, “Connect this value to a variable,
‘term’.” The button tag uses a shortcut “@click” to assign a click
handler to the button. You’ll see the code assigned to that in
a moment. Of course, there’s a lot more to the template rendering syntax,
conditionals for example. The general form would look like this:
The fun part is the result render. By using v-for in the div, we’ve
said, “Repeat this div for every item in the results array and assign <div v-if=”somethingIsCool”>Cool.</div>
let app = new Vue({ In this example, when the value of somethingIsCool is truthy, the
el:’#app’, coolItem is added as a class value for the div.
data:{
term:’’, Again, the idea here is to provide simple shortcuts for common
results:[]
use cases. To me, it feels like I’ve got the power of Angular with
},
nearly zero overhead.
methods:{
search:function() {
fetch(`https://itunes.apple.com/ WHERE NEXT?
search?term=${encodeURIComponent(this. Obviously, the first place you’ll want to start is the
term)}&limit=10&media=music`) Vue homepage. Once there, start looking at the
.then(res => res.json()) Guide as it walks you through the basics into the
.then(res => {
more complex tutorials. Then follow up with this
this.results = res.results;
incredible five-part guide to Vue by Sarah Drasner.
});
Chrome and Firefox uses can also find a devtools
} extension to help development. Mouse over that
} “Ecosystem” dropdown on the Vue page for a good
}) list of other related resources as well (see right).
And that’s it. No creating long strings of HTML to inject into the RAYMOND CAMDEN is a developer advocate for IBM. His
HTML, no event handlers defined by hand. Vue basically made work focuses on LoopBack, serverless, hybrid mobile development,
Node.js, HTML5, and web standards in general. He’s a published
shortcuts for all of the things we commonly do when working
author and presents at conferences and user groups on a variety of
with JavaScript and HTML and made it as easy as pie. You can run
topics. Raymond can be reached at his blog, on Twitter, or via email.
this online yourself here. Here’s an example of it running:
QUICK VIEW
Introduction
Data, ability to debug quickly,
BDD, and ATDD).
BY AMIR ROZENBERG
DIRECTOR OF PRODUCT MANAGEMENT, PERFECTO MOBILE
People have been creating websites for the longest post-commit to get fast feedback. This is the best, cheapest, and
safest time to find a defect: the code is still fresh in the developers’
time. Some may say “HTML is HTML”. Well, not
head, it won’t take long to fix, and there’s no added risk by
exactly: websites are now rendered on many different
undoing code that was built on top of this recent code. A high-
types of devices, browsers, form factors etc. New quality website is the end goal of the entire team, regardless if you
technologies enable HTML5 to offer content and are part of the dev, design, test, or ops team.
services according to the user’s context (location,
It’s not to say traditional QA activities would all move into the
time etc.). At the same hands of developers. Load testing, for example, may not be
time, development cycles suitable for a development environment, but the more agile the
accelerate and sprints are quality activities can realistically be, the better.
EMBRACE QUALITY ACTIVITIES (AS PART OF •• Developers need to learn and see the value delivered,
DEVELOPMENT) otherwise they won’t do it.
We’re increasingly observing the fallacy of the separation between
dev and quality activities. Defects are often found late, anytime •• Taking advantage of the test automation pyramid and
between mid-sprint and production. Developers then spend implementing more API tests at the expense of UI tests is
expensive hours undoing code to correct the issue, creating more a way to reduce testing time while practicing agile testing.
QA work, increasing risk, and eventually jeopardizing the app’s Another modern approach for web dev and testing is to
success. leverage headless browsers for unit testing (i.e. Google’s
puppeteer project).
The way to address this expensive cycle is to expand the
“definition of done” to include some level of code verification. In •• Don’t underestimate the importance of accessibility for
other words, developers need to run a few tests pre-commit and your website. This is becoming a big deal for many reasons,
including site SEO, adoption, and compliance. Testing for site to reduce
ESSENTIALdependencies,
WEB FAMILY achieve WEB
ENHANCED more, and reduce
FAMILY risk.WEB
EXTENDED ForFAMILY
accessibility is quite hard to automate on mobile devices example, mature agile teams
Chrome Latest/Win 10
take responsibility/ownership
Chrome Beta/Win 7
for
Chrome Latest/Win 8.1
compared to the more mature web testing tools. However,
Chrome Latest/Mac OS Latest Chrome -1/Win 7 Chrome Beta/Win 8.1
the complexity of doing so shouldn’t be an excuse not to do
Firefox Latest/Win 10 Firefox Beta/Win 10 Chrome -1/Win 8.1
it at all.
IE 11/Win 10 Firefox Latest/Win 7 Firefox Latest/Win 8.1
Safari Latest/MacOS Latest Firefox -1/Win 10 Firefox -1/Win 8.1
FOCUS VIGILENTLY Edge Latest/Win 10 Safari Latest/MacOS -1 Firefox Beta/Win 8.1
Assuming we agree that developers pick some quality activities,
Chrome Beta/Win 10 IE 11/Win 7 Safari -1/MacOS Latest
the question becomes, “What’s relevant and vital for developers
Chrome Beta/Win 7 IE 1/Win 8.1 Safari -1/MacOS -1
to work on?” Their time is expensive. One area where they should
Firefox - 1/Win 7 IE 9/Win 7 Firefox Beta/MacOS Latest
not be working is in a lab (maintaining emulators, browsers, or
Chrome -1/Win 10 Chrome -1/MacOS -1 Chrome Beta/MacOS Latest
devices). The effort to maintain a lab can become very time-
Chrome Latest/MacOS -1 IE 8/WIN 7
consuming very quickly: the lab needs updates, care, and
Firefox Beta/WIN 7
attention. A proper lab should provide all the means for coverage,
Total 10 Browser Permutations Total 12 Browser Permutations Total 11 Browser Permutations
automation, fast reporting, etc. The developer should only need
to describe the user flows that are important to test (matching
the code they are developing now) and which devices and the application behavior in production. There are several reasons/
browsers to test those on. Everything else should be automated. motivations to do so, to name a few:
Combina�ions
MEAN STACK
Package Management CDNs Part of the jQuery library is the
CDN hosted by Stackpath. Given jQuery's pop-
ularity, 50% of survey respondents use it.
(MongoDB,
ExpressJS, Angular,
node.js)
Tools NPM
GOOGLE HOSTED LIBRARIES
A collection of CDN libraries that can be added to several web
With 63% of members using it, npm frameworks. About 35% of DZone members use them.
JAVA +
SPRING is the most popular package management tool. It
LAMP STACK
(Linux, Apache, is also the default manager for node.js.
MySQL, Python)
ANGULAR
Angular has evolved from NPM SCRIPTS
its origins as just a framework to Even though it's not built to be a
a full platform for building HTML or
JavaScript web apps. It includes templates, dependency
build tool, npm can act as one thanks to npm
Scripts,which are used by 55% of respondents. Build Script
injection, end-to-end tooling, and more. A whopping 79% of
respondents have used some version of Angular.
BACKBONE.JS
Backbone was designed
for single-page application.
GULP.JS Tools
Gulp automates several repetitive web development tasks such as
REACT It has a reputation for being concatenation, and unit testing. 31% of DZone users automate tasks using
React was built by lightweight, and it's only dependent on the underscore.js Gulp.
Facebook to build large web library. 10% of developers use Backbone.js.
apps that can change over
time or in response to a user's VUE
action without reloading the page. 30% of Vue was specifically
DZone members have used React. designed to build user interfaces, and is
easy to integrate into projects with other JavaScript frame- JASMINE
MYSQL
an open source relational data-
base, used by 57% of respondents.
Databases
works. 10% of survey respondents use Vue.js. a lightweight
Frameworks SELENIUM
behavior-driven
development framework
for testing JavaScript. 26% of DZone
It's a core piece of the LAMP
stack and other –AMP stacks.
MONGODB
is a NoSQL document
database that stores
a tool for automating members use it.
web browsers for the data in JSON, BSON, or XML files, used
purposes of automated by 46% of DZone members.
testing. 56% of respondents use it.
Tes�ingTools
Recommended
Combina�ions
B.S.T.
P.M.T
Tes�ing .
Tools Databa se s
Frameworks
DZONE.COM/GUIDES DZONE’S GUIDE TO WEB DEVELOPMENT: FRAMEWORKS & RESPONSIVE DESIGN
QUICK VIEW
Defenses vs.
most common ways to exploit
systems.
Injection Attacks
actually do.
BY CHRIS LAMB
CYBER-SECURITY RESEARCH SCIENTIST, SANDIA NATIONAL LABORATORIES
Injection attacks are remarkably common. In fact, defense. Synchronizer tokens are a common defense against
they’re the backbone of most exploits; after all, in order this type of attack today, in many different application
delivery platforms.
to compromise a system, an attacker needs to inject
something into the system that executes. We see this These approaches are common, but still have significant
same pattern in remote code execution exploits, SQL problems. Content filtering is difficult to implement well,
injection, cross-site scripting, request forgery attacks, and leads to both false positive and negative issues. Granted,
many of these implementations today are well designed and
and so on. Most modern development platforms
effective, but they’re not free. Implementing the correct filters
support defenses against these kinds of techniques
takes time, thought, and experience; and processing every
out of the box simply by setting a few configuration submitted input string has a significant computational cost,
parameters. And, the vast majority of developers leave especially at scale. Tagging approaches fortunately tend to
it at that without really understanding what those scale and can be implemented at the application server level,
defenses do. but they also lead to more complexity, require additional
processing, and can be difficult to implement.
Well, we’re going to fix that today. With that in mind, let’s take a look at the different types of
injection attacks and their corresponding attack models to
INPUT FILTERING AND CONTENT MARKING understand how to best craft a defense for each approach.
We can look at these kinds of defenses as falling into two
distinct categories: input filtering or content marking. Content SQL INJECTION AND XSS DEFENSES
filtering involves, well, filtering content. We’ve been using Today, XSS and SQL Injection attacks are highly focused on
these approaches since, roughly, the beginning of time. filtering. This makes a certain amount of sense—both attack
Essentially, this involves scanning all submitted content, and models are the same, though the targets differ.
ensuring that the content contains no potentially harmful
strings, characters, symbols, or other input. We’ve used this
technique to scan submitted data in web applications for SQL
characters, for example, as well as for submitted JavaScript
syntax. The idea is that we can capture submitted SQL or
JavaScript, and by capturing those symbols, we can stop
them from being stored and potentially executed. Content
marking takes a different approach. Here, we somehow flag
all known good content and then check for that marker prior
to execution. This is a common cross-site request forgery Figure 1: shows the attack models of various XSS and SQL injection attacks.
Figure 1 shows the attack models of various XSS and SQL this approach leads to problems, like using the back button or
Injection attacks. Stored XSS attacks involve injecting content bookmarking a site).
through the application server into the underlying data store,
where the injected script is eventually sent to the target Furthermore, including the token in the URL can lead to
browser. Reflected XSS attacks are usually instigated via some token leaking. URLs are frequently saved in logs and browser
external program, like an email client, chat program, or SMS histories, where they can be accessed by attackers and used to
client that coerces the user to click on a specially-crafted URL circumvent CSRF protections.
The first and only enterprise CMS based on Git, enabling content and code to
flow seamlessly throughout development and deployment cycles.
DOWNLOAD
READ E-BOOK
CRAFTER CMS
craftersoftware.com
SPONSORED OPINION DZONE’S GUIDE TO WEB DEVELOPMENT: FRAMEWORKS & RESPONSIVE DESIGN
for Modern
with modern robust enterprise tools (Spring, Groovy scripting). A
headless CMS with REST APIs that deliver JSON (or XML) to any UI
development framework (React, Angular, Node, vanilla JavaScript,
really any UI technology).
Web Dev A CMS based on the most popular source code control system (Git)
that allows both content and code to seamlessly flow back and
forth through the development and deployment cycles. A CMS that
Modern web apps frequently contain a lot of content, including rich doesn’t rely on a single database architecture, but a distributed and
digital media. The most engaging apps keep their content and look/ decentralized data tier that scales out on the elastic web. A CMS
feel updated regularly, and they benefit from content targeting and that enables and actually accelerates agile development. And a
personalization to better address the end user needs. CMS that lets business users edit content and create personalized
digital experiences without developer support. Developers and users
As a result, developers must consider incorporating a content
working cohesively, but independently, together.
management system (CMS) into their development, allowing
business users to edit and manage content and optimize the
Now that would revolutionize modern day web development,
digital experience. However, traditional CMS platforms frustrate
wouldn’t you say? Learn more at craftersoftware.com.
web developers, slowing down development and deployment of
code. Legacy CMS solutions are monolithic, database-driven, with
incomplete APIs. And they usually constrain developers to using old WRITTEN BY RUSS DANNER
and restrictive UI tools and development processes. VICE PRESIDENT, PRODUCTS AT CRAFTER SOFTWARE
Crafter CMS
Crafter CMS enables rapid and agile development of innovative, high performance,
omni-channel digital experiences.
QUICK VIEW
Ktor to Create
elegant way.
Web Apps
with Kotlin.
When Google made Kotlin an official language and mainly non-blocking. ktor does not dictate which
for Android a few months ago at Google I/O, the frameworks or tools you use, so you can choose whatever
logging, DI, or templating engine you like. The library is
language quickly gained a lot of popularity in the
pretty light-weight in general, but is still very extensible
Android world. On the server side though, Kotlin is
through a plugin mechanism.
not as broadly adopted, and some people still seem
to be cautious when backend services are involved. One of the greatest advantages attributed to Kotlin is
Other developers are convinced that Kotlin is its ability to provide type-safe builders, also known as
mature enough and can safely be used for any Domain Specific Languages (DSL). Many libraries already
server application in which Java could play a role provide DSLs as an alternative to common APIs, such as
otherwise. the Android library Anko, the Kotlin html builder, or the
freshly released Spring 5 framework. As we will see in the
If you want to develop web apps with Kotlin, upcoming examples, ktor also makes use of such DSLs,
which enable the user to define the web app’s endpoints in a
you can choose from various web frameworks
very declarative way.
like Spring MVC/WebFlux, Vert.x, Vaadin, and
basically everything available for the JVM. Besides
EXAMPLE APPLICATION
the aforementioned frameworks, there’s also a In the following example, a small RESTful web service will
Kotlin specific library available for creating web be developed with ktor. The service will use an in-memory
applications, called ktor. After reading this article, repository with simple Person resources, which it exposes
you’ll know what ktor is, its advantages are, and how through a JSON API. Let’s look at the components.
you can quickly develop a web application in Kotlin.
PERSON RESOURCE AND REPOSITORY
KTOR According to the app’s requirements, a resource “Person” is
The web application framework ktor, written in Kotlin, defined as a data class, and the corresponding repository is
is meant to provide a tool for quickly creating web defined as an object, Kotlin’s way of applying the Singleton
applications with Kotlin. The resulting software may pattern to a class.
be hosted in common servlet containers, like Tomcat,
or standalone in a Netty, for example. Whatever kind of data class Person(val name: String, val age: Int){
hosting you choose, ktor is making heavy use of Kotlin var id: Int? = null
}
coroutines, so that it’s implemented 100% asynchronously
The Person repository is rather unspectacular and not ktor does not dictate which
worth observing. It uses an internal data store and provides
common CRUD operations. frameworks or tools you use, so
Requests all Person resources qualifiers. This is done by invoking install() multiple times,
/persons/{ID} DELETE
to be removed by its ID a function for adding certain ApplicationFeatures into
the request processing pipeline of the application. These
Requests to store a new Per-
/persons POST features are optional and the user can choose from various
son resource
types. The only interesting feature in the shown example is
Delivers a simple HTML page
/ GET ContentNegotiation, which is used for the (de-)serialization
welcoming the client
of Kotlin objects to and from JSON, respectively. The Gson
library is used as a backing technology.
ROUTING WITH KTOR
Now ktor comes into play with its structured DSL, which The routing itself is demonstrated by defining the GET
will be used for defining the previously shown endpoints, a endpoint for retrieving all Person resources here. It’s
process often referred to as “routing.” Let’s see how it works: actually straight-forward since the result of the repository
call getAll() is just delegated back to the client. The call.
fun Application.main() { respond() invocation will eventually reach the GsonSupport
install(DefaultHeaders) feature, taking care of transforming the Person into its JSON
install(CORS) {
representation. The same happens for the remaining four
maxAge = Duration.ofDays(1)
} REST endpoints, which will not be shown explicitly here.
install(ContentNegotiation){
register(ContentType.Application.Json,
GsonConverter()) THE HTML BUILDER
} Another cool feature of ktor is its integration with other
Kotlin DSLs like the HTML builder, which can be found on
routing {
get(“/persons”) { GitHub. By adding a single additional dependency to a ktor
LOG.debug(“Get all Person entities”) app, this builder can be used with the extension function
call.respond(PersonRepo.getAll())
call.respondHtml(), which expects type-safe HTML code to
}
} be provided. In the following example, a simple greeting to
// more routings the readers is included, which the web service exposes as its
} index page.
TESTING
A web framework or library is only applicable if it comes
with integrated testing means, which ktor actually does.
One of the greatest advantages Since the GET routing for retrieving all Person resources
was already shown, let’s have a look at how the endpoint
@PAUL_IRISH @SWIZEC
Paul Irish Swizec PERFORMANCE DZONE.COM/PERFORMANCE
Scalability and optimization are constant concerns for the Developer and
Operations manager. The Performance Zone focuses on all things performance,
@SARASOUEIDAN @RACHELANDREW covering everything from database optimization to garbage collection to
Sara Soueidan Rachel Andrew tweaks to keep your code as efficient as possible.
REACT.JS ESSENTIALS BY HEMANTH H.M. THE PRINCIPLES OF OBJECT-ORIENTED JAVASCRIPT BY NICOLAS C. ZAKAS
Gives you the essentials of React.js, from the architecture to the virtual Learn what makes JavaScript functions unique, how to define your own con-
DOM, from building components to styling them. structors, inheritance patterns for types and objects, and more.
QUICK VIEW
Development
03 Developers need to: 1) be
empathetic; 2) know the
fundamentals of common
languages; and, 3) have a desire
to learn and take on more
responsibility.
BY TOM SMITH
RESEARCH ANALYST, DZONE
To gather insights on the state of web application stable vendors with a proven track record, using up-to-date
development today, we spoke with 12 executives who approaches that actually work everywhere they need to.
are familiar with the current state of the industry. Understand what the customer is doing and what device they are
Here’s who we spoke to: using so you are able to provide a great UX that empowers users
and customers and leads to business growth. Provide a common
MATT CHOTIN SR. DIR. OF DEVELOPER INITIATIVES, APPDYNAMICS UX across all platforms, operating systems, and form factors.
MICHAEL BECKLEY CTO, APPIAN
DevOps platform upgrades, patches, security, and scaling
GIL SERVER CEO, APPLITOOLS should be built-in so you can focus on collaborating with your
business to deliver high-quality apps. Automation will help you
MIKE KAIL CTO, CYBRIC
scale and produce better, more secure apps quickly.
KEVIN BRIDGES CTO, DRUD
ANDERS WALLGREN CTO, ELECTRIC CLOUD 02 The most significant changes to the development of web
applications have been the rising popularity of JavaScript
JIM MCKEETH DEVELOPER ADVOCATE, EMBARCADERO
and microservices. JavaScript’s explosion and the number of
LUCAS VOGEL FOUNDER, ENDPOINT SYSTEMS frameworks that are evolving are breathtaking. While they are
great at providing a common experience across all screens, it
CHARLES KENDRICK CTO, ISOMORPHIC SOFTWARE
can be challenging to keep up with them.
MARK BROCATO ENGINEERING DIRECTOR, SENCHA
Companies are either implementing microservices or exploring
COLE FURFARO-STRODE LEAD SOFTWARE ENGINEER, SPARKPOST
ways to use them. We see this in push notifications and the need
PETE CHESTNA DIR. OF DEVELOPER ENGAGEMENT, VERACODE for services to provide features and functionalities end users
have come to expect. Web application developers need to think
more about collaborating with business operations to ensure
KEY FINDINGS
alignment of data, process, and business rules with new CX.
01 The keys to developing web applications are choosing the
right technology and ensuring you deliver a good user interface
03 Three industries were specifically mentioned for web
(UI), user experience (UX), and customer experience (CX).
development use cases: healthcare, defense, and technology,
The number one key is technology choice. Customers go but there were plenty of technical use cases with automation,
to development shops with a half-built app because they and these were the only industry examples mentioned multiple
picked the wrong technology for the job. Avoid the outdated, times. This shows the breadth and depth of possibilities with
overblown frameworks from the largest vendors and find the web apps.
Web applications allow the analysis of chemical assays and in the growth of the app. We’ll have the ability to coordinate
animal tests, as well as the analysis of contracts with partners all of the different variables that can affect web applications to
and other functions. Another pharmaceutical is using web ensure they are fully synchronized before they are presented to
apps to improve patient adherence to and compliance with the end user.
prescribed medicine. Web apps can also be used to accelerate
clinical trials.
06 Different aspects of security tend to be the biggest
Web applications can be used to track and itemize costs concerns around web applications. The explosion of JavaScript
involved in government bids through a network of suppliers is opening companies up to potential security vulnerabilities.
and contractors so a company can provide the necessary We need to identify bad actors more quickly and get them off
transparency for bids that can be in the billions of dollars. the system. We also need to be aware of the growth in insider
threats and the opportunity for human mistakes.
Chip manufacturers can use web applications to collaboratively
analyze performance and defects in batches of chips to refine We need to test application frontends and backends in chal-
their manufacturing process, which results in higher quality lenging environments. Some apps and sites are still not
chips at lower cost and less waste. running SSL by default. Open source is no more or less secure
than first-party code; however, it does not age well. If a vulnera-
Other technical applications include management of bility is announced it needs to be fixed in a timely manner. The
structured data, providing DevSecOps, ensuring cross-platform OWASP Top 10 are also still an ongoing concern, and, unfortu-
compatibility, and providing tools that help make developers of nately, developers are not held accountable for secure code.
web apps more productive by reducing two weeks of work to a
half-day. Additionally, we continue to see too much reliance on
technology and not enough on business outcomes. Inherent in
this is that we need to keep the business, and its data, secure.
04 The most common hurdles affecting the development
of web applications are: 1) culture; 2) legacy systems; and, 3)
complexity on multiple fronts. There’s a mismatch between 07 Three skills mentioned most frequently that developers
developers, DevOps, and SecOps. Testing is still being done need to build effective web apps are: 1) empathy; 2) knowledge
manually, and environment management is a constant of the fundamentals of common languages; and, 3) a desire to
struggle. It creates inefficiencies that lead to higher costs, lower learn and take on more responsibility.
job satisfaction, and degraded quality applications. Speed to
market is bogged down by how hard it is to release software. Empathize with your users and those you are working with.
Ask yourself what the end user is trying to accomplish with
The modernization of legacy systems is challenging. Companies your app. Walk through the steps your users are taking to
need to help their employees with modern development and understand their pain points and their workflow. Have a good
technology. Legacy systems teams don’t want to consider grasp on the hot new technologies, but empathy for the user so
security, passwords, or international standards because of their
you can create the best UX.
inability to see the possibilities of expanded adoption of their
app. They are taking a narrow view, and their app will not scale. Know the fundamentals of the most popular languages,
Bad choices early on and a lack of flexibility can lead to an whether you’re building with JavaScript, HTML, or CSS. Know
expensive and time-consuming re-work of the application. the right CSS frameworks, JavaScript frameworks, and layout
requirements so you can build a good UI/UX to manage the
It is also a challenge to provide a consistent UX and beautiful
middleware layer.
UIs, across multiple modalities. All of the changes are around
tooling. Some developers don’t even know what version of
You need to have a desire to continuously improve yourself,
JavaScript they are transpiling to. How many versions of clients
your apps, and the development process. Begin by using the
or your API are you going to support? Apps are no longer self-
principles of Continuous Delivery and DevOps. Measure what
contained. You don’t know which browser your user is using, you
matters, collaborate with your team, automate your pipeline, and
cannot control when browsers are updated, operating systems
improve. A full-spectrum, well-rounded engineer is responsible
and devices are always changing and this affects the UX. You
for quality, unit tests, security, and containerization.
need to be able to see what the end user is experiencing.
Solutions Directory
This directory contains platforms, frameworks, and libraries to build and maintain web applications.
It provides free trial data and product category information gathered from vendor websites and project
pages. Solutions are selected for inclusion based on several impartial criteria, including solution maturity,
Crafter Software Crafter CMS CMS, Development Platform Available by request craftersoftware.com/products/overview
Django Software
Django Python Web Framework Open Source djangoproject.com
Foundation
Hewlett Packard
HPE Helion PaaS Available by request hpe.com/us/en/solutions/cloud.html
Enterprise
Varies by hosting
Jelastic Jelastic PaaS jelastic.com
provider
Meteor Development
Meteor JavaScript Framework Open Source meteor.com
Group
docs.microsoft.com/en-us/aspnet/ajax/cdn/
Microsoft Microsoft Ajax CDN JavaScript CDN Open Source
overview
perfectomobile.com/solutions/perfecto-test-
Perfecto Mobile CQ Lab Automated web and mobile testing Available by request
automation
Qlik Qlik Playground Web App Testing Environment Open Source playground.qlik.com/
Rainforest Rainforest Automated Mobile and Web Testing Available by request rainforestqa.com
Rogue Wve Software Zend Framework PHP Web Framework Open Source framework.zend.com
SAP SAP HANA Cloud Platform PaaS Free tier available hcp.sap.com
swisscom.ch/en/business/enterprise/offer/
Swisscom Swisscom Application Cloud PaaS Available by request cloud-data-center-services/paas/application-
cloud.html
The jQuery Foundation jQuery CDN JavaScript CDN Open Source code.jquery.com
webcomponents.org Web Components Web Platform API Hosting Service Open Source webcomponents.org
G
ANGULAR MICROSERVICES ARCHITECTURE
A platform for building HTML and An architecture for an application that is
JavaScript web applications, led by Google built with several modular pieces, which are
and based on TypeScript. It is a rewrite of deployed separately and communicate with
L
the AngularJS JavaScript framework. each other, rather than deploying one single
piece of software.
COROUTINE
Coroutines simplify asynchronous MVC (MODEL-VIEW CONTROLLER)
programming by putting the complications A way of relating the UI to underlying data
O
into libraries. The logic of the program can models that lets developers reuse object
be expressed sequentially in a coroutine, code and reduce the time spent developing
and the underlying library will figure out the applications with UIs.
asynchrony.
S
NODE
DEPENDENCY INJECTION The most basic element that is used to build
A process that occurs in object-oriented data structure.
programming in which a resource that a
piece of code requires is supplied.
S
NODE.JS
An I/O framework that develops
DOM (DOCUMENT OBJECT MODEL)
applications that are highly dependent
Allows for the creation and modification
on JavaScript on both the client-side and
of HTML and XML documents as program
serverside. It is event-based, nonblocking,
A
objects to help control who can modify the
and asynchronous.
document.
REACT
INJECTION ATTACK
A library in JavaScript that is used to build
R
A scenario where attackers relay malicious
user interfaces.
code through an application to another
system for malicious manipulation of the
SINGLE-PAGE APPLICATION
application. These attacks can target an
A web application that responds to user
operating system via system calls, external
Y
actions and changes over time by rewriting
programs via shell commands, or databases
the app, rather than loading new web pages.
via query language (SQL) injection.
TYPESCRIPT
JAVASCRIPT
A superset of JavaScript developed by
An interpreted script language from Netscape
Microsoft that adds static typing.
that is used in website development for
both client-side and server-side scripting. It
USER INTERFACE (UI)
is easier and faster to code than compiled
A term to describe the ways in which the
languages, but takes longer to run.
end user directly interacts with a device or
JSON application.
KOTLIN VUE.JS
A language that runs on the JVM, developed A JavaScript framework built for
by JetBrains, provided under the Apache designing user interfaces and single-page
2.0 License, offering both object-oriented applications, designed to be adopted
and functional features. incrementally.