Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [lyo-dev] Fwd: Dynamic Model

Hi, Gunther.

> I'm currently working on a piece of code that needs to dynamically build
> resources (e.g. requirements) during runtime. That is, during compile
> time I do not have the knowledge of what resources there are and how
> they are typed. Thus I do not have the possibility to create java
> classes with the appropriate annotations (except through runtime
> generation, which I want to avoid).


You should be able to do this with IExtendedResource... If every property is dynamic, you might consider working with the Jena model directly, although OSLC4J does give you the benefit of serializing to the OSLC JSON format.

> Now, is there any possibility to make use of (parts of) the lyo
> libraries without resource classes that are annotated? Is it conceivable
> to extend the library in a few spots to allow working on (dynamic)
> resources, which are not based on annotated pojos (and if so could you
> point them out?), or is this concept of retrieving and using annotations
> spread too widely within the library to actually support that use case?

Can you give some examples of where you had problems? You should be able to use the extended properties for almost anything, including different RDF datatypes and reified statements. As long as your object implementats IExtendedResource (or extends AbstractResource), these values should also be read in on PUT and POST requests. You can see some examples of it in our JUnits like

org.eclipse.lyo.oslc4j.test.test.TestTypesBase

Regards,
Sam


Back to the top