knowtheory has quit [Quit: Computer has gone to sleep]
knowtheory has joined #rom-rb
knowtheory has quit [Ping timeout: 252 seconds]
knowtheory has joined #rom-rb
mbj has joined #rom-rb
<mbj>
snusnu, solnic: hi
<mbj>
First day after production and I'll NOT end up in a > 8h day. STRIKE.
<mbj>
Looking forward to OSS.
skade has quit [Quit: Computer has gone to sleep.]
<snusnu>
mbj: yo, awesome
dkubb has joined #rom-rb
<dkubb>
good morning
bf4 has joined #rom-rb
<mbj>
dkubb: hi
<dkubb>
snusnu: the only thing left to do with nested relations is to test axiom-optimizer to make sure it handles the new operations. I may add a few simple optimizations in the next week (like factoring out a nest followed by and unnest of the same attributes) but atm I'm more concerned with it just working
<mbj>
dkubb: First day in production and NOT a > 8h day.
<mbj>
dkubb: But the week before was *horror*.
<mbj>
dkubb: 110h / 8days
<mbj>
dkubb: Inefficient like hell.
<dkubb>
mbj: hi
<mbj>
dkubb: But we made it.
<dkubb>
mbj: sweet
<mbj>
dkubb: Gonna refactor some tech debt away
<mbj>
dkubb: And most importantly backporting extensions to ducktrap/vanguard to OSS ;)
<snusnu>
mbj: please do ;)
<snusnu>
hey dkubb, re nest, cool!
<mbj>
dkubb: I'll come back to oss heavy work in the weekend
<dkubb>
I'll have some time saturday morning too
NemesisD has joined #rom-rb
<NemesisD>
how does one create immutable virtus models?
<NemesisD>
combining Adamantium and Virtus.model(:strict => true) seems to raise coercion errors even when correct values are passed in
<NemesisD>
dkubb: ah ok. looking around the source it isn't quite clear, can i make value objects strict?
<NemesisD>
i'm working around some really repetitive tax code that gets loaded at boot. i want as much as possible for it to explode if i make a mistake
<dkubb>
NemesisD: I have no idea, I don't use virtus for anything really
<NemesisD>
no? do you have an alternative?
<NemesisD>
oh and it looks like it uses Configuration internally which takes strict
<dkubb>
NemesisD: atm I don't use any class builders. I haven't tried recent virtus releases though.
<NemesisD>
ah ok. yeah virtus seems to provide some additional features i need. don't know how i missed the value object section
<NemesisD>
i'm at that weird phase where I don't know if working with typesafe languages is making me do silly things in ruby or if this is reasonable given the circumstances
<dkubb>
hehe
<dkubb>
NemesisD: what other type safe language are you using?
<NemesisD>
dkubb: primarily haskell
<dkubb>
ahh nice, I've been playing around with that too
<dkubb>
I think there's lots ot learn from haskell and applied to ruby
<NemesisD>
it has kind of taught me that someone who isn't a human should really help me out, because I'm not going to stop fat-fingering things and forgetting the types of parameters
<dkubb>
favouring immutable objects and having explicit state changes that return new objects to represent the new state has done wonders for the testability of some of my libs
<NemesisD>
totally agree. i've been doing haskell for personal stuff for a few years now. one one hand it can lower your pain tolerance which can be a disadvantage, but it also shows you the value of pushing data validation to the borders of your code and then reaping the benefits
<dkubb>
now I kind of segregate mutable objects off to the side and strictly control their access, trying not to expose them to the outside world
<NemesisD>
i wish i could go down the path more but i'm working on large legacy rails apps with a team that hasn't seen the light yet. still getting over the thought that making things explicitly frozen/strict about types is paranoia
<dkubb>
yeah, validation at the boundaries is important. it saves you from having to litter all your code with assertions and keeps the focus on the logic
<dkubb>
rails makes it hard. I've found you can build smaller pieces in a clean way, but anytime you have to talk to rails (and test it) things get all wonky
<NemesisD>
definitely adding that to my reading list. only about 25% of "FP in Ruby" literature is valuable, gotta take note when i find some that is
<dkubb>
I accept that for now because there's not a ton of better alternatives in ruby, but I hope that changes
<dkubb>
hehe
<NemesisD>
yeah with rails the easiest wins are the pure concepts that can work without the database. right now i'm making a versioned history of canadian tax tables. small enough that it can just sit around in memory as an immutable object
<dkubb>
most of the FP in Ruby literature seems to be written with minimal expierence doing it in larger scale projects. I've thought we should start to do it more given most of the ROM ecosystem is built this way
<dkubb>
ahh neat
<dkubb>
NemesisD: are you a fellow Canadian?
<NemesisD>
i'd love that. most of what i read is based on the beginning building blocks from FP, so they are along the lines of "ruby has folds and maps and lambdas. use those a lot like FP"
<NemesisD>
dkubb: we're in seattle, but trying our best to do right by our canadian clients to calculate taxes properly ;)
<dkubb>
hehe, nice. I'm pretty close to you guys
<NemesisD>
nice. yeah i think an ex coworker may have actually worked with you. do you know a Ryan Closner?
bf4 has quit [Ping timeout: 264 seconds]
<NemesisD>
i thought i heard through the grape vine that he got an opportunity to work with you a year or two ago. i believe he's a code for america fellow now
<dkubb>
I believe he worked with codebenders/cividata
<dkubb>
I worked for codebenders for a while, and then moved with one of the owners to bloomcrush
<NemesisD>
ah ok.
<dkubb>
I didn't do any work on cividata. I think solnic may have though
<dkubb>
k, gotta run to the doc's now, will bbl
dkubb is now known as dkubb|away
snusnu has quit [Quit: Leaving.]
skade has joined #rom-rb
skade has quit [Client Quit]
skade has joined #rom-rb
skade has quit [Quit: Computer has gone to sleep.]
bf4 has joined #rom-rb
snusnu has joined #rom-rb
zekefast has quit [Quit: Leaving.]
<solnic>
NemesisD: hey there, I saw you were asking about using adamantium with virtus value objects
<solnic>
I would expect it to just work...if that's not the case, please report an issue
<solnic>
NemesisD: re Ryan, we worked together on a project a couple of years ago
svanderbleek has joined #rom-rb
<svanderbleek>
I tried to write an Axiom Adapter to use with ROM, I have some feed back if anyone is interested, long story short I ended up moving on to Perpetuity for now, wanted to use an AWS DB (dynamo, simpledb, or mysql) but will do Mongo because it's the only working Data Mapper pattern out there in Ruby as far as I can tell
<mbj>
svanderbleek: shoot
<mbj>
svanderbleek: I successfully wrote adapters for mongo, arangodb, elasticsearch
<mbj>
svanderbleek: With the featureset I needed at this point.
<svanderbleek>
I had trouble building and running the test suite in those projects, with gem dependencies
<mbj>
svanderbleek: Did you use an existing adapter as template? My adapter had not been updated a while.
dkubb|away has quit [Ping timeout: 245 seconds]
<svanderbleek>
Tried to, so the idea is for your adapter to wrap relation in some object, you call it a gateway, and then implement methods that will be called on the relation such as update
<mbj>
svanderbleek: My adpaters sadly dont have write support. Axiom gained it lately.
<svanderbleek>
Yes that's the thing
<mbj>
svanderbleek: What adapter you used as template?
<svanderbleek>
I just looked through all of them
<svanderbleek>
Memory was the simplest, and the [] and []= plus relation wrap seemed the way to go
<CraigBuchek>
So I'm interested in helping out with integrating Virtus and ROM, as well as Virtus and ActiveRecord. Is anyone working on that? Is there someplace better I should ask?
<svanderbleek>
my last approach which was kind of dumb anyway after realizing it would be pretty hard to do dynamo or simpledb was to use s3 as a memory store
<svanderbleek>
just save and load the whole relations as the db
<mbj>
svanderbleek: I think it is possible to push down lots operations to these dbs, dont just serialize whole relations there.
<svanderbleek>
certainly, it was just a sanity check
<svanderbleek>
adamantium wasn't super happy about that though, ha
<mbj>
svanderbleek: ;)
<mbj>
CraigBuchek: How you'd integrate Virtus and AR?
<CraigBuchek>
Said I wanted to....
<mbj>
CraigBuchek: Provide some EV / EC lib for AR and virtus? To serialize virtus objects as LOB ?
<mbj>
CraigBuchek: ROM itself is planned to be domain agnostic. So there shoulnt be any specialities about ROM <=> Virtus.
<mbj>
CraigBuchek: Sure we can add some syntax shugar ;)
<mbj>
CraigBuchek: You are planning to work on this shugar?
<svanderbleek>
anyway cool project and I'll be watching it to see if I can help, it'd be huge to sketch out at a high level what the adapter pattern will be all about and how it works with session and relation
<mbj>
svanderbleek: The adapters *ideally* dont have any ideas about ROM/session
<mbj>
svanderbleek: They just provide the gateway relation and the ops on this relation are the result of a user interacting with ROM.
<svanderbleek>
but they seem to need to now
<svanderbleek>
ah ok well the gateway relation is a kind of relation adapter
<mbj>
svanderbleek: yeah
<mbj>
svanderbleek: The gateway "quacks" like a relation.
<svanderbleek>
and right now the gateway is totally implicit, no mention of it except in your adapter projects
<mbj>
svanderbleek: All adapters have a gateway
<mbj>
svanderbleek: We need to come up with a more generalized gateway to share cross adapters.
<mbj>
svanderbleek: Think of the gateway as of a Proxy object.
<mbj>
svanderbleek: That proxy decides what todo for this specific database.
<CraigBuchek>
Well, there seems to be a lot of un-DRYness when defining a class in Virtus, then the mapping in ROM. Want to simplify that.
<svanderbleek>
actually the memory adapter now just patches relation directly
<mbj>
svanderbleek: Yeah
<CraigBuchek>
Also want to define attributes in AR classes, and test that the DB matches.
<CraigBuchek>
And make a path from AR to AR+Virtus to Virtus+ROM.
<mbj>
svanderbleek: The other adpaters will generate calls to underlaying db driver while generating state transforming statements.
<mbj>
svanderbleek: For example DML statements in case you are on a SQL database.
<mbj>
svanderbleek: The mongo adapter will use the mongo gems #update etc.
<mbj>
svanderbleek: These adapters "indirectly" patch relations via the driver objects.
<mbj>
The session in rom will "buffer" RA ops till flushed out.
<mbj>
But the axiom adpaters dont need to know about that "buffer".
<mbj>
They are stateless and dump (only memory adpater has state ;) )
<svanderbleek>
yeah good ideas, I'm excited to use ROM with Grape as a kind of API anything framework
<svanderbleek>
take any lib of objects and non invasively put an api and persistence on top
<svanderbleek>
grape-entity handles api transformations nicely
<mbj>
svanderbleek: But true, ROM is defintively NOT production ready ;)
<svanderbleek>
yeah I was using it for non-critical application, an internal tool
<svanderbleek>
just trying it out since I've been following datamapper2
<mbj>
svanderbleek: thx
<mbj>
svanderbleek: I'm very happy to assit you in future rom related work.
<mbj>
svanderbleek: Just ping me and I'm happy to dig through your experimental code and help
<solnic>
svanderbleek: have you seen solnic/rom-demos?
<solnic>
there's a yaml adapter with write support
<svanderbleek>
oh no, I'll check that out
<mbj>
CraigBuchek: You think you can bring the ROM DSL to AR projects? Or what is your exact plan.
<mbj>
CraigBuchek: BTW you should talk to solnic when it comes to virtus ;)
<CraigBuchek>
The Virtus DSL to AR.
<CraigBuchek>
Yeah, thought I saw him on.
<svanderbleek>
solnic: reading those demos would have saved me a lot of time, but was still fun to read the rom source code
<solnic>
svanderbleek: sorry I should've put a link to those demos somewhere in the README
<solnic>
svanderbleek: everything related to insert/update/delete is much more experimental than reading, pls keep that in mind :)
<solnic>
CraigBuchek: I haven't focused on any convenience layers yet because it's just too early, we're starting with pretty much primitive stuff as we want to get those solid before we move to working on improving UX ;)
<CraigBuchek>
OK, then I'll probably start with the Virtus::AR side.
<solnic>
CraigBuchek: Virtus::AR?
<CraigBuchek>
I actually did something like that with AR a few years ago.
<CraigBuchek>
solnic: Define attributes in the Ruby side of the model, so everything is in one place.
<CraigBuchek>
Instead of attributes in the DB schema and associations in the Ruby model code.
<CraigBuchek>
I've started on README files.
<CraigBuchek>
If nobody's doing that, I'll push them to github and post a link here.
<solnic>
what README files?
<CraigBuchek>
README-driven development for my Virtus-AR stuff.
<solnic>
ah ok
<solnic>
I don't know if anybody is working on something like that
<CraigBuchek>
OK. Cool. I'll post here later today and see what you guys think.
<CraigBuchek>
Just looking for some advice and push-back.
<mbj>
CraigBuchek: yeah pls doo so!
lgierth has joined #rom-rb
svanderbleek has quit [Quit: Page closed]
lgierth has quit [Ping timeout: 248 seconds]
dkubb has joined #rom-rb
<dkubb>
good afternoon
<dkubb>
I saw that feedback from svanderbleek, good stuff
<mbj>
dkubb: yeah
<mbj>
have to run, c
<mbj>
*cu
mbj has quit [Quit: leaving]
knowtheo1y has joined #rom-rb
knowtheory has quit [Ping timeout: 264 seconds]
postmodern has joined #rom-rb
bf4 has quit [Ping timeout: 248 seconds]
dkubb has quit [Read error: Connection reset by peer]
breakingthings has quit []
lgierth has joined #rom-rb
knowtheo1y has quit [Quit: Computer has gone to sleep]
knowtheory has joined #rom-rb
snusnu has quit [Ping timeout: 248 seconds]
snusnu has joined #rom-rb
knowtheory has quit [Ping timeout: 265 seconds]
therabidbanana has joined #rom-rb
jfredett-w has quit [Read error: Connection reset by peer]
knowtheory has joined #rom-rb
<CraigBuchek>
What's the difference between the schema and the mapping in the rom-rb/rom README?
<CraigBuchek>
Is the schema there just because the example is in-memory?
<CraigBuchek>
I understand that the mapper can just grab the pieces that it wants, but it seems weird to have to declare the attributes 3 times (schema, mapping, class).
therabidbanana has quit [Quit: leaving]
knowtheory has quit [Quit: Computer has gone to sleep]
knowtheory has joined #rom-rb
<snusnu>
CraigBuchek: the schema defines the relation attributes (i.e. the columns in a table), the mapper defines which relation attributes (columns) it should map to which domain object attributes names (i.e. accessors on the domain object instance), finally, the domain object itself of course needs to define its attributes (i.e. ivars/setters/accessors on the domain object)
<CraigBuchek>
For SQL DBs, will it be able to figure out the schema on its own?
<snusnu>
eventually, yes, currently it doesn't do that
<CraigBuchek>
OK, cool. Then I think that clears up my confusion.
<snusnu>
we definitely want to have some automation/integration in the future, that allows to dry up these definitions, but currently we want to make sure that all of the pieces can be used (and evolve) more or less independently of each other
knowtheory has quit [Ping timeout: 248 seconds]
<snusnu>
like, you should be able to use a relation schema with pure axiom, or with rom-relation (and whatever mapper)
<snusnu>
and you should be able to use rom-relation without rom-mapper, i.e. with your own mappers injected
<snusnu>
just to add usecases that justify this separation, think reporting for example, you probably won't need to map the returned tuples to "proper" objects, them being tuples should be enough to print charts, so you wouldn't need a mapper, and if you wouldn't need a mapper, you don't need rom-relation
<CraigBuchek>
That's cool, and lets me know that ROM is well-architected. But I'm really interested in a more out-of-the-box experience, like DM 1. Hence, my interest in integrating Virtus.
<snusnu>
i see, and that's totally understandable, we want to provide that ootb experience for specific setups, but we need to get the fundamental apis right before we tackle those parts
<snusnu>
CraigBuchek: fwiw, we definitely want to have some sort of integration between virtus and rom, most likely in the form of some "virtus plugin" that generates a mapper compatible with rom
<snusnu>
something like that should be pretty easy to put together, there should be nothing really stopping you .. at least for simple objects .. rom currently doesn't have the concept of relationships, so it can't really handle embedded values and embedded collections via a nice (familiar) api just yet
<snusnu>
if you're interested in more details wrt relationships, lemme know, i can explain it in more detail
skade has joined #rom-rb
<CraigBuchek>
OK, just finished pushing my gems (really just READMEs for gems, for discussion here).
<CraigBuchek>
Ideally, the AR front-end would be a stepping stone, leading people from the Rails golden path to the ROM platinum path.
knowtheory has joined #rom-rb
CraigBuchek has quit [Quit: CraigBuchek]
CraigBuchek has joined #rom-rb
skade has quit [Quit: Computer has gone to sleep.]
CraigBuchek has quit [Quit: CraigBuchek]
<snusnu>
CraigBuchek: one thing i noticed in the virtus-rom readme, is that you're trying to bind the model definition to a relation (that's what you should do, #repository makes no sense, the relation already knows about that form the schema setup)
<snusnu>
"but" the thing is, actually, your domain object should know nothing about the fact that it's going to be used with rom
<snusnu>
i'd rather vote for making that connection "externally"
<snusnu>
i realize that it is mostly a "dsl thing", but it somehow gives a "wrong" impression
<snusnu>
i also realize that strictly speaking, with your example, theres no need for any virtus *instance* to know about the fact that it's interacting with rom, but as i said, the fact that the DSL method #relation is called from within the domain model definition, IMO, is a bit "smelly"