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 ?
views:
47answers:
1
+4
A:
Just some that I have come across
- Separation of Concerns - at a contract/object level
- Allows design of each layer to be individual - you can focus on the task of each - extension of 1
- Allows multiple developers to work on each layer at the same time
- Allows you to swap out layers / share functionality (thanks for the comment =>)
- Each layer can be/is an abstraction of the operational view of your software
- Allows for independent testing and verification of layers
- Allows your brain to think in that layer not the whole while coding
- 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
- You quickly get very complex on large software projects and need assistance from other types of patterns - ioc/mvc/mvvm
- When your layers meet the physical world you can end up with complex operational issues like app servers/web servers/different servers/SAN/Storage
- You can end up with some interesting "messaging" issues - i have but "messaging" in quotes as there are "xml"/"object to Object"/"Authentication"
- Your brain can often melt when look at the whole
jpg
2010-08-09 15:02:56
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
2010-08-09 15:04:24
Allows for independent testing and verification of layers, I think this item is really good, otherwise we can not test our software well.
MemoryLeak
2010-08-09 15:06:14
Nice summary and +1 for number 4 on the downsides :)
Daz Lewis
2010-08-12 14:45:27