Search code examples
data-access-layerbll

Is it worth it to write a bunch of 2 liner functions in BLL object just to re-route to DAL?


It seems pretty silly to me. What don't I get?


Solution

  • I've run into cases like this where my app calls a business layer to select a list of values. The business layer then calls through to the Dal to do the data access. In a lot fo these cases, there is no apparent reason for the business layer method that does the pass through, but it does leave room to add business logic, processing of the data, etc in the future. It also helps keep your app decoupled, which will make testing much easier.

    So, I say keep the one liners, but if your inserts, updates, etc are still one or two lines, you need to re-think where you are doing your validation and business level data processing.