Question

I'm working on a web project that is quite decent in size. At the same time this project is about to expand to multiple platforms like Android, iOS etc. My intention is to centralize code that can be accessed across multiple platforms.

However, I'm little confused about organizing layers (BL, DL, UI) as I'm very new to this design thing.

My intention is to keep all the code related to specific module in a single class library. That is why I have kept DAL and BL inside each module.

Approach 1

      - (UI) Web Project          
      - Module1 (Class Library)
             - Module1.DAL
             - Module1.BL
      - Module2 (Class Library)
             - Module2.DAL
             - Module2.BL
      - Module3 (Class Library)
             - Module3.DAL
             - Module3.BL

Approach 2

      - (UI) Web Project          
      - DAL (Class Library)
             - Module1.DAL(folder)
             - Module2.DAL(folder)
      - BL (Class Library)
             - Module1.BL(folder)
             - Module2.BL(folder)

As per my understanding most of the people goes with second approatch. However, can I achived same decoupled architecture using first approatch?

No correct solution

OTHER TIPS

I would think Approach 1 is much better since you can isolate the entire stack for a single module. However, you may want to place your Data and Business classes in different projects.

You can also achieve sharing of business logic across multiple platforms by introducing a service layer.

For an idea of how it can be done, check out http://serena-yeoh.blogspot.com/2013/07/layered-applications-3-tier.html

You can also download samples from here. http://layersample.codeplex.com

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top