Sinobu

kiss

Extensible

This is a marker interface for Extension Point of your application.

All Extension Points are recognized automatically by Sinobu if you use I#load(Class) or I#load(java.net.URL) methods properly. And an Extension Point will provide some Extensions.

What is Extension Point?

We give a definition of Extension Point like the following.

interface ThisIsExtensionPoint extends Extensible {
}

interface ThisIsNotExtensionPoint implements ThisIsExtensionPoint {
}

class ThisIsAlsoExtensionPoint implements Extensible {
    // This is both Extension Point and Extension.
}

What is Extension?

We give a definition of Extension like the following.

  • It implements any Extension Point or is Extension Point itself.
  • It must be concrete class and has a suitable constructor for Sinobu (see also I#make(Class) method).
class ThisIsExtension implements Extensible {
    // This is both Extension Point and Extension.
}

class ThisIsAlsoExtension extends ThisIsExtension {
    // But not Extension Point.
}

class ThisIsNotExtension extends ThisIsExtension {

    public ThisIsNotExtension(NotInjectable object) {
        // because of invalid constructor
    }
}

What is Extension Key?

You can provide Extension Key for each Extensions by using parameter. The key makes easy finding an Extension you need (see also I#find(Class, Class)).

interface ExtensionPointWithKey<K> extends Extensible {
}

class ExtensionWithKey implements ExtensionPointWithKey<String> {
    // Associate this Extension with String class.
}

class ExtensionWithAnotherKey implements ExtensionPointWithKey<List> {
    // Associate this Extension with List interface.
}