c# - Allow communication between Services? -
we working on number of services, lets personservice, insuranceservice , paycheckservice. access these services through api there controller.
there situations paycheckservice needs information person. we're using layer between controller , service to:
- get information personservice
- get information paycheckservice
- combine , return result.
which working @ moment more services created dependency between services increased. results in more logic (magic?) in 'between layer'.
i've been reading fowler on subject of dependency injection , service locator useful. (we use unity ioc , di here , there shared functionality)
the question strategy let services consume other services?
(messaging, injection, rest,..)

your services should autonomous. should not communicate each other. shoud think every single service independent product can used in other projects or can serve other companies different purposes.
if servicey needs data servicex, servicey shoud data input, shoud not connect other services data.
you can put facade (or facades) in front of services orchestrate services. facade application's high level business includes workflows first data servicey give data servicex , result x etc.
if services not web services , components in business layer of app, should autonomous , should not use each other , controller can facade orchestrate service components.
Comments
Post a Comment