Fork me on GitHub
#polylith
<
2022-02-28
>
mindbender08:02:18

In line with https://polylith.gitbook.io/poly/misc/naming, won't the name services communicate better what bases do?

mindbender09:02:40

Or how can one map the previous concept of services to a concept in the Polylith architecture?

tengstrand09:02:49

One or more base (most often only one base) + a number of components can be put together in a project from where we can build an artifact. This artifact can be e.g. a stand alone command line tool (like the poly command) or a service. The base has the role of connecting the outside world, e.g. a command line interface or a REST API, with the code that performs the task, e.g. executing a CLI command or a REST endpoint. Bases and components are just building blocks, and you decide which kind of artifacts you want to build from them (e.g. a service).

👍 1
👏 1
mindbender14:02:05

Would it be a good idea to have a component-model and a component-resolver as components where component-resolver depends on component-model to be used in a graph-api base?

mindbender14:02:59

The question in particular has to do with the naming pattern like I highlighted in the question

mindbender14:02:07

Or is it just better to box them up and expose the interfaces from separate namespaces?

tengstrand15:02:12

If component-model is only used from component-resolver then it might be an idea to keep it inside component-resolver in one or several namespaces (where the top namespace is named component-model if more than one). You have a big freedom to divide your components in namespaces, but also to split your code into several components. It’s very much up to you what you think is best, and you can experiment a bit in the beginning, and also get some inspiration from other Polylith codebases, e.g. the https://github.com/polyfy/polylith codebase itself or the https://github.com/seancorfield/usermanager-example/tree/polylith. I would advice you to drop the component- prefix also.

👍 1
mindbender15:02:34

Yeah, the component- was a just placeholder for the domain concept e.g. invoicer-

👍 1
kendall.buchanan18:02:24

@U0HJYDTP1 I personally think it’s fine to do what you’re doing—there’s always a chance component-model could be used in another base without component-resolver in which case you have fewer dependencies and less being imported into one of your bases.

👍 1