Database Mapping as Data Access Layer for Business logic

Posted on 2006-04-04
Last Modified: 2006-11-18

AS we know that during mapping of database to business

logic, We mapped table to class with columns to Properties.

 but if we have complex queries with multiple joins

and "Group By" clause then what is the mapping of this

query to business ligic side plus how we display data

retrieved by query to the user.

How we handle other issues,

Keeping all aboive question in mind how we formed a Data Access Layer at Business Logic side , or what will be design look like.

How many Interfaces or abstract functionality it have.

Will you suggest a design or any good link that further

elobarate this design logic.

Thinks in advance!

Thanks in advance!
Question by:virdasardar
    1 Comment
    LVL 9

    Accepted Solution

    Do not map one table to one class: While a simple approach it is very problematic and I think causes major issues for the design.

    Classes model domain abstractions and tables are part of a a relational design - they are different things doing different jobs.

    Spend some time modelling the data in a relational database and separate time modellnig domain classes without binding one to the other on a one-to-one basis.

    You can then create procedures and views on the database that let you serialise and/or deserialise the objects efficiently.

    As a test you have to ask yourself if you are able to search for serialised objects efficiently and if you can't then you have a problem.


    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    Join & Write a Comment

    Introduction: Often, when running a query with joins, the results show up "duplicates", and often, those duplicates can be "eliminated" in the results using DISTINCT, for example. Using DISTINCT is simple: just add it after the SELECT keyword, an…
    CCModeler offers a way to enter basic information like entities, attributes and relationships and export them as yEd or erviz diagram. It also can import existing Access or SQL Server tables with relationships.
    Video by: Steve
    Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now