locked
Base Architecture for multiple Web Applications RRS feed

  • Question

  • Hi

     

    I need help in creating Architecture Layers: DAL has 30 Methods.

     

    WebApp1 calls DAL.Method1

    WebApp2 calls DAL.Method1 and DAL.Method2

    WebApp3 cals DAL.Method2 and DAL.Method4

    ...same like 30 Web Apps.

     

    I need suggestion on selecting an approach:

     

    Option 1:

     - Put all Methods (Method1...MethodX) into one .NET Component and refer it from all Web Applications

     

    Option 2:

    - Have as many DAL as Web Application and have separate references to it. Like WebApp1 refers DAL1, WebApp2 refers DAL2, etc

     

    Which approach will be good to follow. For example does option 1 allocate unwanted-memory on executing WebApp1 but Option2 requires duplication of code and maintenance would be an issue?

     

    What are the advantages and disadvantages of both options?

     

    It would be great if you can guide me in creating a base architecture.

     

    Thanks in advance.

    Monday, February 18, 2008 3:46 PM

Answers

  • Put all your methods in one DAL project that compiles to a dll. Add a reference to it from your other projects. Remember the DRY principle: Don't Repeat Yourself.

     

    I recommend setting up a business layer (again, in a separate class library) and only accessing that from your web applications. The presentation layer should never access the data access layer directly. Instead, use your data access layer for the persistence of your business objects, and make the presentation layer use the business objects so that their functionality is encapsulated.

    Monday, February 18, 2008 6:22 PM