faroali
faroali

Reputation: 21

Implementation JsonApi with Spring Boot

I worked with standard Rest API Spring Boot applications 2 years. For my next project I need to use JsonApi.

I made little research and see few libraries:

https://github.com/katharsis-project/katharsis-framework

https://github.com/crnk-project/crnk-framework

https://github.com/yahoo/elide


My question is in standard Rest Api we have:

controllers -> services -> repositories

but in JsonApi we have:

resources (models, dtos) -> repositories

Where we can write custom logic if we don't have services.

In upper libraries here is resources which can only made CRUD operations with DB.

In JsonApi resources imitate controllers which have direct relation with repositories.

Upvotes: 2

Views: 1093

Answers (2)

There is 3 Method to implement custom logic (Elide 6) :

1- Use a Dao and Map your attributes to create an object or list of objects.

2- Work with computed attributes it helps alot specially if you need metrics that shouldn't be persisted in the database .

3- Create your own datastore that implements DataStore also you need a transaction datastore(you can create logic in loadObject method for exemple).

Upvotes: 0

Christian Bongiorno
Christian Bongiorno

Reputation: 5648

Katharsis is a bunk project. Crnk is a fork from it.

Upvotes: 2

Related Questions