Skip to content

blocks: implements objects.Block#66

Open
zchee wants to merge 4 commits into
lestrrat-go:masterfrom
zchee:objects-block
Open

blocks: implements objects.Block#66
zchee wants to merge 4 commits into
lestrrat-go:masterfrom
zchee:objects-block

Conversation

@zchee

@zchee zchee commented Aug 28, 2019

Copy link
Copy Markdown
Contributor

Implements objects.Block.
The Block interface impl might be ugly, pls advice how to implements it 🙏


TODO:

  • implements each Blocks []interface field

@zchee zchee force-pushed the objects-block branch 3 times, most recently from da4c11a to 0e57e67 Compare August 28, 2019 04:48
@lestrrat

Copy link
Copy Markdown
Collaborator
  • This is a judgement call, but I want structure definitions to live in objects/interface.go (think of it as a .h file in C), so I'd like to see stuff in blocks.go like type XXX struct { } to be moved to that file.
  • I don't know exactly how block elements work, but once we publish Block.Elements as []interface{} we will be stuck with that type declaration onwards. I haven't analyzed it yet myself, but I think there should be at least an attempt that trying to define what Go type can go into Block.Elements

@zchee

zchee commented Aug 28, 2019

Copy link
Copy Markdown
Contributor Author

@lestrrat Thanks for advice. will fix and implements more structs.

@zchee

zchee commented Oct 16, 2019

Copy link
Copy Markdown
Contributor Author

@lestrrat I have almost implemented the Slack block feature. but uses interface on some types.
What do you think about this?

@lestrrat

Copy link
Copy Markdown
Collaborator

One thing that might be good to have: an actual consumer code of your data objects. For example, how do you actually create/consume Block elements? This will tell you if it's a good idea to use interfaces and/or if you have the adequate methods to properly use them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants