B A C D B A The existential question Why OSGi? Hello World - - PowerPoint PPT Presentation

b a c d b a the existential question why osgi hello world
SMART_READER_LITE
LIVE PREVIEW

B A C D B A The existential question Why OSGi? Hello World - - PowerPoint PPT Presentation

OSGi enRoute An Development Chain for OSGi B A C D B A The existential question Why OSGi? Hello World is not a benchmark Dev Chain Language Small versus Large dynamic Java & languages OSGi cost of change


slide-1
SLIDE 1

OSGi enRoute

An Development Chain for OSGi

αβ

slide-2
SLIDE 2

A B A B C D

slide-3
SLIDE 3
slide-4
SLIDE 4

The existential question

slide-5
SLIDE 5

Why OSGi?

slide-6
SLIDE 6

“Hello World”

slide-7
SLIDE 7

… is not a benchmark

slide-8
SLIDE 8
slide-9
SLIDE 9

Language Dev Chain

slide-10
SLIDE 10
slide-11
SLIDE 11

Small versus Large

cost of change functionality

dynamic languages Java & OSGi

Startup cost of Java (statically typed languages) is higher However, long term cost is much lower

slide-12
SLIDE 12

target.foo(15,”abc”); target.foo(15,”abc”);

Javascript Java

You HOPE target implements foo … You KNOW target implements foo … and expects an integer and a string Your IDE knows exactly who is using this

slide-13
SLIDE 13

OSGi extends type safety to modules that evolve

slide-14
SLIDE 14

What is OSGi enRoute?

cost of change functionality

dynamic languages Java & OSGi

slide-15
SLIDE 15

How?

slide-16
SLIDE 16

OSGi enRoute

  • µService Oriented Programming
  • To reduce system complexity
  • Dependency Management
  • To reduce errors in development & operations
  • Tooling
  • To reduce time to market
  • Documentation & Training
  • To reduce confusion with developers
slide-17
SLIDE 17

Development Process

Components Run Descriptor Distro enRoute Profile

  • ther

API’s Deployable Unit test compile resolve build release define baseline external dependencies QA & Production staging

slide-18
SLIDE 18

bnd, the little engine that built …

slide-19
SLIDE 19

bndlib bndtools (eclipse) maven gradle, ant bnd command line

slide-20
SLIDE 20

bundle bundle

workspace

project cnf project

slide-21
SLIDE 21

profiles

slide-22
SLIDE 22

Profiles

  • A profile is specific catalog of specifications that vendors

can provide in a distribution.

  • An OSGi Profile consists of
  • µServices — Specifications of either OSGi Alliance or

external µservices.

  • Extenders — An extender provides support functionality

to OSGi bundles.

  • Capabilities — A capability describes a feature/function/

resource of the underlying system in abstract format.

slide-23
SLIDE 23

Profiles

  • Each OSGi enRoute Profile is represented by a

clean signed JAR library that can be used to build bundles against.

  • This is a specification only library,
  • It can not introduce unwanted dependencies, or
  • Let developers accidentally use proprietary

features of a vendor

slide-24
SLIDE 24

Planned Profiles

  • java 1.8 — All profiles are based on Java 1.8
  • base — A minimum profile, mostly as common base and for
  • demonstrations. It provides support for the best practices in our

industry.

  • base.debug — Supports developing and debugging
  • web — Web application development optimized for single page

web apps.

  • web.debug — Supports developing and debugging web apps.
  • persistence — Provides support for JPA on OSGi
slide-25
SLIDE 25

Base Profile

  • OSGi Core Framework — R6
  • OSGi Compendium — ConfigurationAdmin, Coordinator, EventAdmin,

LogService, MetaTypeService,UserAdmin

  • Logging — Extensive Java Logging and SLF4J (dynamic!) logging
  • support. Both service based an statics.
  • OSGi enRoute Support
  • Requirements and Capabilities — Completely developed with the

R&C model in mind

  • Specifications in code — Extensive support to use Java classes and

interfaces to also specifies non-Java aspects. E.g. license headers, forms, versioning, etc. Mostly through annotations.

slide-26
SLIDE 26

Base Profile

  • OSGi enRoute services
  • Authenticator and Authority — For extensible security
  • ConfigurationDone — To signal end of initialization at startup
  • DTOs — Extensive support for Data Transfer Objects (JSON, conversion,

diffing, named access)

  • Launched — Provides access to startup parameters
  • LoggerAdmin — Administrative front end to logging. Can handle OSGi,

SLF4J, and Java Logging

  • java.util.Timer — Scheduled tasks
  • java.util.concurrent.Executor — Background tasks
slide-27
SLIDE 27
slide-28
SLIDE 28
slide-29
SLIDE 29
slide-30
SLIDE 30

package com.api

publish bind subscribe dependency

slide-31
SLIDE 31

Components

Component (object)

slide-32
SLIDE 32

Creates a component Can (de)activate, gets configuration data Service dependency

slide-33
SLIDE 33

Bundles

Bundle

component component component component

slide-34
SLIDE 34

Bundles

Bundle

slide-35
SLIDE 35

Private packages Exported packages Calculated imports bnd descriptor

slide-36
SLIDE 36

Continuous build JARs Content, e.g. Component XML

slide-37
SLIDE 37

external dependencies

(or where the heck is maven central????)

slide-38
SLIDE 38

Repository (includes maven central)

slide-39
SLIDE 39

Search repos Opens browser window

slide-40
SLIDE 40
slide-41
SLIDE 41

OSGi Framework

Bundle

Assemble

Bundle Bundle Bundle Bundle Bundle

OSGi Framework

slide-42
SLIDE 42

distros

slide-43
SLIDE 43

Distros

  • A distro provides the runtime environment for one
  • r more profiles
  • The OSGi enRoute project will deliver a reference

distribution for all profiles based on open source and OSGi provided bundles

  • Members and other companies can provide other,

competing, interoperable, distributions (And are actively encouraged to do so).

slide-44
SLIDE 44

how do we prevent vendor lock-in?

slide-45
SLIDE 45

foo =14 base =“bar” id =21 namespace

Capability Model

(foo>=14) Requirement Capability

slide-46
SLIDE 46
  • sgi.wiring.package

Capability Model

(& (osgi.wiring.package=com.acme) (version>=1.2) )

Import Export

  • sgi.wiring.package=com.acme

version=1.2

slide-47
SLIDE 47

Resolve requirements bndrun descriptor Requirements Debug

slide-48
SLIDE 48

Running Resolved bundles

slide-49
SLIDE 49
slide-50
SLIDE 50
slide-51
SLIDE 51

staging

slide-52
SLIDE 52

Staging

OSGi Framework

slide-53
SLIDE 53

Export

slide-54
SLIDE 54

release

slide-55
SLIDE 55

Semantic Versioning

  • major – Breaking change for consumers
  • minor – Breaking change for providers
  • micro – Invisible change
slide-56
SLIDE 56
slide-57
SLIDE 57

baselining

slide-58
SLIDE 58

Released bundles

slide-59
SLIDE 59

NoSuchMethodException

slide-60
SLIDE 60

Incompatible API change version wrong

slide-61
SLIDE 61

command line

slide-62
SLIDE 62
slide-63
SLIDE 63
slide-64
SLIDE 64

continuous integration

slide-65
SLIDE 65
slide-66
SLIDE 66
slide-67
SLIDE 67

summary

slide-68
SLIDE 68

Continuous Integration? IDE? command line? Repository?

Method Class Package Bundle Workspace

return parameters method method class class package package bundle bundle

bnd(tools) gradle, bnd jpm4j (maven central) travis

slide-69
SLIDE 69

// TODO

slide-70
SLIDE 70

TODO

  • bnd(tools) documentation
  • Base Tutorial
  • Additional profiles
  • Additional deployment standards
  • Create a community!
slide-71
SLIDE 71