by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • 07:36
    dry-bot commented #151
  • 07:35
    timriley opened #151
  • 07:33

    timriley on bootable-paths

    Remove unused method Remove more methods for now Tr… Switch out system_dir for boota… and 2 more (compare)

  • Aug 12 07:59
  • Aug 11 19:59
    esparta commented #132
  • Aug 11 16:30
    philipce closed #132
  • Aug 11 16:30
    philipce commented #132
  • Aug 11 07:47
    esparta commented #132
  • Aug 11 07:29
    esparta commented #132
  • Aug 11 07:28
    esparta commented #132
  • Aug 11 01:30
    philipce labeled #132
  • Aug 11 01:30
    philipce opened #132
  • Aug 10 18:51
    gbrlcustodio starred dry-rb/dry-monads
  • Aug 10 10:49

    solnic on master

    Fix redefinition warnings happe… Merge pull request #150 from es… (compare)

  • Aug 10 10:49
    solnic closed #150
  • Aug 10 07:58
    esparta edited #150
  • Aug 10 07:58
    esparta edited #150
  • Aug 10 07:51
    esparta opened #150
  • Aug 09 16:13
    charly starred dry-rb/dry-initializer
  • Aug 09 03:48
    slashpai starred dry-rb/dry-system
Piotr Solnica
@solnic
@Ch4s3 thanks, yeah I’ll be adding some ‘sum up’ paragraph thanks :)
Piotr Solnica
@solnic
re promoting our libs, not sure, maybe it won’t hurt to do it :) i was thinking about writing a separate post about some of libs and explain “what and why” there, but a quick mention here would be cool I guess
Piotr Solnica
@solnic

http://solnic.eu/2016/05/30/abstractions-and-the-role-of-a-framework.html

^^ a follow-up to my prev post, related to what we’re doing here

Piotr Solnica
@solnic
Tim Riley
@timriley
Yeah, looks like a lot of thought has gone into it.
I’ve been meaning to ask you for some examples of how you’ve actually used pub/sub with your transflow transactions
Piotr Solnica
@solnic
the author told me he extracted this from real projects
monad approach is more straight forward, but there are use cases for pub/sub, but my brain is elsewhere now so hard to come up with a concrete example
Tim Riley
@timriley
No worries. I’ll file an issue at some point so we can share some examples.
Actually, let me do that now.
Christopher Dennl-Ortega Arrieta
@cdennl
rectify looks like trb, am I right?
Alexander Gräfe
@rickenharp
What’s the point behind the auto-registration in dry-component? Since the key is derived from the filenames, I don’t see the big win that Application['logger’] gives you over using Application::Logger. I do get why dry-container is great, but there you can use generic keys, that you can point to different implementations without having to change those classnames all over your codebase.
Piotr Solnica
@solnic
Convention Over Configuration, removes heaps of boilerplate
and it's not enforced, so don't use it if you don't like it :)
Alexander Gräfe
@rickenharp
Well, the problem is, I have introduced the people at my current project to dry-rb, in the hopes they could use it to cleanup their chthonic legacy rails app. Unfortunately, if something has a feature, they use it… And now I feel obligated to make them use all the nice dry-rb things correctly, while not really understanding everything myself… :sweat_smile:
Piotr Solnica
@solnic
happy to clarify, just ask
I used dry-container/auto-inject in a rails app, see my rom-rails-skeleton on github
but I haven't used dry-component in a rails app, no idea if it will Just Work™ in its current form
Alexander Gräfe
@rickenharp
The biggest hurdle at the moment is instantiating something you get out of dry-container with parameters. Something like Container[’validate’](String) or Container[’validate’](Array)
Piotr Solnica
@solnic
what's validate there?
Alexander Gräfe
@rickenharp
It’s a dry-transaction step that should validate its input against the given class. I told them to use explicit StringValidator and ArrayValidator steps, but apparently that is ‘too much typing'
Basically, I am doing damage control at the moment :D
Piotr Solnica
@solnic
what kind of parameters does it need?
Alexander Gräfe
@rickenharp
I don’t quite understand that question, sorry. :(
Piotr Solnica
@solnic
you said you're getting objects from the container with parameters
Alexander Gräfe
@rickenharp
Yes, they used dry-component to define the step objects, and since those are auto-registered, they can’t influence the instantiation of those step objects.
Piotr Solnica
@solnic
if you need custom instantiation logic, register objects yourself
I understand you're dealing with existing legacy objects?
Alexander Gräfe
@rickenharp
Yes, allthough a lot of that legacy was an ad-hoc implementation of dry-transaction functionality.
Piotr Solnica
@solnic
you can also override .new and put custom logic there
in general, we're trying to promote objects that don't need any state except external dependencies and/or configuration
so ie we don't do Validator.new(data).call and instead just v=Validator.new;v.call(data)
Alexander Gräfe
@rickenharp
Yeah, that’s what I have gathered. But try selling that to people who are buried deep in the Rails Way… :sigh:
Piotr Solnica
@solnic
so object graphs that are being created and exposed by the container don't hold data-as-state
well, that's OO way, not just Rails :)
it's hard to get out of this mindset, been there done that ;)
separating data from logic was one of the greatest improvements for me lately
Alexander Gräfe
@rickenharp
It’s not even OO, because the people I deal with don’t like having ‘all those classes’.
Piotr Solnica
@solnic
yeah I hear you, it's a common attitude "more concepts, too complicated", but it's only an impression
Nikita Shilnikov
@flash-gordon
I came to this after reading four books about clojure :)
Piotr Solnica
@solnic
I started doing that in ruby along with ditching mutable objects, so it was a natural consequence
Alexander Gräfe
@rickenharp
I’m avoiding learning more about other programming languages until after this project, it would just make me sad… :D
Piotr Solnica
@solnic
then I started looking into clojure and my thinking about this became less blurred :)
the trouble with data/logic in OO was that people treated data as something messy, so hiding it behind objects that "just send messages" was supposed to safe you from having to deal with that messy data
the problem with objects "just sending messages" is that it's really hard to compose functionality
you end up with complex inheritance hierarchies, object decorators etc
and it's still not really flexible
application-specific data structures are as pleasant to work with as your objects, the trick is to be able to have these data structures in the first place (hint: rom-rb)
if your app is working with raw representation of the data that comes directly from your db, then it's gonna be messy (hint: Active Record)
Tomek Rusiłko
@rusilko
Hey, I’ve looked around a bit in dry-* space and have few questions/observations regarding dry-validations-rails integration thingy (pls don’t mind if some are super obvious):
  1. dry-v library would shine mostly as a replacement for AM validations, since that’s where validation logic is used.
  2. Strong params is just a whitelisting of attributes without rule checking, just require/permit kinda thing, right?
  3. I understand we want to keep them separated, that is validation in models and whitelisting in controllers?
  4. Or maybe we actually want to pull out validation logic from models and do the validation in the service called from controller directly (using dry-v below ofc)? In such a case maybe it could be combined with strong params functionality?
  5. In any case the question is that if a dev uses dry-v for strong params it would seem strange not to use it for model validations as well… which bring us to the questions of where to put the Schemas and should they be duplicated for strong params / validations ?
  6. From more formal standpoint - we want to do it as a separate gem (sorry, no knowledge in this space)
  7. Should we create a separate chatroom here (less noise)?
  8. @solnic - why “dry-*”? where is this name coming from? Just curious :)