3

My current .NET project looks like below:

Solution (.sln)
--BusinessProject A (.proj)
--BusinessProject B (.proj)
--DataLayer (.proj)
  --A separate project calling ExternalService 1  (folder)
  --A separate project calling ExternalService 2  (folder)
  --A separate project calling ExternalService 3  (folder)
  --A separate project calling ExternalService 4  (folder)

Both of the Business Projects use one or more services in DataLayer.

The disadvantage of this design is:

  1. Even if one change occurs in ExternalService 1, we will need to build, deploy, run regression and go through entire product development-deployment cycle.
  2. DataLayer communicates to multiple externalServices (all defined in a single project). This makes DataLayer very heavy & it ends up doing multiple things.

So my two cents on this is to

  1. separate DataLayer as a separate solution, deploy it somewhere in the same ecosystem and communicate with it via a protocol (say REST)

What are other alternatives and approaches to the above solution ? Are there any known .NET related design patterns for the same ?

  • Is data layer transactional? What kind of services are these External Services? Are they service clients? Are you agree with having to deploy all the data layer when a single External service changes? How many external services do you have? – Laiv Jul 04 '17 at 16:10
  • What you gain in flexibility, you pay for in complexity. Don't forget that. – RubberDuck Jul 04 '17 at 21:40
  • @Laiv: All those services, in turn call `other external services`. They might do a `SOAP request` or a `REST call` or `talk to Cassandra DB`, etc..,, There can be `n` number of external services & they might grow with time. – now he who must not be named. Jul 05 '17 at 07:25
  • What data layer contains ? All data even those specific to project A or B, or only commons ?Can't you split your data layer ? – Walfrat Jul 05 '17 at 07:36
  • The design pattern for this is called [repository](https://www.martinfowler.com/eaaCatalog/repository.html) where you have a repository interface and one or more different implementations for it – k3b Jul 05 '17 at 08:30

0 Answers0