Skip to content
This repository has been archived by the owner on Feb 4, 2021. It is now read-only.

Seek a way around constantly flip-flopping interfaces #6

Closed
sdboyer opened this issue Apr 16, 2014 · 5 comments
Closed

Seek a way around constantly flip-flopping interfaces #6

sdboyer opened this issue Apr 16, 2014 · 5 comments
Assignees

Comments

@sdboyer
Copy link
Owner

sdboyer commented Apr 16, 2014

the way gogl is written right now, each graph implements a handful of interfaces. keeping track of this in client code is kinda crazy, and just about destroys the idea behind interfaces: to abstract implementation details away. when there are no unified interfaces, it effectively means that client code has to know which graph they're working with, and which interfaces they can switch it to. bleh.

the idiomatic Go answer is to export the struct, and have that be the primary thing that's passed around, except in cases where it a single, more specific interface is genuinely all that's needed. that may be the way to go (though it kinda runs counter to #1), and would definitely result in a giant explosion of godoc.

@sdboyer sdboyer self-assigned this Apr 16, 2014
@sdboyer
Copy link
Owner Author

sdboyer commented Apr 16, 2014

basically...either the struct has to be exposed, or a unique interface has to be composed for each one. kinda six one half dozen the other.

@sdboyer
Copy link
Owner Author

sdboyer commented Apr 16, 2014

pinging @technosophos and @mattfarina for their input on this

@sdboyer
Copy link
Owner Author

sdboyer commented Apr 16, 2014

ok, it's pretty clear that the best solution here is to export the structs. the only real argument against that is 'noise' in the godoc; all the other arguments are in favor of it.

@sdboyer sdboyer closed this as completed Apr 16, 2014
@mattfarina
Copy link

I was thinking the same thing. I gave it a day and still came to the same conclusion.

@sdboyer
Copy link
Owner Author

sdboyer commented Apr 17, 2014

excellent - now it's just a SMOP before declaring VICTORY

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants