Quite right.

The idea with SPI is roughly; If you don't create Extensions (or advanced
libraries), then you should normally not depend on the core.spi module at
all, to ensure that you are not in too deep.

Yes, the Qi4j -> ZestAPI and Qi4jSPI -> ZestSPI.
One other major issue is that Iterables are being replaced with Java 8
Stream API just about everywhere.


Cheers
Niclas

On Sat, Oct 22, 2016 at 10:28 AM, zhuangmz08 <zhuangm...@qq.com> wrote:

> Thanks all.
> I'm using "org.qi4j.core:org.qi4j.core.api:2.1". Then, I need to replace
> org.apache.zest.api.ZestAPI with org.qi4j.api.Qi4j, replace
> org.apache.zest.spi.ZestSPI with org.qi4j.spi.Qi4jSPI. I've get my
> PropertyDescriptors.
> SPI extends from API. And SPI is designed for building extensions. Thus,
> I'd better use SPI rather than API.
> Is my understanding right?
>
>
>
>
>
>
> ------------------ 原始邮件 ------------------
> 发件人: "Niclas Hedhman";<nic...@hedhman.org>;
> 发送时间: 2016年10月22日(星期六) 上午8:11
> 收件人: "dev"<dev@zest.apache.org>;
>
> 主题: Re: Listing composite properties
>
>
>
> Note that the EntityDescriptor (and its siblings) extends
> StatefulCompositeDescriptor, which allows you to obtain the
> StateDescriptor/
> AssociationStateDescriptor where you can get the PropertyDescriptors and
> AssociationDescriptors, which is what you were asking for. If you have the
> Property, you can get the PropertyDescriptor directly from the ZestAPI,
> without trying to locate it inside the CompositeDescriptors.
>
>
> There are a whole set of good methods in the ZestAPI class for regular
> code. There are additional methods available in ZestSPI, more suitable for
> use when you are creating Extensions and very generic libraries.
>
> HTH
>
> On Sat, Oct 22, 2016 at 1:06 AM, Paul Merlin <p...@nosphere.org> wrote:
>
> > Hi,
> >
> > zhuangmz08 a écrit :
> > > Hi, I'm trying to persist my Value/Entity Composite into database. Can
> I
> > list all the properties (name, type) of the composite? Thanks.
> >
> > Yes! You need to get hold of your Value/Entity descriptors.
> > This can be done through the ZestAPI, e.g.:
> >
> > @Structure ZestAPI api;
> >
> > void someMethod()
> > {
> >     EntityDescriptor descriptor = api.entityDescriptorFor( someEntity );
> > }
> >
> > HTH
> >
> >
>
>
> --
> Niclas Hedhman, Software Developer
> http://zest.apache.org - New Energy for Java
>



-- 
Niclas Hedhman, Software Developer
http://zest.apache.org - New Energy for Java

Reply via email to