SlideShare una empresa de Scribd logo
1 de 34
Descargar para leer sin conexión
OSGi on Scala
BindForge & ScalaModules: Scala DSLs to ease OSGi development
    Roman Roelofsen (ProSyst), Heiko Seeberger (WeigleWilczek)
Why?

• OSGi is a great module system
• Scala is a great language
  •   Compiles to Java bytecode

  •   Object-functional programming style

  •   Why wait for Java 7 (or 8)? Use Scala now!

• Let’s combine them to ease OSGi development
What?



• BindForge - Module Framework
• ScalaModules - DSL for OSGi development in Scala
BindForge
• Module Framework
  •   Dependency Injection, OSGi service abstraction, etc.

  •   Useful for Java and Scala development

  •   Configuration is written in Scala

• Based on
  •   Scala

  •   Guice

  •   Peaberry
Example Scenario

CustomerRepository        CustomerService


CustomerRep.Impl        CustomerServiceImpl

              Customer Bundle




                                                    LogService

                                              OSGi Log Service Bundle
Example Scenario
// repository
interface CustomerRepository
class CustomerRepositoryImpl implements CustomerRepository

// service
interface CustomerService
class CustomerServiceImpl implements CustomerService {

    public void setCustomerRepository(CustomerRepository cr) {
        ...
    }

    public void setLogService(LogService ls) {
        ...
    }

}
Bundle Configuration

• MANIFEST.MF
   BindForge-Config: com.acme.app.MyConfig




• /OSGI-INF/bindforge/config.scala
   package com.acme.app

   class MyConfig extends org.bindforge.Config {
       ...
   }
Binding Interfaces to
          Implementations

CustomerRepository        CustomerService


CustomerRep.Impl        CustomerServiceImpl

              Customer Bundle
Binding Interfaces to
      Implementations

package com.acme.app

class MyConfig extends org.bindforge.Config {

    bind [CustomerRepository, impl.CustomerRepositoryImpl]

    bind [CustomerService, impl.CustomerServiceImpl]

}
Inject Bindings

CustomerRepository        CustomerService


CustomerRep.Impl        CustomerServiceImpl

              Customer Bundle
Inject Bindings
            (by type)


bind [CustomerRepository, impl.CustomerRepositoryImpl]

bind [CustomerService, impl.CustomerServiceImpl] spec {
    property(“customerRepository”)
}
Inject Bindings
              (by name)


“customerRepository” :: bind [impl.CustomerRepositoryImpl]

bind [CustomerService, impl.CustomerServiceImpl] spec {
    property(“customerRepository”) = ref(“customerRepository”)
}
Export Customer Service

CustomerRepository        CustomerService


CustomerRep.Impl        CustomerServiceImpl

              Customer Bundle
Export Customer Service


  bind [CustomerRepository, impl.CustomerRepositoryImpl]

  bind [CustomerService, impl.CustomerServiceImpl] spec {
      exportService
      property(“customerRepository”)
  }
Export Customer Service
   (with Properties)

 bind [CustomerRepository, impl.CustomerRepositoryImpl]

 bind [CustomerService, impl.CustomerServiceImpl] spec {
     exportService(“vendor” -> “acme”, “security” -> “none”)
     property(“customerRepository”)
 }
Import LogService

CustomerRepository        CustomerService


CustomerRep.Impl        CustomerServiceImpl

              Customer Bundle




                                                    LogService

                                              OSGi Log Service Bundle
Import LogService

bind [LogService] importService

bind [CustomerRepository, impl.CustomerRepositoryImpl]

bind [CustomerService, impl.CustomerServiceImpl] spec {
    exportService
    property(“customerRepository”)
    property(“logService”)
}
Full Configuration
package com.acme.app

class MyConfig extends org.bindforge.Config {

    bind [LogService] importService

    bind [CustomerRepository, impl.CustomerRepositoryImpl]

    bind [CustomerService, impl.CustomerServiceImpl] spec {
        exportService
        property(“customerRepository”)
        property(“logService”)
    }

}
What?



• BindForge - Module Framework
• ScalaModules - DSL for OSGi development in Scala
ScalaModules


• For Scala developers (and Java geeks)
• General OSGi concepts, e.g. service handling
• Compendium services, e.g. Configuration Admin
Register a Service

Greeting hello = new Greeting() {
                                                            afe
                                                          es
    public String welcome() {

                                                     yp
        return quot;Hello!quot;;
                                                  tt
    }
                                               no
    public String goodbye() {
        return quot;See you!quot;;
    }
};
context.registerService(Greeting.class.getName(), hello, null);
Register a Service


context registerAs classOf[Greeting] theService new Greeting {
  override def welcome = quot;Hello!quot;
  override def goodbye = quot;See you!quot;;
}
Register a Service
             with Properties
Greeting welcome = new Greeting() {
                                                                     se
                                                                   o
    public String welcome() {
                                                                 rb
                                                              ve
        return quot;Welcome!quot;;
    }
    public String goodbye() {
        return quot;Good bye!quot;;
    }
};
Dictionary<String, Object> properties = new Hashtable<String, Object>();
properties.put(quot;namequot;, quot;welcomequot;);
context.registerService(Greeting.class.getName(), welcome, properties);
Register a Service
   with Properties


context registerAs classOf[Greeting] withProperties
  Map(quot;namequot; -> quot;welcomequot;) theService new Greeting {
    override def welcome = quot;Welcome!quot;
    override def goodbye = quot;Goodbye!quot;
  }
Consume a single Service
ServiceReference reference =
    context.getServiceReference(Greeting.class.getName());
if (reference != null) {
    try {
        Object service = context.getService(reference);
        Greeting greeting = (Greeting) service;
         if (greeting != null) {
             System.out.println(greeting.welcome());
        } else {
             noGreetingService();
        }
    } finally {
        context.ungetService(reference);
                                                      inv
    }
                                                         olv
} else {
                                                            ed
    noGreetingService();
}
Consume a single Service


    context getOne classOf[Greeting] andApply {
      _.welcome
    } match {
      case None          => noGreetingService()
      case Some(welcome) => println(welcome)
    }
Consume many Services
    with their Properties
try {
    ServiceReference[] refs = context.getServiceReferences(
            Greeting.class.getName(), null);
    if (refs != null) {
        for (ServiceReference ref : refs) {
            Object service = context.getService(ref);
            Greeting greeting = (Greeting) service;
             if (greeting != null) {
                 Object name = (ref.getProperty(quot;namequot;) != null)
                         ? ref.getProperty(quot;namequot;)
                         : quot;UNKNOWNquot;;
                 String message = name + quot; says: quot; + greeting.welcome();
                 System.out.println(message);
            }
        }
                                                       ver
    } else {
                                                           y   inv
        noGreetingService();
                                                                  olv
    }
                                                                     ed
} catch (InvalidSyntaxException e) { // Do something meaningful ...
}
Consume many Services
 with their Properties
 context getMany classOf[Greeting] andApply {
   (greeting, properties) => {
     val name = properties.get(quot;namequot;) match {
       case None    => quot;UNKNOWNquot;
       case Some(s) => s
     }
     name + quot; sais: quot; + greeting.welcome
   }
 } match {
   case None           => noGreetingService()
   case Some(welcomes) => welcomes.foreach { println }
 }
Consume Services
           using a Filter
try {
    ServiceReference[] refs = context.getServiceReferences(
            Greeting.class.getName(), quot;(name=*)quot;);
    if (refs != null) {
        for (ServiceReference ref : refs) {
            Object service = context.getService(ref);
            Greeting greeting = (Greeting) service;
             if (greeting != null) {
                 System.out.println(greeting.welcome());
                                           ver
            }
                                               y
        }
                                                   inv
    } else {
                                                      olv
                                                         ed
        noGreetingService();
                                                              aga
    }
                                                                 in
} catch (InvalidSyntaxException e) { // Do something meaningful ...
}
Consume Services
           using a Filter

context getMany classOf[Greeting] withFilter quot;(name=*)quot; andApply {
  _.welcome
} match {
  case None           => noGreetingService()
  case Some(welcomes) => welcomes.foreach { println }
}
Track Services
ServiceTracker tracker = new ServiceTracker(context, Greeting.class.getName(), null) {

   @Override
   public Object addingService(ServiceReference reference) {
       Object service = super.addingService(reference);
       Greeting greeting = (Greeting)service;
       System.out.println(quot;Adding Greeting: quot; + greeting.welcome());
       return service;
   }

   @Override
   public void removedService(ServiceReference reference, Object service) {
       Greeting greeting = (Greeting)service;
       System.out.println(quot;Removed Greeting: quot; + greeting.welcome());
                                                                         and
       super.removedService(reference, service);
                                                                               aga
   }
                                                                                     in
};
tracker.open();
Track Services


greetingTrack = context track classOf[Greeting] on {
  case Adding(greeting, _)   => println(quot;Adding Greeting: quot; + greeting.welcome)
  case Modified(greeting, _) =>
  case Removed(greeting, _) => println(quot;Removed Greeting: quot; + greeting.goodbye)
}
Service Dependencies


context registerAs classOf[Command] dependOn classOf[Greeting] theService {
  greeting => new Command {
    ...
  }
}
And now?

• Forge ahead at www.bindforge.org
• And get fluent at www.scalamodules.org

• Please give feedback:
  •   What do you like?

  •   What do you not like?

  •   What feature would you like to see implemented?

Más contenido relacionado

La actualidad más candente

Using Go to build a REST API: yes, it’s a good match! - Vincent BEHAR & Mina ...
Using Go to build a REST API: yes, it’s a good match! - Vincent BEHAR & Mina ...Using Go to build a REST API: yes, it’s a good match! - Vincent BEHAR & Mina ...
Using Go to build a REST API: yes, it’s a good match! - Vincent BEHAR & Mina ...Dailymotion
 
Property Wrappers or how Swift decided to become Java
Property Wrappers or how Swift decided to become JavaProperty Wrappers or how Swift decided to become Java
Property Wrappers or how Swift decided to become JavaVincent Pradeilles
 
React table tutorial project setup, use table, and usefilter
React table tutorial project setup, use table, and usefilterReact table tutorial project setup, use table, and usefilter
React table tutorial project setup, use table, and usefilterKaty Slemon
 
How to implement g rpc services in nodejs
How to implement g rpc services in nodejsHow to implement g rpc services in nodejs
How to implement g rpc services in nodejsKaty Slemon
 
Java9 Beyond Modularity - Java 9 más allá de la modularidad
Java9 Beyond Modularity - Java 9 más allá de la modularidadJava9 Beyond Modularity - Java 9 más allá de la modularidad
Java9 Beyond Modularity - Java 9 más allá de la modularidadDavid Gómez García
 
Leveraging Completable Futures to handle your query results Asynchrhonously
Leveraging Completable Futures to handle your query results AsynchrhonouslyLeveraging Completable Futures to handle your query results Asynchrhonously
Leveraging Completable Futures to handle your query results AsynchrhonouslyDavid Gómez García
 
No more promises lets RxJS 2 Edit
No more promises lets RxJS 2 EditNo more promises lets RxJS 2 Edit
No more promises lets RxJS 2 EditIlia Idakiev
 
Build Lightweight Web Module
Build Lightweight Web ModuleBuild Lightweight Web Module
Build Lightweight Web ModuleMorgan Cheng
 
"Kotlin и rx в android" Дмитрий Воронин (Avito)
"Kotlin и rx в android" Дмитрий Воронин  (Avito)"Kotlin и rx в android" Дмитрий Воронин  (Avito)
"Kotlin и rx в android" Дмитрий Воронин (Avito)AvitoTech
 
Scripting GeoServer with GeoScript
Scripting GeoServer with GeoScriptScripting GeoServer with GeoScript
Scripting GeoServer with GeoScriptJustin Deoliveira
 
Project Gålbma – Actors vs Types
Project Gålbma – Actors vs TypesProject Gålbma – Actors vs Types
Project Gålbma – Actors vs TypesRoland Kuhn
 

La actualidad más candente (20)

Using Go to build a REST API: yes, it’s a good match! - Vincent BEHAR & Mina ...
Using Go to build a REST API: yes, it’s a good match! - Vincent BEHAR & Mina ...Using Go to build a REST API: yes, it’s a good match! - Vincent BEHAR & Mina ...
Using Go to build a REST API: yes, it’s a good match! - Vincent BEHAR & Mina ...
 
Tdd.eng.ver
Tdd.eng.verTdd.eng.ver
Tdd.eng.ver
 
P1
P1P1
P1
 
Pointers
PointersPointers
Pointers
 
Property Wrappers or how Swift decided to become Java
Property Wrappers or how Swift decided to become JavaProperty Wrappers or how Swift decided to become Java
Property Wrappers or how Swift decided to become Java
 
React table tutorial project setup, use table, and usefilter
React table tutorial project setup, use table, and usefilterReact table tutorial project setup, use table, and usefilter
React table tutorial project setup, use table, and usefilter
 
How to implement g rpc services in nodejs
How to implement g rpc services in nodejsHow to implement g rpc services in nodejs
How to implement g rpc services in nodejs
 
Java9 Beyond Modularity - Java 9 más allá de la modularidad
Java9 Beyond Modularity - Java 9 más allá de la modularidadJava9 Beyond Modularity - Java 9 más allá de la modularidad
Java9 Beyond Modularity - Java 9 más allá de la modularidad
 
AngularJS
AngularJSAngularJS
AngularJS
 
Leveraging Completable Futures to handle your query results Asynchrhonously
Leveraging Completable Futures to handle your query results AsynchrhonouslyLeveraging Completable Futures to handle your query results Asynchrhonously
Leveraging Completable Futures to handle your query results Asynchrhonously
 
No more promises lets RxJS 2 Edit
No more promises lets RxJS 2 EditNo more promises lets RxJS 2 Edit
No more promises lets RxJS 2 Edit
 
Build Lightweight Web Module
Build Lightweight Web ModuleBuild Lightweight Web Module
Build Lightweight Web Module
 
Dart
DartDart
Dart
 
Scala 2013 review
Scala 2013 reviewScala 2013 review
Scala 2013 review
 
"Kotlin и rx в android" Дмитрий Воронин (Avito)
"Kotlin и rx в android" Дмитрий Воронин  (Avito)"Kotlin и rx в android" Дмитрий Воронин  (Avito)
"Kotlin и rx в android" Дмитрий Воронин (Avito)
 
Grails custom tag lib
Grails custom tag libGrails custom tag lib
Grails custom tag lib
 
Scalaz
ScalazScalaz
Scalaz
 
Scala in Places API
Scala in Places APIScala in Places API
Scala in Places API
 
Scripting GeoServer with GeoScript
Scripting GeoServer with GeoScriptScripting GeoServer with GeoScript
Scripting GeoServer with GeoScript
 
Project Gålbma – Actors vs Types
Project Gålbma – Actors vs TypesProject Gålbma – Actors vs Types
Project Gålbma – Actors vs Types
 

Destacado

JAX 2015 - Continuous Integration mit Java & Javascript
JAX 2015 - Continuous Integration mit Java & JavascriptJAX 2015 - Continuous Integration mit Java & Javascript
JAX 2015 - Continuous Integration mit Java & Javascriptdzuvic
 
OSGi DevCon Europe 09 - OSGi on Scala
OSGi DevCon Europe 09 - OSGi on ScalaOSGi DevCon Europe 09 - OSGi on Scala
OSGi DevCon Europe 09 - OSGi on ScalaHeiko Seeberger
 
JM 04/09 - OSGi in kleinen Dosen 5
JM 04/09 - OSGi in kleinen Dosen 5JM 04/09 - OSGi in kleinen Dosen 5
JM 04/09 - OSGi in kleinen Dosen 5Heiko Seeberger
 
Scaladays 2011 - The Ease of Scalaz
Scaladays 2011 - The Ease of ScalazScaladays 2011 - The Ease of Scalaz
Scaladays 2011 - The Ease of ScalazHeiko Seeberger
 
Grunt, Gulp & fabs: Build Systems and Development-Workflow for Modern Web-App...
Grunt, Gulp & fabs: Build Systems and Development-Workflow for Modern Web-App...Grunt, Gulp & fabs: Build Systems and Development-Workflow for Modern Web-App...
Grunt, Gulp & fabs: Build Systems and Development-Workflow for Modern Web-App...Philipp Burgmer
 

Destacado (9)

JAX 2015 - Continuous Integration mit Java & Javascript
JAX 2015 - Continuous Integration mit Java & JavascriptJAX 2015 - Continuous Integration mit Java & Javascript
JAX 2015 - Continuous Integration mit Java & Javascript
 
JM 08/09 - ScalaModules
JM 08/09 - ScalaModulesJM 08/09 - ScalaModules
JM 08/09 - ScalaModules
 
OSGi DevCon Europe 09 - OSGi on Scala
OSGi DevCon Europe 09 - OSGi on ScalaOSGi DevCon Europe 09 - OSGi on Scala
OSGi DevCon Europe 09 - OSGi on Scala
 
JavaSPEKTRUM - Scala 2
JavaSPEKTRUM - Scala 2JavaSPEKTRUM - Scala 2
JavaSPEKTRUM - Scala 2
 
JavaSPEKTRUM - Scala 3
JavaSPEKTRUM - Scala 3JavaSPEKTRUM - Scala 3
JavaSPEKTRUM - Scala 3
 
JM 04/09 - OSGi in kleinen Dosen 5
JM 04/09 - OSGi in kleinen Dosen 5JM 04/09 - OSGi in kleinen Dosen 5
JM 04/09 - OSGi in kleinen Dosen 5
 
Scaladays 2011 - The Ease of Scalaz
Scaladays 2011 - The Ease of ScalazScaladays 2011 - The Ease of Scalaz
Scaladays 2011 - The Ease of Scalaz
 
Java Magazin - Lift
Java Magazin - LiftJava Magazin - Lift
Java Magazin - Lift
 
Grunt, Gulp & fabs: Build Systems and Development-Workflow for Modern Web-App...
Grunt, Gulp & fabs: Build Systems and Development-Workflow for Modern Web-App...Grunt, Gulp & fabs: Build Systems and Development-Workflow for Modern Web-App...
Grunt, Gulp & fabs: Build Systems and Development-Workflow for Modern Web-App...
 

Similar a OSGi DevCon 09 - OSGi on Scala

Angular for Java Enterprise Developers: Oracle Code One 2018
Angular for Java Enterprise Developers: Oracle Code One 2018Angular for Java Enterprise Developers: Oracle Code One 2018
Angular for Java Enterprise Developers: Oracle Code One 2018Loiane Groner
 
How and why i roll my own node.js framework
How and why i roll my own node.js frameworkHow and why i roll my own node.js framework
How and why i roll my own node.js frameworkBen Lin
 
ngMess: AngularJS Dependency Injection
ngMess: AngularJS Dependency InjectionngMess: AngularJS Dependency Injection
ngMess: AngularJS Dependency InjectionDzmitry Ivashutsin
 
Grails transactions
Grails   transactionsGrails   transactions
Grails transactionsHusain Dalal
 
Managing GraphQL servers with AWS Fargate & Prisma Cloud
Managing GraphQL servers  with AWS Fargate & Prisma CloudManaging GraphQL servers  with AWS Fargate & Prisma Cloud
Managing GraphQL servers with AWS Fargate & Prisma CloudNikolas Burk
 
Uncommon Design Patterns
Uncommon Design PatternsUncommon Design Patterns
Uncommon Design PatternsStefano Fago
 
GDG Devfest 2019 - Build go kit microservices at kubernetes with ease
GDG Devfest 2019 - Build go kit microservices at kubernetes with easeGDG Devfest 2019 - Build go kit microservices at kubernetes with ease
GDG Devfest 2019 - Build go kit microservices at kubernetes with easeKAI CHU CHUNG
 
Peaberry - Blending Services And Extensions
Peaberry - Blending Services And ExtensionsPeaberry - Blending Services And Extensions
Peaberry - Blending Services And ExtensionsStuart McCulloch
 
Jasigsakai12 columbia-customizes-cas
Jasigsakai12 columbia-customizes-casJasigsakai12 columbia-customizes-cas
Jasigsakai12 columbia-customizes-casellentuck
 
Connecting to a Webservice.pdf
Connecting to a Webservice.pdfConnecting to a Webservice.pdf
Connecting to a Webservice.pdfShaiAlmog1
 
iOS Reactive Cocoa Pipeline
iOS Reactive Cocoa PipelineiOS Reactive Cocoa Pipeline
iOS Reactive Cocoa PipelineIvan Trifonov
 
Azure Durable Functions (2019-04-27)
Azure Durable Functions (2019-04-27)Azure Durable Functions (2019-04-27)
Azure Durable Functions (2019-04-27)Paco de la Cruz
 
Implement Service Broker with Spring Boot #cf_tokyo
Implement Service Broker with Spring Boot #cf_tokyoImplement Service Broker with Spring Boot #cf_tokyo
Implement Service Broker with Spring Boot #cf_tokyoToshiaki Maki
 

Similar a OSGi DevCon 09 - OSGi on Scala (20)

Scala modules
Scala modulesScala modules
Scala modules
 
Angular for Java Enterprise Developers: Oracle Code One 2018
Angular for Java Enterprise Developers: Oracle Code One 2018Angular for Java Enterprise Developers: Oracle Code One 2018
Angular for Java Enterprise Developers: Oracle Code One 2018
 
W-JAX 09 - ScalaModules
W-JAX 09 - ScalaModulesW-JAX 09 - ScalaModules
W-JAX 09 - ScalaModules
 
How and why i roll my own node.js framework
How and why i roll my own node.js frameworkHow and why i roll my own node.js framework
How and why i roll my own node.js framework
 
ngMess: AngularJS Dependency Injection
ngMess: AngularJS Dependency InjectionngMess: AngularJS Dependency Injection
ngMess: AngularJS Dependency Injection
 
SOLID Principles
SOLID PrinciplesSOLID Principles
SOLID Principles
 
Grails transactions
Grails   transactionsGrails   transactions
Grails transactions
 
Corba
CorbaCorba
Corba
 
Managing GraphQL servers with AWS Fargate & Prisma Cloud
Managing GraphQL servers  with AWS Fargate & Prisma CloudManaging GraphQL servers  with AWS Fargate & Prisma Cloud
Managing GraphQL servers with AWS Fargate & Prisma Cloud
 
Uncommon Design Patterns
Uncommon Design PatternsUncommon Design Patterns
Uncommon Design Patterns
 
GDG Devfest 2019 - Build go kit microservices at kubernetes with ease
GDG Devfest 2019 - Build go kit microservices at kubernetes with easeGDG Devfest 2019 - Build go kit microservices at kubernetes with ease
GDG Devfest 2019 - Build go kit microservices at kubernetes with ease
 
Kitura Todolist tutorial
Kitura Todolist tutorialKitura Todolist tutorial
Kitura Todolist tutorial
 
Peaberry - Blending Services And Extensions
Peaberry - Blending Services And ExtensionsPeaberry - Blending Services And Extensions
Peaberry - Blending Services And Extensions
 
Jasigsakai12 columbia-customizes-cas
Jasigsakai12 columbia-customizes-casJasigsakai12 columbia-customizes-cas
Jasigsakai12 columbia-customizes-cas
 
Connecting to a Webservice.pdf
Connecting to a Webservice.pdfConnecting to a Webservice.pdf
Connecting to a Webservice.pdf
 
iOS Reactive Cocoa Pipeline
iOS Reactive Cocoa PipelineiOS Reactive Cocoa Pipeline
iOS Reactive Cocoa Pipeline
 
Network
NetworkNetwork
Network
 
Azure Durable Functions (2019-04-27)
Azure Durable Functions (2019-04-27)Azure Durable Functions (2019-04-27)
Azure Durable Functions (2019-04-27)
 
Using the Windows 8 Runtime from C++
Using the Windows 8 Runtime from C++Using the Windows 8 Runtime from C++
Using the Windows 8 Runtime from C++
 
Implement Service Broker with Spring Boot #cf_tokyo
Implement Service Broker with Spring Boot #cf_tokyoImplement Service Broker with Spring Boot #cf_tokyo
Implement Service Broker with Spring Boot #cf_tokyo
 

Más de Heiko Seeberger

RheinJUG 2010 - Sprechen Sie Scala?
RheinJUG 2010 - Sprechen Sie Scala?RheinJUG 2010 - Sprechen Sie Scala?
RheinJUG 2010 - Sprechen Sie Scala?Heiko Seeberger
 
Objektforum 2010 - Sprechen Sie Scala?
Objektforum 2010 - Sprechen Sie Scala?Objektforum 2010 - Sprechen Sie Scala?
Objektforum 2010 - Sprechen Sie Scala?Heiko Seeberger
 
JM 08/09 - Beginning Scala Review
JM 08/09 - Beginning Scala ReviewJM 08/09 - Beginning Scala Review
JM 08/09 - Beginning Scala ReviewHeiko Seeberger
 
JAX 09 - OSGi Service Components Models
JAX 09 - OSGi Service Components ModelsJAX 09 - OSGi Service Components Models
JAX 09 - OSGi Service Components ModelsHeiko Seeberger
 
Eclipse Magazin 12 - Design by Contract
Eclipse Magazin 12 - Design by ContractEclipse Magazin 12 - Design by Contract
Eclipse Magazin 12 - Design by ContractHeiko Seeberger
 
Eclipse Magazin 16 - Die Stärke der Drei
Eclipse Magazin 16 - Die Stärke der DreiEclipse Magazin 16 - Die Stärke der Drei
Eclipse Magazin 16 - Die Stärke der DreiHeiko Seeberger
 
Eclipse Magazin15 - Performance Logging
Eclipse Magazin15 - Performance LoggingEclipse Magazin15 - Performance Logging
Eclipse Magazin15 - Performance LoggingHeiko Seeberger
 
Eclipse Magazin 14 - Getting hooked on Equinox
Eclipse Magazin 14 - Getting hooked on EquinoxEclipse Magazin 14 - Getting hooked on Equinox
Eclipse Magazin 14 - Getting hooked on EquinoxHeiko Seeberger
 
Eclipse Magazin 12 - Security does matter
Eclipse Magazin 12 - Security does matterEclipse Magazin 12 - Security does matter
Eclipse Magazin 12 - Security does matterHeiko Seeberger
 
EclipseCon 08 - Agile RCP
EclipseCon 08 - Agile RCPEclipseCon 08 - Agile RCP
EclipseCon 08 - Agile RCPHeiko Seeberger
 
W-JAX 07 - AOP im Einsatz mit OSGi und RCP
W-JAX 07 - AOP im Einsatz mit OSGi und RCPW-JAX 07 - AOP im Einsatz mit OSGi und RCP
W-JAX 07 - AOP im Einsatz mit OSGi und RCPHeiko Seeberger
 
W-JAX 08 - Declarative Services versus Spring Dynamic Modules
W-JAX 08 - Declarative Services versus Spring Dynamic ModulesW-JAX 08 - Declarative Services versus Spring Dynamic Modules
W-JAX 08 - Declarative Services versus Spring Dynamic ModulesHeiko Seeberger
 
JAX 08 - Experiences using Equinox Aspects in a real-world Project
JAX 08 - Experiences using Equinox Aspects in a real-world ProjectJAX 08 - Experiences using Equinox Aspects in a real-world Project
JAX 08 - Experiences using Equinox Aspects in a real-world ProjectHeiko Seeberger
 
Eclipse Summit Europe 08 - Aspect Weaving for OSGi
Eclipse Summit Europe 08 - Aspect Weaving for OSGiEclipse Summit Europe 08 - Aspect Weaving for OSGi
Eclipse Summit Europe 08 - Aspect Weaving for OSGiHeiko Seeberger
 
W-JAX 08 - Aspect Weaving for OSGii
W-JAX 08 - Aspect Weaving for OSGiiW-JAX 08 - Aspect Weaving for OSGii
W-JAX 08 - Aspect Weaving for OSGiiHeiko Seeberger
 

Más de Heiko Seeberger (20)

JavaSPEKTRUM - Scala 1
JavaSPEKTRUM - Scala 1JavaSPEKTRUM - Scala 1
JavaSPEKTRUM - Scala 1
 
RheinJUG 2010 - Sprechen Sie Scala?
RheinJUG 2010 - Sprechen Sie Scala?RheinJUG 2010 - Sprechen Sie Scala?
RheinJUG 2010 - Sprechen Sie Scala?
 
Objektforum 2010 - Sprechen Sie Scala?
Objektforum 2010 - Sprechen Sie Scala?Objektforum 2010 - Sprechen Sie Scala?
Objektforum 2010 - Sprechen Sie Scala?
 
W-JAX 09 - Lift
W-JAX 09 - LiftW-JAX 09 - Lift
W-JAX 09 - Lift
 
JM 08/09 - Beginning Scala Review
JM 08/09 - Beginning Scala ReviewJM 08/09 - Beginning Scala Review
JM 08/09 - Beginning Scala Review
 
JAX 09 - OSGi on Scala
JAX 09 - OSGi on ScalaJAX 09 - OSGi on Scala
JAX 09 - OSGi on Scala
 
JAX 09 - OSGi Service Components Models
JAX 09 - OSGi Service Components ModelsJAX 09 - OSGi Service Components Models
JAX 09 - OSGi Service Components Models
 
JAX 08 - Agile RCP
JAX 08 - Agile RCPJAX 08 - Agile RCP
JAX 08 - Agile RCP
 
Eclipse Magazin 12 - Design by Contract
Eclipse Magazin 12 - Design by ContractEclipse Magazin 12 - Design by Contract
Eclipse Magazin 12 - Design by Contract
 
JUGM 07 - AspectJ
JUGM 07 - AspectJJUGM 07 - AspectJ
JUGM 07 - AspectJ
 
Eclipse Magazin 16 - Die Stärke der Drei
Eclipse Magazin 16 - Die Stärke der DreiEclipse Magazin 16 - Die Stärke der Drei
Eclipse Magazin 16 - Die Stärke der Drei
 
Eclipse Magazin15 - Performance Logging
Eclipse Magazin15 - Performance LoggingEclipse Magazin15 - Performance Logging
Eclipse Magazin15 - Performance Logging
 
Eclipse Magazin 14 - Getting hooked on Equinox
Eclipse Magazin 14 - Getting hooked on EquinoxEclipse Magazin 14 - Getting hooked on Equinox
Eclipse Magazin 14 - Getting hooked on Equinox
 
Eclipse Magazin 12 - Security does matter
Eclipse Magazin 12 - Security does matterEclipse Magazin 12 - Security does matter
Eclipse Magazin 12 - Security does matter
 
EclipseCon 08 - Agile RCP
EclipseCon 08 - Agile RCPEclipseCon 08 - Agile RCP
EclipseCon 08 - Agile RCP
 
W-JAX 07 - AOP im Einsatz mit OSGi und RCP
W-JAX 07 - AOP im Einsatz mit OSGi und RCPW-JAX 07 - AOP im Einsatz mit OSGi und RCP
W-JAX 07 - AOP im Einsatz mit OSGi und RCP
 
W-JAX 08 - Declarative Services versus Spring Dynamic Modules
W-JAX 08 - Declarative Services versus Spring Dynamic ModulesW-JAX 08 - Declarative Services versus Spring Dynamic Modules
W-JAX 08 - Declarative Services versus Spring Dynamic Modules
 
JAX 08 - Experiences using Equinox Aspects in a real-world Project
JAX 08 - Experiences using Equinox Aspects in a real-world ProjectJAX 08 - Experiences using Equinox Aspects in a real-world Project
JAX 08 - Experiences using Equinox Aspects in a real-world Project
 
Eclipse Summit Europe 08 - Aspect Weaving for OSGi
Eclipse Summit Europe 08 - Aspect Weaving for OSGiEclipse Summit Europe 08 - Aspect Weaving for OSGi
Eclipse Summit Europe 08 - Aspect Weaving for OSGi
 
W-JAX 08 - Aspect Weaving for OSGii
W-JAX 08 - Aspect Weaving for OSGiiW-JAX 08 - Aspect Weaving for OSGii
W-JAX 08 - Aspect Weaving for OSGii
 

Último

The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 

Último (20)

The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 

OSGi DevCon 09 - OSGi on Scala

  • 1. OSGi on Scala BindForge & ScalaModules: Scala DSLs to ease OSGi development Roman Roelofsen (ProSyst), Heiko Seeberger (WeigleWilczek)
  • 2. Why? • OSGi is a great module system • Scala is a great language • Compiles to Java bytecode • Object-functional programming style • Why wait for Java 7 (or 8)? Use Scala now! • Let’s combine them to ease OSGi development
  • 3. What? • BindForge - Module Framework • ScalaModules - DSL for OSGi development in Scala
  • 4. BindForge • Module Framework • Dependency Injection, OSGi service abstraction, etc. • Useful for Java and Scala development • Configuration is written in Scala • Based on • Scala • Guice • Peaberry
  • 5. Example Scenario CustomerRepository CustomerService CustomerRep.Impl CustomerServiceImpl Customer Bundle LogService OSGi Log Service Bundle
  • 6. Example Scenario // repository interface CustomerRepository class CustomerRepositoryImpl implements CustomerRepository // service interface CustomerService class CustomerServiceImpl implements CustomerService { public void setCustomerRepository(CustomerRepository cr) { ... } public void setLogService(LogService ls) { ... } }
  • 7. Bundle Configuration • MANIFEST.MF BindForge-Config: com.acme.app.MyConfig • /OSGI-INF/bindforge/config.scala package com.acme.app class MyConfig extends org.bindforge.Config { ... }
  • 8. Binding Interfaces to Implementations CustomerRepository CustomerService CustomerRep.Impl CustomerServiceImpl Customer Bundle
  • 9. Binding Interfaces to Implementations package com.acme.app class MyConfig extends org.bindforge.Config { bind [CustomerRepository, impl.CustomerRepositoryImpl] bind [CustomerService, impl.CustomerServiceImpl] }
  • 10. Inject Bindings CustomerRepository CustomerService CustomerRep.Impl CustomerServiceImpl Customer Bundle
  • 11. Inject Bindings (by type) bind [CustomerRepository, impl.CustomerRepositoryImpl] bind [CustomerService, impl.CustomerServiceImpl] spec { property(“customerRepository”) }
  • 12. Inject Bindings (by name) “customerRepository” :: bind [impl.CustomerRepositoryImpl] bind [CustomerService, impl.CustomerServiceImpl] spec { property(“customerRepository”) = ref(“customerRepository”) }
  • 13. Export Customer Service CustomerRepository CustomerService CustomerRep.Impl CustomerServiceImpl Customer Bundle
  • 14. Export Customer Service bind [CustomerRepository, impl.CustomerRepositoryImpl] bind [CustomerService, impl.CustomerServiceImpl] spec { exportService property(“customerRepository”) }
  • 15. Export Customer Service (with Properties) bind [CustomerRepository, impl.CustomerRepositoryImpl] bind [CustomerService, impl.CustomerServiceImpl] spec { exportService(“vendor” -> “acme”, “security” -> “none”) property(“customerRepository”) }
  • 16. Import LogService CustomerRepository CustomerService CustomerRep.Impl CustomerServiceImpl Customer Bundle LogService OSGi Log Service Bundle
  • 17. Import LogService bind [LogService] importService bind [CustomerRepository, impl.CustomerRepositoryImpl] bind [CustomerService, impl.CustomerServiceImpl] spec { exportService property(“customerRepository”) property(“logService”) }
  • 18. Full Configuration package com.acme.app class MyConfig extends org.bindforge.Config { bind [LogService] importService bind [CustomerRepository, impl.CustomerRepositoryImpl] bind [CustomerService, impl.CustomerServiceImpl] spec { exportService property(“customerRepository”) property(“logService”) } }
  • 19. What? • BindForge - Module Framework • ScalaModules - DSL for OSGi development in Scala
  • 20. ScalaModules • For Scala developers (and Java geeks) • General OSGi concepts, e.g. service handling • Compendium services, e.g. Configuration Admin
  • 21. Register a Service Greeting hello = new Greeting() { afe es public String welcome() { yp return quot;Hello!quot;; tt } no public String goodbye() { return quot;See you!quot;; } }; context.registerService(Greeting.class.getName(), hello, null);
  • 22. Register a Service context registerAs classOf[Greeting] theService new Greeting { override def welcome = quot;Hello!quot; override def goodbye = quot;See you!quot;; }
  • 23. Register a Service with Properties Greeting welcome = new Greeting() { se o public String welcome() { rb ve return quot;Welcome!quot;; } public String goodbye() { return quot;Good bye!quot;; } }; Dictionary<String, Object> properties = new Hashtable<String, Object>(); properties.put(quot;namequot;, quot;welcomequot;); context.registerService(Greeting.class.getName(), welcome, properties);
  • 24. Register a Service with Properties context registerAs classOf[Greeting] withProperties Map(quot;namequot; -> quot;welcomequot;) theService new Greeting { override def welcome = quot;Welcome!quot; override def goodbye = quot;Goodbye!quot; }
  • 25. Consume a single Service ServiceReference reference = context.getServiceReference(Greeting.class.getName()); if (reference != null) { try { Object service = context.getService(reference); Greeting greeting = (Greeting) service; if (greeting != null) { System.out.println(greeting.welcome()); } else { noGreetingService(); } } finally { context.ungetService(reference); inv } olv } else { ed noGreetingService(); }
  • 26. Consume a single Service context getOne classOf[Greeting] andApply { _.welcome } match { case None => noGreetingService() case Some(welcome) => println(welcome) }
  • 27. Consume many Services with their Properties try { ServiceReference[] refs = context.getServiceReferences( Greeting.class.getName(), null); if (refs != null) { for (ServiceReference ref : refs) { Object service = context.getService(ref); Greeting greeting = (Greeting) service; if (greeting != null) { Object name = (ref.getProperty(quot;namequot;) != null) ? ref.getProperty(quot;namequot;) : quot;UNKNOWNquot;; String message = name + quot; says: quot; + greeting.welcome(); System.out.println(message); } } ver } else { y inv noGreetingService(); olv } ed } catch (InvalidSyntaxException e) { // Do something meaningful ... }
  • 28. Consume many Services with their Properties context getMany classOf[Greeting] andApply { (greeting, properties) => { val name = properties.get(quot;namequot;) match { case None => quot;UNKNOWNquot; case Some(s) => s } name + quot; sais: quot; + greeting.welcome } } match { case None => noGreetingService() case Some(welcomes) => welcomes.foreach { println } }
  • 29. Consume Services using a Filter try { ServiceReference[] refs = context.getServiceReferences( Greeting.class.getName(), quot;(name=*)quot;); if (refs != null) { for (ServiceReference ref : refs) { Object service = context.getService(ref); Greeting greeting = (Greeting) service; if (greeting != null) { System.out.println(greeting.welcome()); ver } y } inv } else { olv ed noGreetingService(); aga } in } catch (InvalidSyntaxException e) { // Do something meaningful ... }
  • 30. Consume Services using a Filter context getMany classOf[Greeting] withFilter quot;(name=*)quot; andApply { _.welcome } match { case None => noGreetingService() case Some(welcomes) => welcomes.foreach { println } }
  • 31. Track Services ServiceTracker tracker = new ServiceTracker(context, Greeting.class.getName(), null) { @Override public Object addingService(ServiceReference reference) { Object service = super.addingService(reference); Greeting greeting = (Greeting)service; System.out.println(quot;Adding Greeting: quot; + greeting.welcome()); return service; } @Override public void removedService(ServiceReference reference, Object service) { Greeting greeting = (Greeting)service; System.out.println(quot;Removed Greeting: quot; + greeting.welcome()); and super.removedService(reference, service); aga } in }; tracker.open();
  • 32. Track Services greetingTrack = context track classOf[Greeting] on { case Adding(greeting, _) => println(quot;Adding Greeting: quot; + greeting.welcome) case Modified(greeting, _) => case Removed(greeting, _) => println(quot;Removed Greeting: quot; + greeting.goodbye) }
  • 33. Service Dependencies context registerAs classOf[Command] dependOn classOf[Greeting] theService { greeting => new Command { ... } }
  • 34. And now? • Forge ahead at www.bindforge.org • And get fluent at www.scalamodules.org • Please give feedback: • What do you like? • What do you not like? • What feature would you like to see implemented?