Where to place common parts when using onion architecture?

I try to apply the onion architecture of J. Palermo, but I have a few things that I struggle with.

I have several parts, and I don’t know exactly where to put them.

  • I have a plugin engine that reads a directory and determines which things to load en to execute
  • There are some resource files with translations that are used in several projects. Where should I put these files?
  • I have some attributes that are used throughout the system. Where to put them?
  • I also have two base controllers, some results and default views. Where should I put them?

All of these elements are used in several projects, so I want to put the elements at a central point.

My current decision structure is as follows:

  • Project.Core (contains domain objects and repository interfaces)
  • Project.Infrastructure (this is a kernel implementation)

I am using MVC2.

+3
source share
1 answer

I do not think that the Moon architecture would solve on its own. I would put all of these elements in one or more projects, as part of another solution, and create Nuget packages that allow me to deploy them wherever they are needed. Thus, I would deploy elements, such as your base controllers, in your MVC project and plugin / translation in your infrastructure project.

Thus, whenever you need to have these elements in your new projects, you just need to deploy the package again.

, ( sln) !

+1

All Articles