1

Can you guys give me a real world small business case example where the Onion architecture would be a better choice than the 3 layered architecture?

Thanks,

Miguel

Miguel
  • 53
  • 7
  • 1
    It depends on the project size. Simple projects that dont need unit testing and for example have 1-2 pages, single entity model, etc. then 3 layers would take less time to implement and still look well. For more complex cases - using IoC, decomposition (and as a possible implementation - Onion architecture) would be better choice. – neleus Oct 19 '15 at 10:09
  • 1
    Take a look at the following two articles: http://www.methodsandtools.com/archive/onionsoftwarearchitecture.php and https://medium.com/@fbzga/clean-architecture-in-ruby-v2-d2293c78d4a6 – schaueho Oct 20 '15 at 09:02
  • @neleus projects that do not need unit testing? I have never heard of such category of projects. Onion architecture is a type of a layered architecture, some say that it is a layered architecture done right, with the most important advantage compared to the traditional 3 layered architecture being not leaking the data access infrastructure code into the upper layers. – Adam Siemion Jan 08 '16 at 18:59
  • Yes, in some cases project can do simple calculations and have minimal UI and it still can have value for business. For such case I don't think it's worth unit testing. Though I'm a fan of TDD, from my experience unit testing has some complexity threshold with negative business value. When project crosses the threshold the business value becomes positive. – neleus Jan 11 '16 at 09:32
  • Use onion architechture when testability if the most important concern. By 'testability', I mean the ability to write unit tests for any part of your code. – user1040323 Aug 25 '17 at 10:21

0 Answers0