dibley1973 / OpenRMS

Open RMS is an Open Source project with the intention of delivering a retail management platform that is free to install, use, modify and distribute.
GNU General Public License v3.0
9 stars 7 forks source link

Dependencies between contexts #20

Closed johncollinson2001 closed 8 years ago

johncollinson2001 commented 8 years ago

I would imagine contexts will have dependencies on each other - e.g. the stock context looking up a list of products or something.

How will we manage these dependencies?

If each context is wrapped up as a micro service, surely the other contexts should use the service as per any other type of client? Should we expose the micro service as both REST and a standard assembly reference?

No idea what the correct answer is here, open for discussion.....

jadjare commented 8 years ago

If each context is wrapped up as a micro service, surely the other contexts should use the service as per any other type of client? Yes, I think each context must talk via the service API's... If the chosen API is via REST then this should be the mechanism for all communication

Should we expose the micro service as both REST and a standard assembly reference? Personally I don't think it would be a good idea to have more than one service API per bounded context. I think it could end up with different developers making mix and match decisions on how to communicate between contexts. That said I don't think that means that a bounded context cannot only expose a service available by assembly reference - I'm just not sure it's a good idea to have both.

Just to note, I suspect there's another side effect of using microservices and that is that domain events will almost certainly need to be dispatched and processed via a message queue of some sort. With assembly references domain events will be able to be handled more directly.

Not 100% set on the above, just my thoughts.... ultimately if we keep things as simple as possible and don't assume we need things until they are needed, then questions such as this will probably answer themselves.

dibley1973 commented 8 years ago

I am kind of learning to microservices requesting information via communicating via web-api so that a more plug-inable then as new modules are developed by us or other developers/teams as long as the API is well documented ANY module can connect to another module.

Just one option of course. I expect there are other solutions available for making them all plugable too.

johncollinson2001 commented 8 years ago

Discussed and agreed in #19