Hi Oscar,
One can think of the framework as breaking into two:
- the metamodel ... Isis' reflection stuff, cf java.lang.Class
- the runtime ... Isis' object mgmt stuff, leaning heavily on
JDO/DataNucleus, cf java.lang.Object.
The metamodel piece is relatively decoupled from the runtime piece, so it
should be fairly easy to embed it.
In IsisMojoAbstract - the superclass for the maven plugin goals - you'll
see the code:
final AppManifest manifest =
InstanceUtil.createInstance(this.appManifest, AppManifest.class);
final IsisSessionFactoryBuilder isisSessionFactoryBuilder = new
IsisSessionFactoryBuilder(manifest);
IsisSessionFactory isisSessionFactory =
isisSessionFactoryBuilder.buildSessionFactory();
from which you can call:
final SpecificationLoader specificationLoader =
isisSessionFactory.getSpecificationLoader();
final ServicesInjector servicesInjector =
isisSessionFactory.getServicesInjector();
The SpecificationLoader is the internal (private) API to the entire
metamodel.
The ServicesInjector can be used to inject services into any arbitrary
object (annotated with @javax.inject.Inject). One caveat: some services
are implemented by the runtime, which probably won't be available.
These are all basically singletons.
Probably the easiest thing to do is to write a simple servlet or Spring
boot app, then embed the above code somewhere in the bootstrapping, and see
how you get on.
HTH
Dan
On Thu, 19 Jan 2017 at 11:45 Óscar Bou - GOVERTIS <[email protected]>
wrote:
>
> Hi all.
>
> I’m sure the Isis Domain meta-model can add a lot of value to Domains
> developed in another frameworks.
>
> It’s different from reflection in the way it allows you to determine, for
> example:
> - which public methods are effectively domain actions.
> - which Java properties should be considered “Domain” properties.
> - which actions or properties are available depending on the business
> logic.
> - etc.
>
> And all that with the ability to properly test it.
>
> Over that, we’ve built the Wicket viewer, the RESTful Objects viewer, the
> JDO-based persistence, the custom injection mechanism, …
>
> But I’m pretty sure it could be really useful when using other
> platforms/frameworks.
>
> Do you agree?
>
> How should we quantify the tasks and effort?
>
>
> Cheers,
>
> Oscar
>
>
>
>
>
>