I have been working on an ASP.NET/C# web app for some time and its size has gotten way to large for how it is being programmed. It has become very hard to maintain and getting harder quickly, something that used to take an 1hr to update now takes about 3-4hrs.
I believe that reworking the app to use different layers would help solve many of these problems. However the more I read the more it seems that everyone does it differently, but achieve mostly the same goals.
I have seen layers such as Presentation/UI, DB, Business, Services, ect. It appears that a 3 layer may be the best but I am unsure.
What layers should I have in a web app and what should each include or be limited to?
Words from previous experience are most appreciated.
I believe the common approach is to have 3 layers: presentation, business logic and data access. It should provide for a good foundation.
Having said that I need to point out that division into layers may not help very much with ASP.NET WebForms project. The biggest issue of this framework is its code behind which lures developers into creating monster pages that talk to all layers and services simultaneously to fetch the data to display. The cure is to work out this presentation layer first and let the code only interact with one specific layer (most usually, the business logic). When (and if) this is done, then the project may be successfully refactored.