Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Nov 10 21:35
    pregozgin starred dry-rb/dry-monads
  • Nov 10 12:22
    flash-gordon opened #371
  • Nov 10 12:22

    flash-gordon on no-rewrap-for-structs

    Don't build constructors when c… (compare)

  • Nov 08 06:56
  • Nov 08 01:12

    AMHOL on master

    Fix gem metadata URIs (compare)

  • Nov 07 22:01
    orien edited #20
  • Nov 07 21:58

    flash-gordon on master

    Add project metadata to the gem… Merge pull request #20 from ori… (compare)

  • Nov 07 21:58
    flash-gordon closed #20
  • Nov 07 21:58
    flash-gordon commented #20
  • Nov 07 21:51
    orien opened #20
  • Nov 07 21:44
  • Nov 07 19:56

    flash-gordon on master

    Update CHANGELOG (compare)

  • Nov 07 19:54

    flash-gordon on fix-keyword-warnings

    (compare)

  • Nov 07 19:54

    flash-gordon on master

    Fix keyword warnings This chan… Merge pull request #114 from dr… (compare)

  • Nov 07 19:54
    flash-gordon closed #114
  • Nov 07 19:53
    flash-gordon opened #114
  • Nov 07 19:53

    flash-gordon on fix-keyword-warnings

    Fix keyword warnings This chan… (compare)

  • Nov 07 19:40
    Travis dry-rb/dry-view (master) errored (634)
  • Nov 07 19:37
    Travis dry-rb/dry-view (master) errored (633)
Andy Holland
@AMHOL
And use that to determine how to construct the objects
@solnic perhaps we should have a configuration and delegate that to an object
Piotr Solnica
@solnic
better to skip auto-registering schemas
just define them as constants
that's why I added block syntax for building an object
Andy Holland
@AMHOL
How come @solnic ?
Oskar Szrajer
@gotar
it will be the best if AutoInject recognize it's class or not and then defind as contant not call new on it
Andy Holland
@AMHOL
@gotar just watching your wroc_love.rb talk BTW :)
Piotr Solnica
@solnic
link pls?
Oskar Szrajer
@gotar
nothing to see :p
:cat2:
Andy Holland
@AMHOL
lol I'm sure you're being humble
Piotr Solnica
@solnic
@AMHOL it didn't feel right to use a container for things like schemas or data classes like structs and values, they are treated as app boundaries, not some "abstract service objects" that your app relies on
Andy Holland
@AMHOL
Interesting
What about using them in dry-transaction?
Piotr Solnica
@solnic
so ie whenever I see a require "some_app/validation/some_schema" I know that this thing works at a specific boundary of my system
I never used as a schema as a separate step
Andy Holland
@AMHOL
Ahh OK
You just use them in commands?
Piotr Solnica
@solnic
it's always an object that uses a schema internally and typically talks to a db through a repo or command or sutin
Andy Holland
@AMHOL
That makes sense
Piotr Solnica
@solnic
a...service object :P
one thing I still don't like is that this still mixes an http-specific schema with a lower-level app stuff
not sure how to make this nicer
w/o any duplication
Andy Holland
@AMHOL
Still not sure about the not registering them, it's still a dependency, but I don't have experience using dry-component yet
A separate transaction step? :joy:
Piotr Solnica
@solnic
@AMHOL for me it's not an abstract dependency, that's where I draw the line
think about an ActiveRecord model, it's also a boundary, and a really huge one, everywhere your code references an AR model it makes it clear that a given part of your app is coupled to a database
it's the same here, everywhere you use a schema that validates data coming from an http request it's pretty clear that this is part of your system that deals with http stuff
fwiw you could treat that as an abstract concept and only rely on its interface but I think it's an overkill
Andy Holland
@AMHOL
Yeah, I've backed myself into a corner many times trying to be too strict about things, and past experience would indicate that when I disagree with you I'm wrong lol
But I was still thinking in terms of the interface
Still not sure on that one, will have to try it out sometime I guess
Piotr Solnica
@solnic
well, we can both be right :D
I can make dry-v schemas work with auto-registration, but I don't want to ;)
Andy Holland
@AMHOL
BTW, what do you think of pre-configuring a key mapping in component?
Piotr Solnica
@solnic
wdym?
Andy Holland
@AMHOL
To allow registration under keys that don't have any relation to the class name
Piotr Solnica
@solnic
yeah we can use some configurable strategies for figuring this out
Andy Holland
@AMHOL
sth like
Dry::Component.configure do |config|
  config.mapping = {
    'user_validator' => 'users.validator'
  }
end
Then when it loads UserValidator it registers under users.validator
Rather than just computing keys from the constant name
It's a bad example, but the idea is that it allows for more abstract keys
Andy Holland
@AMHOL
Or perhaps just allow for a custom component loader
Piotr Solnica
@solnic
we can have a configurable object that takes
yeah we can easily do that
we probably should :)
Andy Holland
@AMHOL
:+1:
Tim Riley
@timriley
@gotar I'll be at work in 40 minutes - will look into this stuff for you right away