Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Here's how I use the two together.</p> <p>Think of it like this...</p> <p>Object-Oriented Programming introduced new layers of encapsulation. At the object level (with private members). OSGi just enables JAR-level encapsulation. Without OSGi, as soon as its compiled, it all melts into one pot. OSGi enforces the interface at the JAR level. And because of that, you have cleaner modularity and better code (for the same reasons any type of encapsulation is good).</p> <p>I only use OSGi to do the JAR-level encapsulation. Any features that overlap such as scaling up certain modules based on usage, I do in Akka, because the API is higher-level and so easier to do and maintain.</p> <p>But, many things about them don't overlap, so you should be able to see what goes where pretty easily with that rule of thumb in mind.</p> <p>OSGi is to me just very useful for enforcing a good design, because it has rules for how I can consume a service... enforcing an interface at the JAR-level.</p> <p>I'd say your last paragraph explains it well. Just modularize it like you would for any large-scale software. But now they are OSGi bundles instead.</p> <p>If you have follow-up questions, please do comment. I can edit to say more. I've been using the two together for a while now.</p> <p>Edit: Response to comments</p> <p>Reading your question, it seems you may know some things I don't. Which I can't be sure of, so let me know if this post misses its mark. I'm an Akka guy who later did some OSGi, if you did that the other way around, you may be aware of options that I am not.</p> <p>sharing the actor system is trivial. OSGi bundles don't cause inversion of control like a framework. You just call it like any other library code.</p> <p>Wherever you are creating the actor uses system.actorOf calling the class of an actor in another bundle, and that's it. Your question seems to imply you know more about other OSGi options or perhaps are thinking that OSGi will do inversion of control and so each bundle would be stuck with its own actor system.</p> <p>If it's still unclear, I'd recommend a quick prototype. Just pass the first end-to-end test that uses the design and then refactor adding in OSGi.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload