Code Monkey home page Code Monkey logo

Comments (3)

tpendragon avatar tpendragon commented on June 17, 2024

So the "replacement" for Virtus is dry-struct: https://github.com/dry-rb/dry-struct , which is a core dependency of ROM https://github.com/rom-rb/rom . I've never been able to get ROM to work, and I have some level of concern about the scope of ROM being way bigger than the scope of Valkyrie.

Regarding dry-struct - I think we can make it work, but there's one big difference: dry-structs are immutable. They have no setters. The way you handle this is to have an abstraction for doing immutable actions on an existing struct - in ROM this is basically what a "repository" is, from my understanding. I'm not against that, but it makes me wonder if we're losing anything from the OO side of things.

In any case, I'd be totally open to an experiment where we rip out Virtus and make all the tests pass via dry-struct, to see what kind of interface changes we'd need and how complex our controllers would become.

from valkyrie.

tpendragon avatar tpendragon commented on June 17, 2024

The other alternative is just using our own POROs which are powered by http://trailblazer.to/gems/disposable/api.html for enabling dry-types coercion.

from valkyrie.

tpendragon avatar tpendragon commented on June 17, 2024

One way to do this is in #59 .

from valkyrie.

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.