Onion Architecture

前端 未结 2 1085
一向
一向 2021-01-30 18:11

I am setting up a project structure for an upcoming internal application trialling the Onion Architecture proposed by Palermo (http://jeffreypalermo.com/blog/the-onion-architect

2条回答
  •  既然无缘
    2021-01-30 18:30

    1. Yes they are, expect for the Dependency Resolution. These dependencies should be the other way around.
    2. As the name (and the corrected references) implies it's purpose is to host some kind of IoC Container solution. It is no place for Helper classes, expect helper classes for resolution purposes.
    3. The Core defines Interfaces for DAL or Domain Services. DAL and WebServices implements these interfaces. Inside the UI you would use the DAL or Service implementations through the defined interfaces. the correct implementation would be resolved through the help of the Dependency Resolution component (have a look at the concept of "Inversion Of Control" or "Dependency Injection").
    4. As described in 3. the main thing is, that in Core you put the interfaces that will be implemented inside DAL and Web Services. And in Core you would implement your real business model. this model can make use of the DAL and the Web Services via the defined interfaces (with the help of the Dependency Resolution component).

提交回复
热议问题