Re: How do you create a data access layer?
- From: Andreas Koch <nospam@xxxxxxxxxxxxxxx>
- Date: Sat, 27 Aug 2005 23:23:56 +0200
swansnow wrote:
Maybe this is another newbie question... :)
I've read that you really should have a abstracted data layer, to decouple database accesses from the rest of your code. I'm not really sure what this works out to in practice. Here's a guess:
I'd say make 3 things:
A) a Form with controls B) an object or record wich contains similar data as the form, but isn't influcenced by events and stuff C) procedures (standalone or part of object B) that do database operations that require or return Bs.
So, A shows, B is cleared.
User enters Street, City and Name and presses "new customer"
The buttonclick transfers Street, City and Name to an TCustomer Object MyNewCust
Procedure CreateCustomer(MyNewCust) is called and issues an "insert into customer values MyNewCust.street,MyNewCust.City, MyNewCust.Name" SQL statement.
Thats how i would do it with manual SQL - no idea how it could be used with data aware controls :-)
.
- References:
- How do you create a data access layer?
- From: swansnow
- How do you create a data access layer?
- Prev by Date: How do you create a data access layer?
- Next by Date: Re: How do you create a data access layer?
- Previous by thread: How do you create a data access layer?
- Next by thread: Re: How do you create a data access layer?
- Index(es):