Still unclear on how to use Typed Datasets in BLL...

OK, I have decided to use typed datasets in my data access layer (DAL). So, my question is, do I really need to create a business logic layer (BLL)

From what I have read, you can extend the dataset classes in the DAL using partial classes and place business logic there. Doesn't this combine the DAL and BLL into one component

Or is there something I'm missing Do you create the BLL and start by referencing the DAL project and inheriting the classes from the DAL and extend the classes there I don't get where one ends and the other starts. OR, if it really makes a difference. ...or do I even know what I'm talking about...

Background: VB 2005, Winform app, expertise level: intermediate+, small application audience, single developer.

Thanks,

Jim



Answer this question

Still unclear on how to use Typed Datasets in BLL...

  • stefanh

    Nevermind... I finally found the answer. I just had to re-read it.

    http://msdn2.microsoft.com/en-us/library/aa581779.aspx

    Jim


  • beechum1

    In the msdn example there are methods which return a dataTable, like mthod 'GetProducts'. You can bind such an object to a grid


  • Reta

    It depends on the kind of classes you are working on ..
    If the Business layer is nothing more than extension of DL layer you can igonre it.
    But if you are using lots of complex rules then I would suggest to use it logic resides in one place, cleaner to fix bugs later.
    Regarding Typed dataset they are many times faster than untyped datset. I know its pain to create lots of typed dataset but in end you get speed efficency.

    Cheers !!!
    sam !!

  • JiltedCitizen

    In an app I wrote using V1.1 of the framework (no support for partial classes) I had to use to approach of keeping the business logic seperate from the type dataset.

    I used a pattern that is known as the TableModule pattern (by Martin Fowler).

    Geert


  • hailstorm

    Not quite-

    I thought I had if figured out but then using the BLL in the UI has a new problem.

    I created my DAL and BLL according to the above article. I then created a new project (for the UI) and referenced the BLL project. I then tried to bind a datagridview on my form to the class in the BLL and it doesn't show any fields.

    What am I missing Is there some article somewhere on how to use BLL objects based on typed datasets in the UI

    Thanks,

    Jim


  • mimi_farah

    OK, so let's assume that I would like to separate out my business logic. How do actually do that Do I create a new class library, reference the DAL project, create new classes that inherit the DAL classes Then start adding logic and validation there

    Thanks for your help

    Jim


  • JayaC

    It's a programming model preference. If you intend to put logic into DataSet events to handle validation or post-change functions, then it makes sense to co-locate that business logic in the same type as the DataSet. On the other hand, if the DataSet is simply a container and validation or other logic is isolated to formal points (like "save"), then maybe the business logic should stay separate from the DataSet. I tend to go with the second approach because it helps promote statelessness, which in turn (I think) improves flexibility and reuse.

  • Still unclear on how to use Typed Datasets in BLL...