You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@community.apache.org by Greg Chase <gr...@apache.org> on 2016/06/16 06:12:30 UTC

Support for Apache Geode in Apache Zest

Dear Geode contributors,
I just got some detail about support for Apache Geode by Apache Zest in its
persistence abstraction.  It will be a while before they have a new
release, but this support is available in their github already.

Here is the implementation,
https://github.com/apache/zest-java/blob/develop/extensions/entitystore-geode/src/main/java/org/apache/zest/entitystore/geode/GeodeEntityStoreMixin.java

AND the configuration options that are supported initially can be seen in;
https://github.com/apache/zest-java/blob/develop/extensions/entitystore-geode/src/main/java/org/apache/zest/entitystore/geode/GeodeConfiguration.java


What does this mean? Well, Zest has a persistence abstraction for its
runtime model, and users can swap out any of the other Entity Stores
without code changes beyond the "assembly" (start up).

Entities are declared like this;

public interface Book
{
    @Optional
    Property<ISBN> isbn();

    @Immutable
    Property<String> title();

    @Immutable
    Association<Author> author();

    @UseDefaults
    ManyAssociation<Review> reviews();

    @UseDefaults
    NamedAssociation<Distributor> distributors();
}

We can then do

@UnitOfWorkPropagation(MANDATORY)
public void createNewBook( String title, Author author )
{
    UnitOfWork uow = unitOfWorkFactory.currentUnitOfWork() )
    EntityBuilder<Book> builder = uow.newEntityBuilder(Book.class);
    builder.instance().title().set( title );
    builder.instance().author().set( author );
    builder.newInstance();
}

No implementation class needed for the Book interface. But if we had
additional methods on the Book interface, we can assign one or more
"Mixins", and each mixin can handle one or more of those methods.

Regards,

-Greg

Re: Support for Apache Geode in Apache Zest

Posted by Greg Chase <gr...@gregchase.com>.
Ahh...so that's where this posting went....

Sorry everyone for an email about communities you might not be involved in.

-Greg

On Wed, Jun 15, 2016 at 11:12 PM, Greg Chase <gr...@apache.org> wrote:

> Dear Geode contributors,
> I just got some detail about support for Apache Geode by Apache Zest in
> its persistence abstraction.  It will be a while before they have a new
> release, but this support is available in their github already.
>
> Here is the implementation,
>
> https://github.com/apache/zest-java/blob/develop/extensions/entitystore-geode/src/main/java/org/apache/zest/entitystore/geode/GeodeEntityStoreMixin.java
>
> AND the configuration options that are supported initially can be seen in;
>
> https://github.com/apache/zest-java/blob/develop/extensions/entitystore-geode/src/main/java/org/apache/zest/entitystore/geode/GeodeConfiguration.java
>
>
> What does this mean? Well, Zest has a persistence abstraction for its
> runtime model, and users can swap out any of the other Entity Stores
> without code changes beyond the "assembly" (start up).
>
> Entities are declared like this;
>
> public interface Book
> {
>     @Optional
>     Property<ISBN> isbn();
>
>     @Immutable
>     Property<String> title();
>
>     @Immutable
>     Association<Author> author();
>
>     @UseDefaults
>     ManyAssociation<Review> reviews();
>
>     @UseDefaults
>     NamedAssociation<Distributor> distributors();
> }
>
> We can then do
>
> @UnitOfWorkPropagation(MANDATORY)
> public void createNewBook( String title, Author author )
> {
>     UnitOfWork uow = unitOfWorkFactory.currentUnitOfWork() )
>     EntityBuilder<Book> builder = uow.newEntityBuilder(Book.class);
>     builder.instance().title().set( title );
>     builder.instance().author().set( author );
>     builder.newInstance();
> }
>
> No implementation class needed for the Book interface. But if we had
> additional methods on the Book interface, we can assign one or more
> "Mixins", and each mixin can handle one or more of those methods.
>
> Regards,
>
> -Greg
>
>

Re: Support for Apache Geode in Apache Zest

Posted by Niclas Hedhman <ni...@hedhman.org>.
Wrong list... he he he

On Thu, Jun 16, 2016 at 2:12 PM, Greg Chase <gr...@apache.org> wrote:

> Dear Geode contributors,
> I just got some detail about support for Apache Geode by Apache Zest in its
> persistence abstraction.  It will be a while before they have a new
> release, but this support is available in their github already.
>
> Here is the implementation,
>
> https://github.com/apache/zest-java/blob/develop/extensions/entitystore-geode/src/main/java/org/apache/zest/entitystore/geode/GeodeEntityStoreMixin.java
>
> AND the configuration options that are supported initially can be seen in;
>
> https://github.com/apache/zest-java/blob/develop/extensions/entitystore-geode/src/main/java/org/apache/zest/entitystore/geode/GeodeConfiguration.java
>
>
> What does this mean? Well, Zest has a persistence abstraction for its
> runtime model, and users can swap out any of the other Entity Stores
> without code changes beyond the "assembly" (start up).
>
> Entities are declared like this;
>
> public interface Book
> {
>     @Optional
>     Property<ISBN> isbn();
>
>     @Immutable
>     Property<String> title();
>
>     @Immutable
>     Association<Author> author();
>
>     @UseDefaults
>     ManyAssociation<Review> reviews();
>
>     @UseDefaults
>     NamedAssociation<Distributor> distributors();
> }
>
> We can then do
>
> @UnitOfWorkPropagation(MANDATORY)
> public void createNewBook( String title, Author author )
> {
>     UnitOfWork uow = unitOfWorkFactory.currentUnitOfWork() )
>     EntityBuilder<Book> builder = uow.newEntityBuilder(Book.class);
>     builder.instance().title().set( title );
>     builder.instance().author().set( author );
>     builder.newInstance();
> }
>
> No implementation class needed for the Book interface. But if we had
> additional methods on the Book interface, we can assign one or more
> "Mixins", and each mixin can handle one or more of those methods.
>
> Regards,
>
> -Greg
>



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