Een belangrijke voorwaarde om goede en leesbare Java code te schrijven is om gebruik te maken van een goede API. Een goede API helpt ontwikkelaars om sneller hoogwaardige code te schrijven. Het ontwerp van een API is daarom belangrijk, zeker als er grotere systemen worden gerealiseerd in teamverband. Moderne ontwikkeltools als Eclipse, IntelliJ IDEA en FindBugs helpen met het schrijven van goede API, en het detecteren van slecht gebruik. Deze sessie gaat in op de laatste ontwikkelingen en mogelijkheden, inclusief nieuwe taalmogelijkheden in Java 8. Er wordt hierbij gebruik gemaakt van praktische situaties en concrete codevoorbeelden, gebaseerd op echte ervaringen in grote codebases. Met praktische tips en toegankelijke tools kan al een grote stap gemaakt worden om in de praktijk beter met API ontwerp om te gaan!
by Peter Dalton, Principal Consultant AWS and Taz Sayed, Sr Technical Account Manager AWS
AWS Data & Analytics Week is an opportunity to learn about Amazon’s family of managed analytics services. These services provide easy, scalable, reliable, and cost-effective ways to manage your data in the cloud. We explain the fundamentals and take a technical deep dive into Amazon Redshift data warehouse; Data Lake services including Amazon EMR, Amazon Athena, & Amazon Redshift Spectrum; Log Analytics with Amazon Elasticsearch Service; and data preparation and placement services with AWS Glue and Amazon Kinesis. You'll will learn how to get started, how to support applications, and how to scale.
The Spring Framework has always embraced testing as a first class citizen. Spring-based components should be modular, easy to wire together via dependency injection, and therefore easy to test. In fact, when well designed following a POJO programming model, a component in a Spring application can be unit tested without using Spring at all. And when you take the step toward developing integration tests, Spring's testing support is there to make your job easy.
Join Spring Test component lead Sam Brannen in this talk to learn about the basics for Spring's unit and integration testing support. This talk will provide attendees an overview of the following topics: unit testing without Spring, integration testing with Spring, loading application contexts (with and without context hierarchies), injecting dependencies into tests, transaction management for tests, SQL script execution, testing Spring MVC and REST web applications, and more.
This presentation discusses the follow topics
What is Hadoop?
Need for Hadoop
History of Hadoop
Hadoop Overview
Advantages and Disadvantages of Hadoop
Hadoop Distributed File System
Comparing: RDBMS vs. Hadoop
Advantages and Disadvantages of HDFS
Hadoop frameworks
Modules of Hadoop frameworks
Features of 'Hadoop‘
Hadoop Analytics Tools
Word embedding, Vector space model, language modelling, Neural language model, Word2Vec, GloVe, Fasttext, ELMo, BERT, distilBER, roBERTa, sBERT, Transformer, Attention
Online Tweet Sentiment Analysis with Apache SparkDavide Nardone
Sentiment Analysis (SA) relates to the use of: Natural Language Processing (NLP), analysis and computational linguistics text to extract and identify subjective information in the source material. A fundamental task of SA is to "classify" the polarity of a given document text, phrases or levels of functionality/appearance - whether the opinion expressed in a document or in a sentence is positive, negative or neutral. Usually, this analysis is performed "offline" using Machine Learning (ML) techniques. In this project two online tweet classification methods have been proposed, which exploits the well known framework "Apache Spark" for processing the data and the tool "Apache Zeppelin" for data visualization.
Practices and Tools for Building Better APIsPeter Hendriks
The most important part of well-designed Java code is a nice API. A good API helps developers be more productive and write high-quality code quickly. API design matters for any developer, especially in building larger systems with a team. Modern coding tools such as Eclipse and FindBugs contain advanced tooling to help with designing an API and checking for bad usage. This session demonstrates the latest innovations, including new capabilities in Java 8, by presenting realistic examples based on real experiences in large codebases. They show that just a few Java tricks and simple annotations can make all the difference for building a great API.
by Peter Dalton, Principal Consultant AWS and Taz Sayed, Sr Technical Account Manager AWS
AWS Data & Analytics Week is an opportunity to learn about Amazon’s family of managed analytics services. These services provide easy, scalable, reliable, and cost-effective ways to manage your data in the cloud. We explain the fundamentals and take a technical deep dive into Amazon Redshift data warehouse; Data Lake services including Amazon EMR, Amazon Athena, & Amazon Redshift Spectrum; Log Analytics with Amazon Elasticsearch Service; and data preparation and placement services with AWS Glue and Amazon Kinesis. You'll will learn how to get started, how to support applications, and how to scale.
The Spring Framework has always embraced testing as a first class citizen. Spring-based components should be modular, easy to wire together via dependency injection, and therefore easy to test. In fact, when well designed following a POJO programming model, a component in a Spring application can be unit tested without using Spring at all. And when you take the step toward developing integration tests, Spring's testing support is there to make your job easy.
Join Spring Test component lead Sam Brannen in this talk to learn about the basics for Spring's unit and integration testing support. This talk will provide attendees an overview of the following topics: unit testing without Spring, integration testing with Spring, loading application contexts (with and without context hierarchies), injecting dependencies into tests, transaction management for tests, SQL script execution, testing Spring MVC and REST web applications, and more.
This presentation discusses the follow topics
What is Hadoop?
Need for Hadoop
History of Hadoop
Hadoop Overview
Advantages and Disadvantages of Hadoop
Hadoop Distributed File System
Comparing: RDBMS vs. Hadoop
Advantages and Disadvantages of HDFS
Hadoop frameworks
Modules of Hadoop frameworks
Features of 'Hadoop‘
Hadoop Analytics Tools
Word embedding, Vector space model, language modelling, Neural language model, Word2Vec, GloVe, Fasttext, ELMo, BERT, distilBER, roBERTa, sBERT, Transformer, Attention
Online Tweet Sentiment Analysis with Apache SparkDavide Nardone
Sentiment Analysis (SA) relates to the use of: Natural Language Processing (NLP), analysis and computational linguistics text to extract and identify subjective information in the source material. A fundamental task of SA is to "classify" the polarity of a given document text, phrases or levels of functionality/appearance - whether the opinion expressed in a document or in a sentence is positive, negative or neutral. Usually, this analysis is performed "offline" using Machine Learning (ML) techniques. In this project two online tweet classification methods have been proposed, which exploits the well known framework "Apache Spark" for processing the data and the tool "Apache Zeppelin" for data visualization.
Practices and Tools for Building Better APIsPeter Hendriks
The most important part of well-designed Java code is a nice API. A good API helps developers be more productive and write high-quality code quickly. API design matters for any developer, especially in building larger systems with a team. Modern coding tools such as Eclipse and FindBugs contain advanced tooling to help with designing an API and checking for bad usage. This session demonstrates the latest innovations, including new capabilities in Java 8, by presenting realistic examples based on real experiences in large codebases. They show that just a few Java tricks and simple annotations can make all the difference for building a great API.
Building CI/CD Pipelines for Serverless Applications - SRV302 - re:Invent 2017Amazon Web Services
Building and deploying serverless applications introduces new challenges for developers whose development workflows are optimized for traditional VM-based applications. In this session, we discuss a method for automating the deployment of serverless applications running on AWS Lambda. We first cover how you can model and express serverless applications using the open-source AWS Serverless Application Model (AWS SAM). Then, we discuss how you can use CI/CD tooling from AWS CodePipeline and AWS CodeBuild, and how to bootstrap the entire toolset using AWS CodeStar. We will also cover best practices to embed in your deployment workflow specific to serverless applications.
You will also hear from iRobot about its approach to serverless deployment. iRobot will share how it achieves coordinated deployments of microservices, maintains long-lived and/or separately-managed resources (like databases), and red/black deployments.
Infinum Android Talks #02 - How to write an annotation processor in AndroidInfinum
How to write your own annotation processor in Android Studio. Compile time and runtime annotations will be compared to reflection. To conclude, butterknife library will be presented as an example of using compile time annotation processing.
Hyperion EPM APIs - Added value from HFM, Workspace, FDM, Smartview, and Shar...Charles Beyer
Application Programming Interfaces allow developers to leverage existing program code in an effort to build additional functionality, automate processes or present existing functionality in a different format. APIs exist for many of Hyperion products; however, clear examples of how to use them are not always easy to find nor are applications for the API readily available. Proper application of the APIs for HFM, Workspace, FDM, Smartview and Shared Services can simplify the daily routines of end users and administrators.
This session will provide a high level overview of how each of the APIs work. Additionally, real-world examples for each API will be provided. Fully working code will be available for download from the ODTUG 12 site which attendees can use in their own environments.
The Schema-first API design approach advocates for writing your API definition first in one of many API Specification languages before writing any code. This talk introduces you to the realm of Schema-First API design and how to get started with the OpenAPI ecosystem.
API First Workflow: How could we have better API Docs through DevOps pipelinePronovix
API Documentation plays an important role in improving the customer’s experience with APIs, which is always a struggle for most of the company. The way to accomplish this is to transition API development culture from “Code First” to “Design First”, here in SAS we call it “API First”. For better API designing and documentation, we have built an API First CI/CD workflow which brings many open-sourced API tools together and involves developers, product managers, documentation writers, and testers to synchronously work together to develop APIs in a “Design First” approach, the industry standard.
In the talk, we will discuss how the API-first Workflow could enable better collaboration between teams which could help in many aspects especially writing the openAPI documentation, keeping it up to date and sync with your code. We will take a deep look at one example, the Linting tool from API First workflow, which helps to make sure the API documentation follows the company standard from the start. With openSource linting tools like Spectral, it’s easy for teams to define their own linting rules which includes company standards. When your API specifications go through the linter in the CI/CD pipeline, the linter will throw errors and warnings as you write your spec. This will help ensure your specification is following proper guidelines and that’s all automatic.
Managing the deployment of code to multiple AWS Lambda functions and updating your API Gateway methods can be manual and time consuming.
In this session, we will show you how to build a deployment pipeline to AWS Lambda using AWS CodePipeline, a continuous delivery service based on Amazon’s internal release automation tooling. We will discuss how to use versioning, which enables you to better manage the different variations of your Lambda functions and API Gateway methods in your development workflow (e.g., development, staging, and production). We will walk through how to automate the entire release process of your application from development, to staging, and finally to production; performing automated integration tests at each stage.
Vinay Kumar [InfluxData] | InfluxDB API Overview | InfluxDays 2022InfluxData
InfluxDB offers a common API across the entire platform. Discover what that means and how you can use the API to build solutions that deliver real value for developers.
There are many benefits and some detriments to building your own JavaScript framework. With so many frameworks available do you need to build one at all? What kind of API should you provide? And how do you ensure quality as your codebase grows? This talk covers answers to these questions and more in order to provide a solid starting point for you to create a successful JS framework.
Survival Strategies for API Documentation: Presentation to Southwestern Ontar...Tom Johnson
This is a presentation I gave to the Southwestern Ontario STC chapter on API documentation on Feb 2, 2015. For more details, see my blog at http://idratherbewriting.com. You can listen to the recorded presentation here: http://youtu.be/I8rGe2w1sAo.
APIsecure - April 6 & 7, 2022
APIsecure is the world’s first conference dedicated to API threat management; bringing together breakers, defenders, and solutions in API security.
Securing APIs with Open Standards
Tips for makingandbreaking APIs that scale from theSynack Red Team
Ryan Rutan, Sr. Director of Community at Synack Red Team
Vitthal Shinde, Security Engineer at FICO & Synack Red Team
Amazon API Gateway and AWS Lambda provide a new way of building applications by removing servers from the picture. But what does the removal of servers mean to tasks like deployment, monitoring, and debugging? How should you set up blue-green deployments or set alarms? Come learn all this and more, including how to use AWS services and tools like AWS CodePipeline, AWS CloudFormation, and Amazon CloudWatch to manage your serverless applications at high quality.
Similar to Practices and tools for building better API (JFall 2013) (20)
The Art of the Pitch: WordPress Relationships and SalesLaura Byrne
Clients don’t know what they don’t know. What web solutions are right for them? How does WordPress come into the picture? How do you make sure you understand scope and timeline? What do you do if sometime changes?
All these questions and more will be explored as we talk about matching clients’ needs with what your agency offers without pulling teeth or pulling your hair out. Practical tips, and strategies for successful relationship building that leads to closing the deal.
Essentials of Automations: Optimizing FME Workflows with ParametersSafe Software
Are you looking to streamline your workflows and boost your projects’ efficiency? Do you find yourself searching for ways to add flexibility and control over your FME workflows? If so, you’re in the right place.
Join us for an insightful dive into the world of FME parameters, a critical element in optimizing workflow efficiency. This webinar marks the beginning of our three-part “Essentials of Automation” series. This first webinar is designed to equip you with the knowledge and skills to utilize parameters effectively: enhancing the flexibility, maintainability, and user control of your FME projects.
Here’s what you’ll gain:
- Essentials of FME Parameters: Understand the pivotal role of parameters, including Reader/Writer, Transformer, User, and FME Flow categories. Discover how they are the key to unlocking automation and optimization within your workflows.
- Practical Applications in FME Form: Delve into key user parameter types including choice, connections, and file URLs. Allow users to control how a workflow runs, making your workflows more reusable. Learn to import values and deliver the best user experience for your workflows while enhancing accuracy.
- Optimization Strategies in FME Flow: Explore the creation and strategic deployment of parameters in FME Flow, including the use of deployment and geometry parameters, to maximize workflow efficiency.
- Pro Tips for Success: Gain insights on parameterizing connections and leveraging new features like Conditional Visibility for clarity and simplicity.
We’ll wrap up with a glimpse into future webinars, followed by a Q&A session to address your specific questions surrounding this topic.
Don’t miss this opportunity to elevate your FME expertise and drive your projects to new heights of efficiency.
UiPath Test Automation using UiPath Test Suite series, part 4DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 4. In this session, we will cover Test Manager overview along with SAP heatmap.
The UiPath Test Manager overview with SAP heatmap webinar offers a concise yet comprehensive exploration of the role of a Test Manager within SAP environments, coupled with the utilization of heatmaps for effective testing strategies.
Participants will gain insights into the responsibilities, challenges, and best practices associated with test management in SAP projects. Additionally, the webinar delves into the significance of heatmaps as a visual aid for identifying testing priorities, areas of risk, and resource allocation within SAP landscapes. Through this session, attendees can expect to enhance their understanding of test management principles while learning practical approaches to optimize testing processes in SAP environments using heatmap visualization techniques
What will you get from this session?
1. Insights into SAP testing best practices
2. Heatmap utilization for testing
3. Optimization of testing processes
4. Demo
Topics covered:
Execution from the test manager
Orchestrator execution result
Defect reporting
SAP heatmap example with demo
Speaker:
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Tobias Schneck
As AI technology is pushing into IT I was wondering myself, as an “infrastructure container kubernetes guy”, how get this fancy AI technology get managed from an infrastructure operational view? Is it possible to apply our lovely cloud native principals as well? What benefit’s both technologies could bring to each other?
Let me take this questions and provide you a short journey through existing deployment models and use cases for AI software. On practical examples, we discuss what cloud/on-premise strategy we may need for applying it to our own infrastructure to get it to work from an enterprise perspective. I want to give an overview about infrastructure requirements and technologies, what could be beneficial or limiting your AI use cases in an enterprise environment. An interactive Demo will give you some insides, what approaches I got already working for real.
JMeter webinar - integration with InfluxDB and GrafanaRTTS
Watch this recorded webinar about real-time monitoring of application performance. See how to integrate Apache JMeter, the open-source leader in performance testing, with InfluxDB, the open-source time-series database, and Grafana, the open-source analytics and visualization application.
In this webinar, we will review the benefits of leveraging InfluxDB and Grafana when executing load tests and demonstrate how these tools are used to visualize performance metrics.
Length: 30 minutes
Session Overview
-------------------------------------------
During this webinar, we will cover the following topics while demonstrating the integrations of JMeter, InfluxDB and Grafana:
- What out-of-the-box solutions are available for real-time monitoring JMeter tests?
- What are the benefits of integrating InfluxDB and Grafana into the load testing stack?
- Which features are provided by Grafana?
- Demonstration of InfluxDB and Grafana using a practice web application
To view the webinar recording, go to:
https://www.rttsweb.com/jmeter-integration-webinar
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...James Anderson
Effective Application Security in Software Delivery lifecycle using Deployment Firewall and DBOM
The modern software delivery process (or the CI/CD process) includes many tools, distributed teams, open-source code, and cloud platforms. Constant focus on speed to release software to market, along with the traditional slow and manual security checks has caused gaps in continuous security as an important piece in the software supply chain. Today organizations feel more susceptible to external and internal cyber threats due to the vast attack surface in their applications supply chain and the lack of end-to-end governance and risk management.
The software team must secure its software delivery process to avoid vulnerability and security breaches. This needs to be achieved with existing tool chains and without extensive rework of the delivery processes. This talk will present strategies and techniques for providing visibility into the true risk of the existing vulnerabilities, preventing the introduction of security issues in the software, resolving vulnerabilities in production environments quickly, and capturing the deployment bill of materials (DBOM).
Speakers:
Bob Boule
Robert Boule is a technology enthusiast with PASSION for technology and making things work along with a knack for helping others understand how things work. He comes with around 20 years of solution engineering experience in application security, software continuous delivery, and SaaS platforms. He is known for his dynamic presentations in CI/CD and application security integrated in software delivery lifecycle.
Gopinath Rebala
Gopinath Rebala is the CTO of OpsMx, where he has overall responsibility for the machine learning and data processing architectures for Secure Software Delivery. Gopi also has a strong connection with our customers, leading design and architecture for strategic implementations. Gopi is a frequent speaker and well-known leader in continuous delivery and integrating security into software delivery.
Connector Corner: Automate dynamic content and events by pushing a buttonDianaGray10
Here is something new! In our next Connector Corner webinar, we will demonstrate how you can use a single workflow to:
Create a campaign using Mailchimp with merge tags/fields
Send an interactive Slack channel message (using buttons)
Have the message received by managers and peers along with a test email for review
But there’s more:
In a second workflow supporting the same use case, you’ll see:
Your campaign sent to target colleagues for approval
If the “Approve” button is clicked, a Jira/Zendesk ticket is created for the marketing design team
But—if the “Reject” button is pushed, colleagues will be alerted via Slack message
Join us to learn more about this new, human-in-the-loop capability, brought to you by Integration Service connectors.
And...
Speakers:
Akshay Agnihotri, Product Manager
Charlie Greenberg, Host
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Jeffrey Haguewood
Sidekick Solutions uses Bonterra Impact Management (fka Social Solutions Apricot) and automation solutions to integrate data for business workflows.
We believe integration and automation are essential to user experience and the promise of efficient work through technology. Automation is the critical ingredient to realizing that full vision. We develop integration products and services for Bonterra Case Management software to support the deployment of automations for a variety of use cases.
This video focuses on the notifications, alerts, and approval requests using Slack for Bonterra Impact Management. The solutions covered in this webinar can also be deployed for Microsoft Teams.
Interested in deploying notification automations for Bonterra Impact Management? Contact us at sales@sidekicksolutionsllc.com to discuss next steps.
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...UiPathCommunity
💥 Speed, accuracy, and scaling – discover the superpowers of GenAI in action with UiPath Document Understanding and Communications Mining™:
See how to accelerate model training and optimize model performance with active learning
Learn about the latest enhancements to out-of-the-box document processing – with little to no training required
Get an exclusive demo of the new family of UiPath LLMs – GenAI models specialized for processing different types of documents and messages
This is a hands-on session specifically designed for automation developers and AI enthusiasts seeking to enhance their knowledge in leveraging the latest intelligent document processing capabilities offered by UiPath.
Speakers:
👨🏫 Andras Palfi, Senior Product Manager, UiPath
👩🏫 Lenka Dulovicova, Product Program Manager, UiPath
Securing your Kubernetes cluster_ a step-by-step guide to success !KatiaHIMEUR1
Today, after several years of existence, an extremely active community and an ultra-dynamic ecosystem, Kubernetes has established itself as the de facto standard in container orchestration. Thanks to a wide range of managed services, it has never been so easy to set up a ready-to-use Kubernetes cluster.
However, this ease of use means that the subject of security in Kubernetes is often left for later, or even neglected. This exposes companies to significant risks.
In this talk, I'll show you step-by-step how to secure your Kubernetes cluster for greater peace of mind and reliability.
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf91mobiles
91mobiles recently conducted a Smart TV Buyer Insights Survey in which we asked over 3,000 respondents about the TV they own, aspects they look at on a new TV, and their TV buying preferences.
UiPath Test Automation using UiPath Test Suite series, part 3DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 3. In this session, we will cover desktop automation along with UI automation.
Topics covered:
UI automation Introduction,
UI automation Sample
Desktop automation flow
Pradeep Chinnala, Senior Consultant Automation Developer @WonderBotz and UiPath MVP
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
UiPath Test Automation using UiPath Test Suite series, part 3
Practices and tools for building better API (JFall 2013)
1. Practices
and
Tools
for
Building
Better
APIs
@PeterHendriks80,
+PeterHendriks
2. Objectives
of
this
talk
• API
from
a
Java
app
developer
perspective
!
•
•
•
•
Why
API
is
important
What
makes
a
better
API
Practical
tips
and
tools
Measuring
your
existing
codebase
3. Some
API
terminology
• API
Consumer:
code
that
uses
API
• API:
the
interface
• API
Implementer:
code
that
implements
API
API
Consumer
API
API
Implementer
Data
Access
Object
JDBC
Database
Driver
4. We
are
using
a
lot
of
API
Bazillion
Open
Source
Web
Framework
API’s
Spring:
27
API’s
Java
EE:
37
API’s
Java
SE:
45
API’s
Enterprise
Service
API’s
Public
Service
API’s
Cloud
API’s
Middleware
API’s
5. We
are
building
more
of
them,
too
• API
is
key
to
a
succesful
module
design
– Essential
for
agile
teams
at
scale
Customer
Front-‐End
Warehouse
Front-‐End
Order
Management
Shared
code
6. Distance
to
API
implementation
is
increasing
• API
quality
increasing
important
when
implementation
becomes
a
black
box
Same
team
Different
team
Open
source
Binary
only
Other
datacenter
7. The
API
we
use
shapes
our
code
• Most
code
we
write
calls
an
API
• Code
that
calls
an
API
is
shaped
to
fit
the
API
• Therefore,
APIs
determine
the
shape
of
application
code
– In
some
ways,
even
more
impactful
than
high
level
design,
test
driven
development
or
code
craftsmanship
8. !
http://docs.oracle.com/javaee/1.4/tutorial/examples/jaxp/xslt/samples/
TransformationApp04.java
!
public
class
TransformationApp04
{
public
static
void
main(String[]
argv)
{
if
(argv.length
!=
1)
{
System.err.println("Usage:
java
TransformationApp
filename");
System.exit(1);
}
!
//
Create
the
sax
"parser".
AddressBookReader02
saxReader
=
new
AddressBookReader02();
var
json_data
=
JSON.stringify(obj);
try
{
File
f
=
new
File(argv[0]);
!
!
//
Use
a
Transformer
for
output
TransformerFactory
tFactory
=
TransformerFactory.newInstance();
Transformer
transformer
=
tFactory.newTransformer();
!
//
Use
the
parser
as
a
SAX
source
for
input
FileReader
fr
=
new
FileReader(f);
BufferedReader
br
=
new
BufferedReader(fr);
InputSource
inputSource
=
new
InputSource(fr);
SAXSource
source
=
new
SAXSource(saxReader,
inputSource);
StreamResult
result
=
new
StreamResult(System.out);
transformer.transform(source,
result);
}
catch
(TransformerConfigurationException
tce)
{
//
Error
generated
by
the
parser
System.out.println("n**
Transformer
Factory
error");
System.out.println("
"
+
tce.getMessage());
!
10. API
Quality:
Value
• Value
=
benefits
-‐
costs
• Benefits
– Features
– Data
– ...
• Costs
–
–
–
–
License/pay
per
use
Performance/footprint
Security
…
11. API
Quality:
Usability
• API
Design
==
Human
Interface
design
– Although
API
is
for
machine/machine
interaction,
APIs
need
to
be
understood
by
programmers
to
write
the
code
– Programmers
are
humans
API
is
not
just
about
capability
and
structural
design,
but
also
about
human
understanding
12. A
simple
model
for
API
Usability
Generic
usability
model
by
Ben
Shneiderman:
Learnability:
How
easy
is
it
to
accomplish
basic
tasks
the
first
time?
Efficiency:
Once
users
learned
the
design,
how
quickly
can
they
perform
tasks?
Memorability:
When
users
return
after
a
while,
how
easily
can
they
re-‐establish
proficiency?
Errors:
How
many
errors
do
users
make,
how
severe
are
these
errors,
and
how
easily
can
they
recover
from
the
errors?
Satisfaction:
How
pleasant
is
it
to
use
the
design?
13. API
Quality:
stability
Able
to
enhance/grow
implementation
without
breaking
existing
consumer
code
Google
AppEngine
release
notes:
Version
1.7.5
-‐
February
13,
2013
The
Conversion
API,
which
was
decommissioned
last
release,
has
been
removed
from
the
SDK.
In
a
future
release,
the
API
will
be
removed
from
the
runtime
and
applications
that
attempt
to
use
it
may
stop
working.
Applications
in
production
that
import
the
library
should
be
fixed
as
soon
as
possible.
Version
1.8.4
-‐
September
9,
2013
The
Conversion
API,
a
decommissioned
feature,
has
been
removed
from
the
SDK.
In
the
next
release,
the
API
will
be
removed
from
the
runtime
and
any
attempt
to
import
the
API
will
raise
an
exception.
Version
1.8.5
-‐
September
25,
2013
The
Conversion
API,
a
decommissioned
feature,
has
been
removed
from
the
runtime.
Applications
in
production
that
import
the
API
should
be
fixed
as
soon
as
possible.
14. API
Quality:
A
hierarchy
of
needs
Stability
only
matters
when
API
is
valuable
and
usable
Stable
Usable
Valuable
16. API
Design:
start
with
examples
• Examples
most
important
in
API
documentation
– Concrete
use
case,
usability
check
• Make
examples
exemplary
– Example
code
will
be
copy-‐pasted
• Create
a
cheat
sheet
– Improves
learnability
– Shows
design
issues
17. API
Design:
multiple
perspectives
Names,
Completeness,
Grouping
UML:
public
class
Document
{
!
!
private
List<Page>
pages
=
new
ArrayList<>();
Impl:
Consumer:
public
Page
addPage()
{
Page
page
=
new
Page();
pages.add(page);
page.setPageNumber(pages.size());
return
page;
}
public
void
report()
{...}
}
Page
page
=
document.addPage();
page.setContents("Once
upon
a
time...");
Can
it
be
built?
Is
it
usable?
18. API
practice:
Keep
it
simple
• Try
to
stick
to
just
methods
and
constructors
– Factories,
Delegates,
etc.
not
always
necessary
!
• “When
in
doubt
leave
it
out”
– Less
classes,
methods
– Less
parameters,
return
values
Josh
Bloch,
Java
API
guru
19. API
practice:
avoid
verbose
constructs
• Constructs
that
create
verbose
consumer
code
– Extending
class/implementing
interface
– Checked
exception
– Required
casting
– Required
generic
type
– Required
if,
for,
while,
try/finally
– Required
synchronization/locking
– Hard
coded
parameter
value
21. Why
Lambdas
are
so
much
better
than
inner
classes
• Inner
classes,
or
extending
existing
classes
often
needed
– Resource
handling
– Looping/visiting
collections
– Event
handling
• Lambdas
provide
a
much
more
usable
construct
– Shorter,
safer,
better
footprint/performance
23. API
practice:
fail
fast,
fail
hard
• Fail
immediately
on
wrong
input
• Limit
the
use
of
null
as
valid
input/output
public
void
save(String
filename)
{
if
(filename
==
null)
{
return;
//
bad
api:
error
is
ignored!
}
...
//
save
happens
here
}
Better
public
void
save(String
filename)
{
Objects.requireNonNull(filename);
//
Throws
NPE
immediately
...
//
save
happens
here
}
24. API
Tool:
checking
for
null
• Tool:
FindBugs,
a
static
code
analyzer
– Reports
errors
at
compile-‐time
• Annotations
for
Software
Defect
Detection
(JSR
305:
Dormant)
– @Nonnull:
may
never
be
null
– @CheckForNull:
should
always
be
checked
before
dereferenced
– @Nullable:
caller
decides
if
null
check
is
needed
• Java
8
will
add
more
annotation
options
for
tools
26. Finding
API
problems
in
your
code
• People
– Team
knowledge
– Policy,
“best
practices”,
conventions
– Elaborate
explanation,
“hard
to
do”
– Defect
lists/exceptions/stack
traces
• Tools
– Finding
most
used
API:
Dependency
Structure
Matrix
(DSM)
27. How
a
Dependency
Structure
Matrix
works
Classes/Packages
Document
Document
2
TextBlock
-‐
Page
Page
TextBlock
-‐
10
#
of
direct
dependencies
from
Document
to
Page
-‐
29. API
design
cheat
sheet
API
matters:
Reuse
3rd
party
Modular
design
Distance
to
impl.
A
Better
API
is:
1. Valuable
2. Usable
3. Stable
API
usability:
• Learnability
• Efficiency
• Memorability
• Error
rate
• Satisfaction
API
Design
Perspectives:
UML:
names,
completeness,
grouping
Implementation:
can
it
be
built
API
usage:
how
usable
is
it
Examples
First
JSR
305/FindBugs:
@Nonnull:
may
never
be
null
@CheckForNull:
always
check
@Nullable:
caller
decides
null
check
DSM:
finding
most
used
API
Document
Document
2
TextBlock
-‐
Page
Page
TextBlock
-‐
10
@PeterHendriks80,
+PeterHendriks
-‐
API
Design
practices:
When
in
doubt
leave
it
out
Limit
API
consumer
code
to
a
minimum
• Extending
class/interface
• Checked
Exception
• Required
casting
• Required
Generic
Type
• Hard
coded
parameter
value
• Required
if,
for,
while,
try
• Required
synchronization/locking
!
Be
predictable
and
obvious
• Methods
calleable
in
any
order
• Constructor
should
only
construct
• Don’t
have
surprising
side
effects
• Limit
null
as
input/output
• Fail
fast,
fail
hard
Eval!