Adapter Pattern

Front one OSID service with a different OSID interface, translating between domains.

Overview

An adapter wraps a source OSID manager and exposes it through a target OSID interface. Sessions on the source are translated into sessions on the target, and objects are wrapped or transformed as needed. Adapters let you reuse an existing implementation behind a different OSID contract without rewriting business logic.

A common use is bridging a generic resource service to a domain-specific OSID, or presenting a legacy system through a current OSID specification.

Javadoc Reference

net.okapia.osid.jamocha.adapter.spi

Class Declaration Pattern

public abstract class AbstractOsidObjectAdapter
extends Object
implements OsidObjectManager

Constructor Pattern

AbstractOsidObjectAdapter(SourceOsidObjectManager source)
ParameterTypeDescription
source SourceOsidObjectManager the underlying manager being adapted

Static Factory Method Pattern

static OsidObjectManager adapt(SourceOsidObjectManager source)
ParameterTypeDescription
source SourceOsidObjectManager the manager to adapt

Returns OsidObjectManager — the adapted manager