Git Product home page Git Product logo

Comments (1)

pixelhandler avatar pixelhandler commented on June 7, 2024 1

@dhdemerson this library adheres strictly to http://jsonapi.org/format/ but is also an example of an add-on that just matches a server contract and includes that format as first class in it's object structure and nomenclature. The Resource prototype (or model class) is built on the same structure of the payload from the api server. So it is a client representation of that format. As far as the query params are used this library doesn't need to enforce what params are sent to a find method of the resources service object (GET request).

It would be possible to fork and refit this library to the Katharsis dialect. My thoughts are that having data library for an ember app that makes the API contract first class in it's code and service methods and [de]serialization makes using that API contact simpler to grok in the client app. That was one of my motivations in making this library specific to the JSON API spec/format.

The way I would approach adapting (forking) this library to another API format/contract would be start with the resource prototype and reorganize it to match the API format, then scrub though the helper methods/utils for the resource to be sure any setup is adjusted based on the revised structure of the Resource prototype. Then likewise with the Adapter and Serializer prototypes adjust to the nomenclature of the API format/contract and finally the Store service is simply a facade to the adapter, so retrofit that to the revised adapter method naming. The result should be a new library that makes the Katharsis dialect first class in it's structure and nomenclature.

One thing that Ember Data does great at is providing an abstraction so that various adapter/service formats can be utilized. However this library doesn't take that approach, it simply does not abstract the format it becomes the format.

“You must be shapeless, formless, like water. When you pour water in a cup, it becomes the cup. When you pour water in a bottle, it becomes the bottle. When you pour water in a teapot, it becomes the teapot. Water can drip and it can crash. Become like water my friend.” - Bruce Lee

When you fetch data in an app with ember-jsonapi-resources the data becomes the format, when you create data in an app with this library it becomes the format.

from ember-jsonapi-resources.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.