Your SlideShare is downloading. ×
0
Agile Development with OSGi
Matt Stine
About your speaker...
IT Manager / Business Analyst / Software
Architect by Day
Speaker (JavaOne, SpringOne/2GX, Lambda
Lo...
A Tale of Two Cities:
Tracer Bullet Development
OSGi
Where it all began...
...OK, really
this time!
A rose by any other name...
Walking Skeleton (Alistair Cockburn)

http://alistair.cockburn.us/Walking+skeleton
Spanning Ap...
Propose
System
Objects
Tracer
Bullet
Development
Inspired by Ship It! (Richardson/Gwaltney), page 127
Propose System Objects
Identify application layers/modules
e.g. Client, Server, Database
Must be able to stand alone
Keep ...
Propose
System
Objects
Propose
Interfaces
Tracer
Bullet
Development
Inspired by Ship It! (Richardson/Gwaltney), page 127
Propose Interfaces
Define contract between system objects
Collaborative effort
Agree on method names, signatures
Stub out i...
Propose
System
Objects
Propose
Interfaces
Connect
Interfaces
Tracer
Bullet
Development
Inspired by Ship It! (Richardson/Gw...
Connect Interfaces
Implement interobject communication
Many issues will emerge - resolve them!
Now the tracer bullet can b...
Propose
System
Objects
Propose
Interfaces
Connect
Interfaces
Add
Functions
Tracer
Bullet
Development
Inspired by Ship It! ...
Add Functions
Finally time to add real production code!
Developers/teams can work in isolation now
Work from high priority...
Propose
System
Objects
Propose
Interfaces
Connect
Interfaces
Add
Functions
Refactor,
Refine,
Repeat
Tracer
Bullet
Developme...
Refactor, Refine, Repeat
Interfaces will evolve
Add/change at any time, but...
No broken windows!!!
Within module, refactor...
Propose
System
Objects
Propose
Interfaces
Connect
Interfaces
Add
Functions
Refactor,
Refine,
Repeat
Tracer
Bullet
Developme...
TBD Benefits
Teams can work in parallel, independently
Can demonstrate “working” system earlier, providing feedback to you
...
OSGi
The Dynamic Module system for Java
OSGi Architecture
Hardware
Operating System
Java Virtual Machine
Modules
Lifecycle
Service Registry
Services
Security
Appl...
SOA in a JVM!
Service
Bundle
Consumer
Bundle
RegistersService
DiscoversService
Consumes Service
Inspired by Modular Java (...
Modularity...how?
Encapsulation
Service Registry
Versioning







Bundle Versioning
Bar
1.0.2
Zab
2.1.3
Inspired by Modular Java (Craig Walls), page 18
Foo
1.0.0
Zab
1.0.4
Qib
2.0.1
Modularity...how?
Encapsulation
Service Registry
Versioning
Dynamism/Lifecycle
OSGi Implementations
Equinox
PAX Tools for OSGi
PaxConstruct
Script-oriented toolkit for OSGi development
Similar to Rails/Grails development model
Built on Maven 2
PaxRunner
OSGi framework launcher
Facilitates quick start OSGi exploration
Facilitates swapping OSGi platforms (works with...
PaxExam
Testing toolkit for OSGi
Facilitates in-container integration testing of bundles
Flow:
Starts OSGi container of ch...
Why TBD+OSGi?
Connect
Interfaces
Why TBD+OSGi?
Connect
Interfaces
Client
Object
Client Module
Service
Interface
Service
Implementation
Server Module
Case Study
As a customer I can browse for speakers and select
one so that I can reserve him/her.
As a customer I can reserve my chose...
System Objects
Web UI
Business Services
Data Access
Outbound
Messaging
Database Kiosk
Inbound
Messaging
Business Services Interface
List<Speaker> browse();!
!
Speaker get(Long id);!
!
List<Kiosk> findKiosksWhereAvailable(Speak...
Data Access Interface
List<Speaker> findAll();!
!
Speaker get(Long id);!
!
List<Kiosk> findKiosksWhereAvailable(Speaker sp...
Outbound Messaging
Interface
void notifyKioskOfRental(Kiosk kiosk, Rental rental);
Inbound Messaging
Interface
void notifyHqOfRentalPickup(Rental rental);!
!
void notifyHqOfRentalReturn(Rental rental, Kios...
Connect Interfaces
Web UI
Business Services
Data Access
Outbound
Messaging
Database Kiosk
Spring DM/OSGi
OSGi
JDBC
Spring ...
Add Functions
On to the code...
Code available at:
http://github.com/
mstine/fluffbox
Refactor, Refine, Repeat
Maybe change out plain JMS for Spring Integration
solution
Maybe track spatial data on locations t...
Please fill out your evaluations!
Matt Stine
matt.stine@gmail.com
Twitter: mstine
http://www.mattstine.com
Upcoming SlideShare
Loading in...5
×

Agile Development with OSGi

376

Published on

Blast from the past that looks an awful lot like microservices...

Published in: Software, Technology
1 Comment
3 Likes
Statistics
Notes
No Downloads
Views
Total Views
376
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
12
Comments
1
Likes
3
Embeds 0
No embeds

No notes for slide

Transcript of "Agile Development with OSGi"

  1. 1. Agile Development with OSGi Matt Stine
  2. 2. About your speaker... IT Manager / Business Analyst / Software Architect by Day Speaker (JavaOne, SpringOne/2GX, Lambda Lounge, NFJS, RWX, PAX) Author (GroovyMag, NFJS the Magazine) President of the Memphis/Mid-South Java User Group Agile Zone Leader @ DZone OSGi Enthusiast
  3. 3. A Tale of Two Cities: Tracer Bullet Development OSGi
  4. 4. Where it all began...
  5. 5. ...OK, really this time!
  6. 6. A rose by any other name... Walking Skeleton (Alistair Cockburn)
 http://alistair.cockburn.us/Walking+skeleton Spanning Application/Matrix (Mary & Tom Poppendieck)
 Lean Software Development: An Agile Toolkit Nested Synchronization (Mary & Tom Poppendieck)
 Implementing Lean Software Development Hudson River Company Start (Johanna Rothman)
 Manage It! Thread (Matt Simons)
 “Big and Agile?” Cutter IT Journal 15(1): January 2002. Spike (Luke Hohmann)
 Beyond Software Architecture: Creating and Sustaining Winning Solutions
  7. 7. Propose System Objects Tracer Bullet Development Inspired by Ship It! (Richardson/Gwaltney), page 127
  8. 8. Propose System Objects Identify application layers/modules e.g. Client, Server, Database Must be able to stand alone Keep as coarse grained as possible Must be able to justify isolated developer/team
  9. 9. Propose System Objects Propose Interfaces Tracer Bullet Development Inspired by Ship It! (Richardson/Gwaltney), page 127
  10. 10. Propose Interfaces Define contract between system objects Collaborative effort Agree on method names, signatures Stub out implementations (canned data) Define how layers will talk (e.g. direct API calls, RMI, SOAP, OSGi, JMS) System architecture “emerges”
  11. 11. Propose System Objects Propose Interfaces Connect Interfaces Tracer Bullet Development Inspired by Ship It! (Richardson/Gwaltney), page 127
  12. 12. Connect Interfaces Implement interobject communication Many issues will emerge - resolve them! Now the tracer bullet can be fired!
  13. 13. Propose System Objects Propose Interfaces Connect Interfaces Add Functions Tracer Bullet Development Inspired by Ship It! (Richardson/Gwaltney), page 127
  14. 14. Add Functions Finally time to add real production code! Developers/teams can work in isolation now Work from high priority/high risk to low priority/low risk Start to address performance problems
  15. 15. Propose System Objects Propose Interfaces Connect Interfaces Add Functions Refactor, Refine, Repeat Tracer Bullet Development Inspired by Ship It! (Richardson/Gwaltney), page 127
  16. 16. Refactor, Refine, Repeat Interfaces will evolve Add/change at any time, but... No broken windows!!! Within module, refactor mercilessly! Between modules, must communicate!
  17. 17. Propose System Objects Propose Interfaces Connect Interfaces Add Functions Refactor, Refine, Repeat Tracer Bullet Development Inspired by Ship It! (Richardson/Gwaltney), page 127
  18. 18. TBD Benefits Teams can work in parallel, independently Can demonstrate “working” system earlier, providing feedback to you sooner New features can be demonstrated immediately Loosely coupled, highly cohesive modules Encapsulation of module details Enables automated integration testing Enables interteam communication Enables staff reallocation
  19. 19. OSGi The Dynamic Module system for Java
  20. 20. OSGi Architecture Hardware Operating System Java Virtual Machine Modules Lifecycle Service Registry Services Security Application/Bundles OSGiPlatformJavaPlatform Inspired by Modular Java (Craig Walls), page 16
  21. 21. SOA in a JVM! Service Bundle Consumer Bundle RegistersService DiscoversService Consumes Service Inspired by Modular Java (Craig Walls), page 17 OSGi Service Registry
  22. 22. Modularity...how? Encapsulation Service Registry Versioning
 
 
 

  23. 23. Bundle Versioning Bar 1.0.2 Zab 2.1.3 Inspired by Modular Java (Craig Walls), page 18 Foo 1.0.0 Zab 1.0.4 Qib 2.0.1
  24. 24. Modularity...how? Encapsulation Service Registry Versioning Dynamism/Lifecycle
  25. 25. OSGi Implementations Equinox
  26. 26. PAX Tools for OSGi
  27. 27. PaxConstruct Script-oriented toolkit for OSGi development Similar to Rails/Grails development model Built on Maven 2
  28. 28. PaxRunner OSGi framework launcher Facilitates quick start OSGi exploration Facilitates swapping OSGi platforms (works with all major open source implementations) Facilitates provisioning OSGi bundles from multiple sources Magic behind “pax-provision” and PaxExam
  29. 29. PaxExam Testing toolkit for OSGi Facilitates in-container integration testing of bundles Flow: Starts OSGi container of choice Provisions and starts selected bundles Injects OSGi BundleContext to your JUnit test Executes a test method Rinse and repeat until done!
  30. 30. Why TBD+OSGi? Connect Interfaces
  31. 31. Why TBD+OSGi? Connect Interfaces Client Object Client Module Service Interface Service Implementation Server Module
  32. 32. Case Study
  33. 33. As a customer I can browse for speakers and select one so that I can reserve him/her. As a customer I can reserve my chosen speakers at any Fluffbox location at which he/she is available so that I can pick him/her up. As a kiosk, I can notify the reservation system when speakers are picked up/returned so that customers will have an up-to-date view of what speakers are available. Online Reservation System for Speaker Rental Kiosks
  34. 34. System Objects Web UI Business Services Data Access Outbound Messaging Database Kiosk Inbound Messaging
  35. 35. Business Services Interface List<Speaker> browse();! ! Speaker get(Long id);! ! List<Kiosk> findKiosksWhereAvailable(Speaker speaker);! ! Kiosk get(Long id);! ! Rental reserve(Speaker speaker, Kiosk kiosk, Customer customer);! ! void pickup(Rental rental);! ! void returnRental(Rental rental, Kiosk kiosk);!
  36. 36. Data Access Interface List<Speaker> findAll();! ! Speaker get(Long id);! ! List<Kiosk> findKiosksWhereAvailable(Speaker speaker);! ! Kiosk get(Long id);! ! Rental create(Rental rental);! ! void pickup(Rental rental);! ! void returnRental(Rental rental);!
  37. 37. Outbound Messaging Interface void notifyKioskOfRental(Kiosk kiosk, Rental rental);
  38. 38. Inbound Messaging Interface void notifyHqOfRentalPickup(Rental rental);! ! void notifyHqOfRentalReturn(Rental rental, Kiosk kiosk);
  39. 39. Connect Interfaces Web UI Business Services Data Access Outbound Messaging Database Kiosk Spring DM/OSGi OSGi JDBC Spring DM/OSGi JMS JMS Spring DM/OSGi Inbound Messaging
  40. 40. Add Functions On to the code... Code available at: http://github.com/ mstine/fluffbox
  41. 41. Refactor, Refine, Repeat Maybe change out plain JMS for Spring Integration solution Maybe track spatial data on locations to enable mapping Still need to add a payment system - another system object? Our TBD system puts us in great position to address any of these and more!
  42. 42. Please fill out your evaluations! Matt Stine matt.stine@gmail.com Twitter: mstine http://www.mattstine.com
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×