1

So let's say I have an app with two resources User and Messages. Currently, these resources are in their own zomes, where each Zome has only one entry. But now I am thinking about moving everything into one zome (to reduce code and logic repetition), so one zome with two entries (User and Message). Is this a bad way of structuring an hApp? How should I decide whether an Entry deserves its own zome?

Akritrime
  • 95
  • 1
  • 6
  • I feel like this is more art than science. On principle I would say your current structure is best -- but you want your code organisation to work for you in the long run, not against you. It should bring more clarity than yak-shaving. What sort of code and logic repetition are you getting bogged down with? – Paul d'Aoust Dec 11 '18 at 17:36

1 Answers1

1

zomes are the lowest level of composition in the Holochain ecosystem. You want to break things into zomes so you can re-use them in other places. So the answer to your question is: put them together if your idea of a user is tightly bound to your idea of a message. Put them is separate zomes if you think you would use your message or user zome in another project.

zippy
  • 1,228
  • 10
  • 19