component

peeja 2016-09-10T17:17:47.000014Z

I think I'm missing something about Component and the Reloaded workflow. Why would you make more than one component? Why not put the entire app into a single component? It's still an instance with a lifecycle, so you can still reload it. I imagine there are cases where you may want to reuse a component with a different configuration, such as when you need two DB connections, but other than that, is there a reason to have multiple components?

donaldball 2016-09-10T18:09:00.000015Z

I prefer each component to have a single responsibility, so that I can test them (ideally in integration with the stateful service they provide) independently, and can compose them in novel ways

donaldball 2016-09-10T18:10:52.000016Z

Some folk also like to work with reusable components, e.g. the system project. Me, I find my trivial components are trivial to write, and my complex components implement protocols only germane to the app in which they live, so I don’t get much leverage from that avenue

donaldball 2016-09-10T18:13:37.000017Z

I also tend to write apps that have a few different mode of operations, that need different projections of an overarching system. E.g. in one mode, it needs a db pool, an encrypter, and a message bus; in another mode, it needs a message bus, a decrypter, and an emailer. Starting only the bits that I need makes a meaningful difference in resource utilization.

seancorfield 2016-09-10T20:14:00.000018Z

☝️:skin-tone-2: This is what we do too. Our app has several components that we can swap with different implementations and test independently.