GithubHelp home page GithubHelp logo

Comments (4)

philsturgeon avatar philsturgeon commented on July 16, 2024 1

Howdy, I found some folks referencing these old isssues and I'd like to update them with more recent opinions. At the time I was dead set on Fractal being a serializer, and thought that serializers should just be serializers.

Deserializers are also incredibly important, and defining contracts multiple times is a pain in the butt. I'd love to see some functionality grow, where one contract can be defined, and both deserialization and serialization can be performed from that contract.

http://trailblazer.to/gems/operation/1.1/representer.html

Trailblazer does this rather well, but the docs can be a little confusing sometimes. There are a lot of gems involved but Roar and Representatable do the most of it I think.

from fractal.

jasonlewis avatar jasonlewis commented on July 16, 2024

I believe that's beyond the scope of Fractal. Will be up to you to retrieve
and parse data sent from a client.
On 14 Jun 2014 03:02, "Troy Pavlek" [email protected] wrote:

Forgive me if I'm missing something, but it's not immediately apparent to
me nor does it seem to be mentioned in the docs:

What about recieving data? If I have an object in the database, and for
simplicity's sake let's us the example that in the database a column is
called "start_date", I transform this to simply be "start" when it's sent
to the client. Now, when I recieve data back, it will obviously just be a
"start" property, which isn't actually in the database.

Do transformers support inverting their own operations?


Reply to this email directly or view it on GitHub
#65.

from fractal.

philsturgeon avatar philsturgeon commented on July 16, 2024

Saving data is much easier, and as Jason said it's not a job for Fractal.

You can solve this with DDD, using entity objects to set up the data, or just building an array of input data, then pass that off to your model. Your repository or model can have a create() and a update() method, both of which structure and validate this data.

from fractal.

GPHemsley avatar GPHemsley commented on July 16, 2024

@philsturgeon That link is now dead, and in any case refers to Ruby code, not PHP code. Do you have any recommendations for getting this behavior in a way that complements a Fractal transformer? Is there any likelihood in it being added here? (I note that this issue and many similar ones remain closed.)

from fractal.

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.