1 Reply Latest reply on Jul 23, 2009 8:38 AM by 843833

    Business layer

      I create the following architecture:
      Business layer

      What kind of functionality need to be in the business layer.

      Lets take save user action. The dao need to do all the validate and the save.
        • 1. Re: Business layer
          The save user function will involve using all three layers.

          The facade is responsible for making the functionality available to your user (ie web front-end). It should generate valid method calls on the business layer. In your instance, the facade may test to make sure the username is not an empty string.

          The business layer should ensure that any requests are valid according to your business needs.
          In your case the business layer may check, for instance, that the name contains no swear/curse words.

          The data access layer should be involved in doing nothing more than transfering between the physical database and the data access objects your business layer uses to represent it.

          So I guess to directly answer your question, the DAO does not do any validation if possible, it will only do the saving part. The business layer is most likely to do the validation.

          Hope this helps,