views:

47

answers:

1

We are taught to develop multiple layers structure application in different kinds of information. Like business layer, service layer, data access layer, UI layer ... and so on.
But why we need to apply this pattern ?
What are the benefits from these ? Is there any more deeper means behind these patterns ?
Can someone share your experience that you benefit from multiple layers ?

+4  A: 

Just some that I have come across

  1. Separation of Concerns - at a contract/object level
  2. Allows design of each layer to be individual - you can focus on the task of each - extension of 1
  3. Allows multiple developers to work on each layer at the same time
  4. Allows you to swap out layers / share functionality (thanks for the comment =>)
  5. Each layer can be/is an abstraction of the operational view of your software
  6. Allows for independent testing and verification of layers
  7. Allows your brain to think in that layer not the whole while coding
  8. I have found it easier for junior programmers to on-board to a project faster as they can be assigned "easier" layers

Some down sides

  1. You quickly get very complex on large software projects and need assistance from other types of patterns - ioc/mvc/mvvm
  2. When your layers meet the physical world you can end up with complex operational issues like app servers/web servers/different servers/SAN/Storage
  3. You can end up with some interesting "messaging" issues - i have but "messaging" in quotes as there are "xml"/"object to Object"/"Authentication"
  4. Your brain can often melt when look at the whole
jpg
I would add also, the ability to replace layers as required, and to share functionality. (Didn't think this was worth a separate post).
simonjpascoe
Allows for independent testing and verification of layers, I think this item is really good, otherwise we can not test our software well.
MemoryLeak
Nice summary and +1 for number 4 on the downsides :)
Daz Lewis

related questions