• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Why OSGi (Pros and Cons)? What patterns? JAA book

 
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi everybody, but specially to Kirk!

In your opinion, why should we design following the OSGi specifications? Which are the advantages to use OSGi? What about the disadvantages? What are the patterns you review in the book?


Thank you so much, and good luck with the book!!!
 
author
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The advantages of OSGi is that it gives you runtime support for modularity. This allows you to do things like enforcing module relationships at runtime, deploy different versions of a module alongside each other, hot deploy modules to a running application, and enforce module encapsulation. These are all things that standard Java cannot do. At the end of Chapter 3 (download link for this chapter available below), I provide an example that demonstrates how you cannot enforce module encapsulation using standard Java. Then, I show how you can enforce module encapsulation using OSGi. Personally, it's one of my favorite examples. Other favorites of mine include the reference implementation in Chapter 7, the Manage Relationships sample code (inverting and eliminating relationships), the Acyclic Relationships sample code (escalation, demotion, callback)...Ok...I like several of the examples, including Part 3 where I show how to take a system that's designed using the patterns and port it to OSGi. It was just so easy to do and you realize the benefits immediately.

In general, runtime support for modularity makes it easier to design modular software since the runtime container enforces your design time constructs. To design modular software without a runtime container, you have to employ other tools (i.e., JarAnalyzer in the book) and techniques (i.e., Levelize Build) to enforce modularity. I'd argue that if you don't already have a modular application, you should focus your efforts on modularizing the application first. Then, start using OSGi. Using OSGi if you don't have a modular application won't provide you all the benefits OSGi offers.

Visit the book's website at modularity.kirkk.com where you can review all 18 patterns and download an excerpt of the book. There is also a mobile web application available that you can take with you wherever you go.

--kirk
Twitter: @pragkirk
 
Marco Antonio
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you, Kirk.

Those all things are very interesting and you have awakened my curiosity about OSGi and what it can provide to my job.


Thank you so much!!!
 
Don't touch me. And dont' touch this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic