Skip to content
This repository has been archived by the owner on Nov 30, 2022. It is now read-only.

Handling domains in compendium #6

Open
pirita opened this issue Nov 21, 2018 · 2 comments
Open

Handling domains in compendium #6

pirita opened this issue Nov 21, 2018 · 2 comments
Labels
feature New feature or request

Comments

@pirita
Copy link
Contributor

pirita commented Nov 21, 2018

Let's say we have the following domains:

  • src/main/protocols/common:
    • models.avdl
  • src/main/protocols/domain1:
    • models.avdl
    • service.avdl
  • src/main/protocols/domain2:
    • models.avdl
    • service.avdl

How are going to handle these protocols? We propose some alternatives:

  1. Domains are defined as dependencies and a list of files:
Domain(name: String, dependencies: Set[Domain], files: Set[String])

val common = Domain("common", Set.empty[String], Set("src/main/protocols/common/models.avdl"))
val domain1  = Domain("domain1", common, Set("src/main/protocols/domain1/models.avdl", "src/main/protocols/domain1/services.avdl"))
val domain1  = Domain("domain2", common, Set("src/main/protocols/domain2/models.avdl", "src/main/protocols/domain2/services.avdl"))

With this approach, we don't upload duplicated files to catamorph and it is very easy to increment protocol versions. However, we have the problems of cyclic dependencies and dependencies resolution.

  1. Domains are defined as a list of files:
Domain(name: String, files: Set[String])

val common = Domain("common", Set("src/main/protocols/common/models.avdl"))
val domain1  = Domain("domain1", Set("src/main/protocols/common/models.avdl", "src/main/protocols/domain1/models.avdl", "src/main/protocols/domain1/services.avdl"))
val domain1  = Domain("domain2", Set("src/main/protocols/common/models.avdl", "src/main/protocols/domain2/models.avdl", "src/main/protocols/domain2/services.avdl"))

This is an easier way to handle dependencies between protocols. However we have duplicated information, ex, We are going to upload three times "src/main/protocols/common/models.avdl" to catamorph.


These approaches arise some questions:

  • Is the sbt-plugin of catamorph going to handle multiple files?
  • Do we allow uploading one single file to catamorph? Or multiple files?
@pirita
Copy link
Contributor Author

pirita commented Dec 13, 2018

For an initial approach we have decided the following:

  • Domains are going to be a single file.
  • Initially it will support only avdl files, but having in mind that there will more supported types.
  • The basic endpoints for the API are:
    • A ping endpoint
    • POST: Upload a raw domain file.
    • GET: Download a raw domain file.
    • GET: Download a client for a given domain.
  • Compendium supports multiple storages. There may be storages dependent on the raw file type (for example schema registry for avdl files).

@pepegar @JesusMtnez Am I missing something else?

@pirita pirita changed the title Handling domains in catamorph Handling domains in compendium Dec 13, 2018
@pepegar
Copy link
Member

pepegar commented Dec 14, 2018

👍 to this, but leaving the client generation for later? it can get a bit nasty. Let's do just PUT POST & GET of schemas and do client gen together with when we create the SBT client?

@JesusMtnez JesusMtnez added the feature New feature or request label Jul 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants