Let us understand the conventional programming model before
we go into actual implementation of the ORM.
Figure 1
We have a presentation layer that deals with User Interfaces
and we have a Business Logic layer which deals with the business rules of the
application. In 3-tier applications we have a dedicated layer that deals with
the database related activities called as Data Access layer (DAL). DAL
typically deals with connecting to database executing the commands or stored
procedures and getting the resultant sets.