building realtime access data apps with speedment (tcf itpc 2017)

24
1 Building Realtime Data Apps with Speedment TCF IT Professional Conference March 17, 2017 Michael P. Redlich @mpredli about.me/mpredli/

Upload: michael-redlich

Post on 21-Mar-2017

12 views

Category:

Software


2 download

TRANSCRIPT

Page 1: Building Realtime Access Data Apps with Speedment (TCF ITPC 2017)

1

Building Realtime Data Apps with Speedment

TCF IT Professional ConferenceMarch 17, 2017

Michael P. Redlich@mpredli

about.me/mpredli/

Page 2: Building Realtime Access Data Apps with Speedment (TCF ITPC 2017)

Who’s Mike?

• BS in CS from

• “Petrochemical Research Organization”

• Java Queue News Editor, InfoQ

• Ai-Logix, Inc. (now AudioCodes)

• Amateur Computer Group of New Jersey

2

Page 3: Building Realtime Access Data Apps with Speedment (TCF ITPC 2017)

Objectives

• What is Speedment?

• Why Speedment?

• Database Support

• Get Started Building an Application

• Live Demo (yea!)

• Speedment Resources

3

Page 4: Building Realtime Access Data Apps with Speedment (TCF ITPC 2017)

What is Speedment (1)?

“Speedment accelerates your development speed and makes database programming so easy and fun. When you use Speedment Open Source for database querying, you do not have to learn a new API or use complex ORMs. Everything is standard Java 8 and works out of the box.”

Speedment Web Site, http://www.speedment.org/

4

Page 5: Building Realtime Access Data Apps with Speedment (TCF ITPC 2017)

What is Speedment (2)?

• First introduced in June 2015

• A portmanteau of “speed” and “development”

• Abstracts the process of:

• database connectivity

• database operations

5

Page 6: Building Realtime Access Data Apps with Speedment (TCF ITPC 2017)

Speedment Integration

6

“Hello, Java Users Group!”

Page 7: Building Realtime Access Data Apps with Speedment (TCF ITPC 2017)

Speedment 3.0.5

• Codename: “Forest”

• Latest features include:

• declarative Java 8 stream API for databases operations

• improved user interface

7

Page 8: Building Realtime Access Data Apps with Speedment (TCF ITPC 2017)

Why Speedment?

• Full Java 8 support

• lamdas and streams

• Easy query with Smart Streams

• no need for coding SQL

• No NULL pointer exceptions

8

Page 9: Building Realtime Access Data Apps with Speedment (TCF ITPC 2017)

Speedment Open Source

• Speedment Open Source Database Support:

• MySQL

• PostgreSQL

• MariaDB

9

Page 10: Building Realtime Access Data Apps with Speedment (TCF ITPC 2017)

Speedment Enterprise

• Speedment Enterprise Database Support includes Open Source plus:

• Oracle

• DB2

• AS400

• SQL Server

10

Page 11: Building Realtime Access Data Apps with Speedment (TCF ITPC 2017)

Let’s Get Started…

11

Page 12: Building Realtime Access Data Apps with Speedment (TCF ITPC 2017)

Example Database

12

“Hello, Java Users Group!”

Page 13: Building Realtime Access Data Apps with Speedment (TCF ITPC 2017)

Getting Started$ mvn archetype:generate

-DgroupId=org.redlich.publications

-DartifactId=publications

-DarchetypeArtifactId=speedment-archtype-mysql

-DarchetypeGroupId=com.speedment.archetypes

-DinteractiveMode=false

-DarchetypeVersion=3.0.5

&& cd publications && mvn speedment:tool

13

generates a new project

project package

project root

invoke the Speedment tool

the latest version of Speedment

specify desired database

Page 14: Building Realtime Access Data Apps with Speedment (TCF ITPC 2017)

Speedment Tool (1)

14

“Hello, Java Users Group!”

specify desired database

subpackage (user defined)

database name

click…

Page 15: Building Realtime Access Data Apps with Speedment (TCF ITPC 2017)

Speedment Tool (2)

15

“Hello, Java Users Group!”

click…

Page 16: Building Realtime Access Data Apps with Speedment (TCF ITPC 2017)

Let’s Build That App…

16

Page 17: Building Realtime Access Data Apps with Speedment (TCF ITPC 2017)

17

/* * initial setup */

protected final PublicationsApplication app; protected final AuthorsManager authorsManager; protected final PublicationsManager publicationsManager;

app = new PublicationsApplicationBuilder(); authorsManager = app.getOrThrow(AuthorsManager.class); publicationsManager = app.getOrThrow(PublicationsManager.class);

main app

manager representing each database table

Page 18: Building Realtime Access Data Apps with Speedment (TCF ITPC 2017)

18

/* * smart streaming */ publicationsManager.stream() .forEach(System.out::println);

publicationsManager.stream() .filter(Publications.TITLE.startsWith(“”);

long count = publicationsManager.stream() .count()

Optional<Authors> redlich = authorsManager .stream() .filter(Authors.LAST_NAME.equal(“Redlich”)) .findAny();

Page 19: Building Realtime Access Data Apps with Speedment (TCF ITPC 2017)

Partial UML Diagram

19

“Hello, Java Users Group!”

Page 20: Building Realtime Access Data Apps with Speedment (TCF ITPC 2017)

Demo Time…

20

Page 21: Building Realtime Access Data Apps with Speedment (TCF ITPC 2017)

21

Speedment Resources

•speedment.org

•javadoc.io/doc/com.speedment/runtime-deploy/3.0.5

•minborgsjavapot.blogspot.com

•https://www.infoq.com/news/2016/12/speedment-releases-version-3 Per-Åke Minborg, CTO at Speedment

Page 22: Building Realtime Access Data Apps with Speedment (TCF ITPC 2017)

Upcoming Events (1)

• March 17-18, 2017

•tcf-nj.org

• April 18-19, 2017

•phillyemergingtech.com

22

Page 23: Building Realtime Access Data Apps with Speedment (TCF ITPC 2017)

Acknowledgements

• Speedment, Inc.

• Per-Åke Minborg, CTO at Speedment

23

Page 24: Building Realtime Access Data Apps with Speedment (TCF ITPC 2017)

24

Thanks!

[email protected]

@mpredli

redlich.net

slideshare.net/mpredli01

github.com/mpredli01