Showing posts with label Modularity. Show all posts
Showing posts with label Modularity. Show all posts

Sunday, August 27, 2017

OSGi Architecture

OSGi is a standard that defining Dynamic Component Development for Java.
Its specification that define the API to develop dynamic components in java application development. As per OSGi application composed of several components and components are packaged as bundle.

Java to build complex application is big challenge where OSGi defining way to divide application into several bundles and each bundle composed with several components.
OSGi is providing environment where all these bundles and components can communicate each other such way we can run complex application.

Component:

Component is small unit of application and it called as some feature in the application. Component cam work independently or it can collaborate with other component to full fill the requirement in the application.

Bundle:

Bundle is composed with several components and OSGi we package components as bundles and we will deploy bundles into OSGi container.

Services:

Services are part of component and it will full fill one more tasks. OSGi we can export and import services such as way we can make available services to other components or bundles.

Modules:

Module is basic terminology in OSGi modular development and these modularity concept achieved through bundles. Modules and bundles are same.

 OSGi Layers.

OSGi architecture divided into several layers. I have taken the following picture from enRoute.

Source of image: enroute

Bundles:

Bundles are packaged components developed by OSGi developers. Bundle is packaged as JAR file and we can deploy into OSGi containers.

Services:

Services layer provide mechanism to share services between bundles. It will provide environment to register services and make available to other bundles. We have concept called publish-find-bind. We have different framework to achieve this concept. Declarative Services and Apache Service Component Runtime are the implementation for this concept.

Life Cycle:

Life Cycle is responsible to manage lifecycle of bundles. OSGi bundle have several lifecycle stages install, start, update, stop and uninstall. All these stages handles in this layer.

Module:

Module layer is define the import / export the code of the bundles. Usually we will use export/import headers in the OSGi manifest file that will handle in module layer.

Execution Environment.

Execution Environment layer define the classes and methods are available to the platform.

Security:

Security layer define standards security to the OSGi applications. How your modules available to the other platforms and it will define some permission system.

Java VM

Java VM layer is provide the JAVA run time environment. Its basic layer in the OSGi.

Operating System

It will provide standard Operating System to the OSGi environments.

Deployment

OSGi provide run time container there we can deploy bundles. Bundles are standard package system where we can package all java classes and interfaces. Bundle is JAR file. We have different commands provided by OSGi command line interface to deploy bundles.

Implementation

OSGi specification implemented by several vendors’ popular vendors Equinox and Apache Felix. We can develop OSGi application which target to anyone of these implementations. Both implementations are followed the OSGi standard specification. There may be few features vendor specific but most of the implementation as per OSGi specification.

Reference:


Author

Thursday, November 17, 2016

Open Services Gateway Initiative (OSGi) Terminology

OSGi

Open Services Gateway Initiative is an architecture for modular application development and it’s also knowns as Dynamic Module System for java.

Modularity

Modularity is the way of developing or implementing software as number of unique modules rather than entire software as single unit.

Modules are communicating each other through Application Programming Gateway interface and finally it will form unique system.

OSGi responsibility is to make communication among these modules and manage the lifecycle of modules.

Module

Module is an independent small piece of software and it will fulfill defined business requirements and it can be reuse. Module can work independently or it will associate with other module to prepare complex system. Module consist java files and required configuration files.  

Component

Component is same like module. We can call module and component interchangeably. When compare with scope of component is limited and it’s less than module. A module can be collection of components.

Bundle

A bundle is collection of one or more components. According to the OSGi a bundle is smallest unit of modularization. We can say a bundle is packaged JAR file which consist java classes and required configuration files.

Plugin

Plugin and bundle are similar and in eclipse terminology we call it as plugin.

OSGi Container

OSGi container provides the run time environment to bundles its means it manage the lifecycle of bundles. It will responsible to activate and deactivate bundles and make communication among bundles.

MANIFEST

MANIFEST is configuration file for bundles and OSGi container will read bundle information form this file. It’s same like Deployment descriptor in web applications. It will provides the bundle general information and its dependency with other bundles or components.

OSGi Runtime

OSGi Runtime allows us to register services implementation and consume the existing services.

Service Registry

OSGi Runtime achieved through Service Registry. It maintain the information of services implementation and consume the existing services which are deployed in OSGi container.
OSGi services

OSGi Declarative Service

OSGI Declarative Services is a framework that provide the way to define and consume service by configuring details in the xml file without any dependency in source code to OSGi framework.

Service Component Runtime (SCR)

Service Component Runtime (SCR) is implementation of OSGi Declarative Service from Apache Felix.

OSGi Service Tracker

OSGi Service Tracker responsible to track or finding the services which are registered through service registry in the OSGi runtime.

Bundle Activator

Bundle activator is java class that implements the lifecycle of bundle.

Blueprint

Blueprint is framework form apache which provides the dependency injection nature for OSGi. Its design to deal with dynamic nature of OSGi. It’s similar to Declarative Services.

BnD Tools

BnD provide set of tools to develop OSGi bundles. It’s very easy way to develop OSGi bundles. It will manage bundle dependency and other configurations itself by tool rather developer.

enRoute


The OSGi enRoute project provides a programming model of OSGi applications. The OSGi specifications provide a powerful and solid platform for component oriented programming but by their nature lack ease of use, especially for newcomers to get started.

Author

Recent Posts

Recent Posts Widget

Popular Posts